回答編集履歴

2

実演映像見出しのUse Rectangular Depthオン・オフが逆だったのを修正

2022/03/24 00:25

投稿

Bongo
Bongo

スコア10807

test CHANGED
@@ -151,11 +151,11 @@
151
151
 
152
152
  ![図2](https://ddjkaamml8q8x.cloudfront.net/questions/2022-03-24/c0231832-965c-4315-ab65-8a1dc62ab42c.png)
153
153
 
154
- **Use Rectangular Depth オ**
154
+ **Use Rectangular Depth オ**
155
155
 
156
156
  ![図3](https://ddjkaamml8q8x.cloudfront.net/questions/2022-03-24/e34562b5-2e57-426e-9de2-fd2d7c6c191f.gif)
157
157
 
158
- **Use Rectangular Depth オ**
158
+ **Use Rectangular Depth オ**
159
159
 
160
160
  ![図4](https://ddjkaamml8q8x.cloudfront.net/questions/2022-03-24/e0d9dc69-5fe8-4138-9973-e84b5ece9ba1.gif)
161
161
 

1

キーワードの名称を修正

2022/03/23 22:10

投稿

Bongo
Bongo

スコア10807

test CHANGED
@@ -11,7 +11,7 @@
11
11
  [NoScaleOffset] _BackTex ("Back Texture", 2D) = "white" { }
12
12
  _ShadowIntensity ("Shadow Intensity", Range(0.0, 1.0)) = 0.5
13
13
  [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
14
- [Toggle(_RECT_DEPTH)] _UseRectDepth ("Use Rectangular Depth", Float) = 0
14
+ [Toggle(RECT_DEPTH)] _UseRectDepth ("Use Rectangular Depth", Float) = 0
15
15
  }
16
16
 
17
17
  // v2f、vertなどの共通化できる部分をCGINCLUDE内にまとめました
@@ -54,7 +54,7 @@
54
54
  #pragma target 3.0
55
55
  #pragma vertex vertShadow
56
56
  #pragma fragment fragShadow
57
- #pragma multi_compile _ _RECT_DEPTH
57
+ #pragma multi_compile _ RECT_DEPTH
58
58
  #include "UnityStandardShadow.cginc"
59
59
  struct VertexOutput
60
60
  {
@@ -69,7 +69,7 @@
69
69
  half4 fragShadow(VertexOutput i, UNITY_VPOS_TYPE vpos: VPOS, float facing : VFACE): SV_Target
70
70
  {
71
71
  // 自身の落とす影を四角にするかどうかをトグルで切り替えるようにしました
72
- #ifndef _RECT_DEPTH
72
+ #ifndef RECT_DEPTH
73
73
  // facingに応じて前面・背面のアルファを切り替えるようにしました
74
74
  half alpha = lerp(tex2D(_BackTex, i.tex).a * _BackColor.a, tex2D(_MainTex, i.tex).a * _Color.a, facing * 0.5 + 0.5);
75
75
  alpha = tex3D(_DitherMaskLOD, float3(vpos.xy * 0.25, alpha * 0.9375)).a;