teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

4

tuiki

2019/08/08 08:54

投稿

Y0241-N
Y0241-N

スコア1066

title CHANGED
File without changes
body CHANGED
@@ -135,4 +135,25 @@
135
135
  ###追記
136
136
  修正依頼の通り、PointSizeを調べてみたところ、Unity上とWebGL上で同じ値が返ってきているにもかかわらず、点の大きさが明らかに異なっていることがわかりました。
137
137
  ![![イメージ説明](3748ac58d4f9cde885d4c386f1bfc283.png)]
138
- ![イメージ説明](973b0587284045f6e1b2d79c1ab3506e.png)
138
+ ![イメージ説明](973b0587284045f6e1b2d79c1ab3506e.png)
139
+
140
+ 表記はこのようなスクリプトで行っています
141
+
142
+ ``` C
143
+ using System.Collections;
144
+ using System.Collections.Generic;
145
+ using UnityEngine;
146
+ using UnityEngine.UI;
147
+
148
+ public class PointSizeText : MonoBehaviour
149
+ {
150
+ private Renderer PC;
151
+ public Text text;
152
+ void Update()
153
+ {
154
+ PC = this.GetComponent<Renderer>();
155
+ PC.material.EnableKeyword("_PointSize");
156
+ text.text ="PointSize:" + PC.material.GetFloat("_PointSize").ToString();
157
+ }
158
+ }
159
+ ```

3

誤字修正

2019/08/08 08:54

投稿

Y0241-N
Y0241-N

スコア1066

title CHANGED
File without changes
body CHANGED
@@ -134,5 +134,5 @@
134
134
 
135
135
  ###追記
136
136
  修正依頼の通り、PointSizeを調べてみたところ、Unity上とWebGL上で同じ値が返ってきているにもかかわらず、点の大きさが明らかに異なっていることがわかりました。
137
- ![![イメージ説明](3748ac58d4f9cde885d4c386f1bfc283.png)](1c9dfffd0242b9911e2cebe3c5c68b06.png)
137
+ ![![イメージ説明](3748ac58d4f9cde885d4c386f1bfc283.png)]
138
138
  ![イメージ説明](973b0587284045f6e1b2d79c1ab3506e.png)

2

追記&修正

2019/08/08 08:43

投稿

Y0241-N
Y0241-N

スコア1066

title CHANGED
File without changes
body CHANGED
@@ -20,7 +20,7 @@
20
20
  Properties
21
21
  {
22
22
  _Tint("Tint", Color) = (0.5, 0.5, 0.5, 1)
23
- _PointSize("Point Size", Float) = 0.05
23
+ _PointSize("Point Size", Float) = 0.03
24
24
  }
25
25
  SubShader
26
26
  {
@@ -130,4 +130,9 @@
130
130
  gl_PointSize = 0.03fとする → ビルド時に点群が表示されなくなる(以下非表示と記載)
131
131
  (1.0 / gl_Position.w)の1.0を3.0などに変えてみる → 大きさに変化なし
132
132
  float _PointSize = 0.03f;と値を渡してみる → 非表示
133
- gl_PointSize = _PointSize * 3(1.0 / gl_Position.w);括弧の前に数字をかけてみる → 非表示
133
+ gl_PointSize = _PointSize * 3(1.0 / gl_Position.w);括弧の前に数字をかけてみる → 非表示
134
+
135
+ ###追記
136
+ 修正依頼の通り、PointSizeを調べてみたところ、Unity上とWebGL上で同じ値が返ってきているにもかかわらず、点の大きさが明らかに異なっていることがわかりました。
137
+ ![![イメージ説明](3748ac58d4f9cde885d4c386f1bfc283.png)](1c9dfffd0242b9911e2cebe3c5c68b06.png)
138
+ ![イメージ説明](973b0587284045f6e1b2d79c1ab3506e.png)

1

追記

2019/08/08 08:42

投稿

Y0241-N
Y0241-N

スコア1066

title CHANGED
File without changes
body CHANGED
@@ -127,6 +127,7 @@
127
127
   gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
128
128
  gl_PointSize = _PointSize * (1.0 / gl_Position.w);
129
129
  ```
130
- gl_PointSize = 0.03fとする → ビルド時に点群が表示されなくなる
130
+ gl_PointSize = 0.03fとする → ビルド時に点群が表示されなくなる(以下非表示と記載)
131
131
  (1.0 / gl_Position.w)の1.0を3.0などに変えてみる → 大きさに変化なし
132
- float _PointSize = 0.03f;と値を渡してみる → ビルド時に点群が表示されなくなる
132
+ float _PointSize = 0.03f;と値を渡してみる → 表示
133
+ gl_PointSize = _PointSize * 3(1.0 / gl_Position.w);括弧の前に数字をかけてみる → 非表示