Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 730288a

Browse files
committed
shader attributes naming fix
1 parent 827af15 commit 730288a

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

Runtime/Resources/UIWidgets_canvas_shadowBox.shader

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ Shader "UIWidgets/ShadowBox"
2121
Pass {
2222
CGPROGRAM
2323

24-
float4 box;
24+
float4 _sb_box;
2525
float4 _viewport;
26-
float sigma;
27-
float4 color;
26+
float _sb_sigma;
27+
float4 _sb_color;
2828
float _mat[9];
2929

3030
struct appdata
@@ -57,8 +57,8 @@ Shader "UIWidgets/ShadowBox"
5757

5858
v2f vert(appdata v){
5959
v2f o;
60-
float padding = 3.0 * sigma;
61-
o.coord = lerp(box.xy - padding, box.zw + padding, v.vertex.xy);
60+
float padding = 3.0 * _sb_sigma;
61+
o.coord = lerp(_sb_box.xy - padding, _sb_box.zw + padding, v.vertex.xy);
6262
float3x3 mat = float3x3(_mat[0], _mat[1], _mat[2], _mat[3], _mat[4], _mat[5], 0, 0, 1);
6363
float2 p = mul(mat, float3(o.coord.xy, 1.0)).xy - _viewport.xy;
6464

@@ -71,8 +71,8 @@ Shader "UIWidgets/ShadowBox"
7171
}
7272

7373
float4 frag(v2f i) : SV_TARGET {
74-
float4 fragColor = color;
75-
fragColor.a = fragColor.a * boxShadow(box.xy, box.zw, i.coord, sigma);
74+
float4 fragColor = _sb_color;
75+
fragColor.a = fragColor.a * boxShadow(_sb_box.xy, _sb_box.zw, i.coord, _sb_sigma);
7676
return fragColor;
7777
}
7878

Runtime/Resources/UIWidgets_canvas_shadowRBox.shader

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Shader "UIWidgets/ShadowRBox"
2121
Pass {
2222
CGPROGRAM
2323

24-
float4 box;
24+
float4 _sb_box;
2525
float4 _viewport;
26-
float sigma;
27-
float4 color;
28-
float corner;
26+
float _sb_sigma;
27+
float4 _sb_color;
28+
float _sb_corner;
2929
float _mat[9];
3030

3131
struct appdata
@@ -89,8 +89,8 @@ Shader "UIWidgets/ShadowRBox"
8989

9090
v2f vert(appdata v){
9191
v2f o;
92-
float padding = 3.0 * sigma;
93-
o.coord = lerp(box.xy - padding, box.zw + padding, v.vertex.xy);
92+
float padding = 3.0 * _sb_sigma;
93+
o.coord = lerp(_sb_box.xy - padding, _sb_box.zw + padding, v.vertex.xy);
9494
float3x3 mat = float3x3(_mat[0], _mat[1], _mat[2], _mat[3], _mat[4], _mat[5], 0, 0, 1);
9595
float2 p = mul(mat, float3(o.coord.xy, 1.0)).xy - _viewport.xy;
9696

@@ -103,8 +103,8 @@ Shader "UIWidgets/ShadowRBox"
103103
}
104104

105105
float4 frag(v2f i) : SV_TARGET {
106-
float4 fragColor = color;
107-
fragColor.a = fragColor.a * roundedBoxShadow(box.xy, box.zw, i.coord, sigma, corner);
106+
float4 fragColor = _sb_color;
107+
fragColor.a = fragColor.a * roundedBoxShadow(_sb_box.xy, _sb_box.zw, i.coord, _sb_sigma, _sb_corner);
108108
return fragColor;
109109
}
110110

Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_shader.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ static CanvasShader() {
207207
static readonly int _mfKernelId = Shader.PropertyToID("_mf_kernel");
208208

209209

210-
static readonly int _shadowBoxId = Shader.PropertyToID("box");
211-
static readonly int _shadowSigmaId = Shader.PropertyToID("sigma");
212-
static readonly int _shadowColorId = Shader.PropertyToID("color");
213-
static readonly int _shadowCornerId = Shader.PropertyToID("corner");
210+
static readonly int _shadowBoxId = Shader.PropertyToID("_sb_box");
211+
static readonly int _shadowSigmaId = Shader.PropertyToID("_sb_sigma");
212+
static readonly int _shadowColorId = Shader.PropertyToID("_sb_color");
213+
static readonly int _shadowCornerId = Shader.PropertyToID("_sb_corner");
214214

215215
static Vector4 _colorToVector4(uiColor c) {
216216
return new Vector4(

0 commit comments

Comments
 (0)