- Back walls in the alleyway now extend beyond the ceiling. - Brick shader now shares tile/offset values between similar textures. - Brick textures now have a properly generated ambient occlusion map.
53 lines
1.5 KiB
Plaintext
53 lines
1.5 KiB
Plaintext
Shader "Carmen/Brick"
|
|
{
|
|
Properties
|
|
{
|
|
_MainTex ("Colour", 2D) = "white" {}
|
|
[NoScaleOffset] _NormalTex ("Normal", 2D) = "bump" {}
|
|
[NoScaleOffset] _AOTex ("Ambient Occlusion", 2D) = "white" {}
|
|
|
|
_DetailTex ("Detail Colour", 2D) = "gray" {}
|
|
_DetailNormal ("Detail Normal", 2D) = "bump" {}
|
|
_DetailIntensity ("Detail Intensity", Range(0.0, 1.0)) = 1.0
|
|
_DetailContrast ("Detail Contrast", Range(0.0, 1.0)) = 1.0
|
|
}
|
|
SubShader
|
|
{
|
|
Tags { "RenderType" = "Opaque" }
|
|
LOD 200
|
|
|
|
CGPROGRAM
|
|
#pragma surface surf Lambert
|
|
|
|
struct Input
|
|
{
|
|
float2 uv_MainTex;
|
|
float2 uv_DetailTex;
|
|
float2 uv_DetailNormal;
|
|
};
|
|
|
|
UNITY_DECLARE_TEX2D(_MainTex);
|
|
UNITY_DECLARE_TEX2D(_NormalTex);
|
|
UNITY_DECLARE_TEX2D(_AOTex);
|
|
UNITY_DECLARE_TEX2D(_DetailTex);
|
|
UNITY_DECLARE_TEX2D(_DetailNormal);
|
|
half _DetailIntensity;
|
|
half _DetailContrast;
|
|
|
|
void surf (Input IN, inout SurfaceOutput o)
|
|
{
|
|
o.Albedo = UNITY_SAMPLE_TEX2D(_MainTex, IN.uv_MainTex).rgb;
|
|
o.Albedo *= UNITY_SAMPLE_TEX2D(_AOTex, IN.uv_MainTex).r;
|
|
|
|
half3 detail_sample = UNITY_SAMPLE_TEX2D(_DetailTex, IN.uv_DetailTex);
|
|
detail_sample = saturate(detail_sample + (1.0 - _DetailContrast));
|
|
o.Albedo *= saturate((detail_sample * 2.0) * (_DetailIntensity * 2.0));
|
|
|
|
half3 normaltex = UnpackNormal(UNITY_SAMPLE_TEX2D(_NormalTex, IN.uv_MainTex));
|
|
half3 normaldetail = UnpackNormal(UNITY_SAMPLE_TEX2D(_DetailNormal, IN.uv_DetailNormal));
|
|
o.Normal = normalize(half3(normaltex.xy + normaldetail.xy, normaltex.z));
|
|
}
|
|
ENDCG
|
|
}
|
|
Fallback "VRChat/Mobile/Standard Lite"
|
|
} |