Skip to content

Commit f517b6c

Browse files
committed
Fix indentation
1 parent 5893fb9 commit f517b6c

File tree

1 file changed

+41
-38
lines changed

1 file changed

+41
-38
lines changed

sdkproject/Assets/Mapbox/Shaders/MapboxStyles.shader

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,72 @@
1-
Shader "Mapbox/MapboxStyles" {
2-
Properties
3-
{
4-
_BaseColor ("BaseColor", Color) = (1,1,1,1)
5-
_DetailColor1 ("DetailColor1", Color) = (1,1,1,1)
6-
_DetailColor2 ("DetailColor2", Color) = (1,1,1,1)
1+
// Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax.
2+
3+
Shader "Mapbox/MapboxStyles"
4+
{
5+
Properties
6+
{
7+
_BaseColor ("BaseColor", Color) = (1,1,1,1)
8+
_DetailColor1 ("DetailColor1", Color) = (1,1,1,1)
9+
_DetailColor2 ("DetailColor2", Color) = (1,1,1,1)
710

811
_BaseTex ("Base", 2D) = "white" {}
9-
_DetailTex1 ("Detail_1", 2D) = "white" {}
10-
_DetailTex2 ("Detail_2", 2D) = "white" {}
12+
_DetailTex1 ("Detail_1", 2D) = "white" {}
13+
_DetailTex2 ("Detail_2", 2D) = "white" {}
1114

12-
_Emission ("Emission", Range(0.0, 1.0)) = 0.1
15+
_Emission ("Emission", Range(0.0, 1.0)) = 0.1
1316
}
14-
SubShader
15-
{
17+
SubShader
18+
{
1619
Tags { "RenderType"="Opaque" }
1720
LOD 200
18-
21+
1922
CGPROGRAM
2023
// Physically based Standard lighting model, and enable shadows on all light types
2124
#pragma surface surf Standard fullforwardshadows
2225

2326
// Use shader model 3.0 target, to get nicer looking lighting
2427
#pragma target 3.0
2528

26-
float4 _BaseColor;
27-
float4 _DetailColor1;
28-
float4 _DetailColor2;
29+
float4 _BaseColor;
30+
float4 _DetailColor1;
31+
float4 _DetailColor2;
2932

3033
sampler2D _BaseTex;
31-
sampler2D _DetailTex1;
32-
sampler2D _DetailTex2;
34+
sampler2D _DetailTex1;
35+
sampler2D _DetailTex2;
3336

34-
float _Emission;
37+
float _Emission;
3538

36-
struct Input
37-
{
39+
struct Input
40+
{
3841
float2 uv_BaseTex, uv_DetailTex1, uv_DetailTex2;
3942
};
40-
41-
43+
44+
4245

4346
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
4447
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
4548
// #pragma instancing_options assumeuniformscaling
46-
UNITY_INSTANCING_CBUFFER_START(Props)
49+
UNITY_INSTANCING_BUFFER_START(Props)
4750
// put more per-instance properties here
48-
UNITY_INSTANCING_CBUFFER_END
51+
UNITY_INSTANCING_BUFFER_END(Props)
52+
53+
void surf (Input IN, inout SurfaceOutputStandard o)
54+
{
55+
fixed4 baseTexture = tex2D (_BaseTex, IN.uv_BaseTex);
56+
57+
fixed4 detailTexture1 = tex2D (_DetailTex1, IN.uv_DetailTex1);
58+
fixed4 detailTexture2 = tex2D (_DetailTex2, IN.uv_DetailTex2);
4959

50-
void surf (Input IN, inout SurfaceOutputStandard o)
51-
{
52-
fixed4 baseTexture = tex2D (_BaseTex, IN.uv_BaseTex);
53-
54-
fixed4 detailTexture1 = tex2D (_DetailTex1, IN.uv_DetailTex1);
55-
fixed4 detailTexture2 = tex2D (_DetailTex2, IN.uv_DetailTex2);
60+
fixed4 baseDetail1_Result = lerp(_BaseColor, _DetailColor1, detailTexture1.a);
5661

57-
fixed4 baseDetail1_Result = lerp(_BaseColor, _DetailColor1, detailTexture1.a);
62+
fixed4 detail1Detail2_Result = lerp(baseDetail1_Result, _DetailColor2, detailTexture2.a);
5863

59-
fixed4 detail1Detail2_Result = lerp(baseDetail1_Result, _DetailColor2, detailTexture2.a);
64+
fixed4 c = baseTexture *= detail1Detail2_Result;
65+
half3 e = c.rgb;
6066

61-
fixed4 c = baseTexture *= detail1Detail2_Result;
62-
half3 e = c.rgb;
63-
64-
o.Albedo = c.rgb;
65-
o.Emission = e * _Emission;
66-
o.Alpha = 1.0;
67+
o.Albedo = c.rgb;
68+
o.Emission = e * _Emission;
69+
o.Alpha = 1.0;
6770
}
6871
ENDCG
6972
}

0 commit comments

Comments
 (0)