- Added magazine model and textures.
- 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.
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Colour", 2D) = "white" {}
|
||||
_NormalTex ("Normal", 2D) = "bump" {}
|
||||
_AOTex ("Ambient Occlusion", 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
|
||||
{
|
||||
@@ -18,10 +19,9 @@
|
||||
CGPROGRAM
|
||||
#pragma surface surf Lambert
|
||||
|
||||
struct Input {
|
||||
struct Input
|
||||
{
|
||||
float2 uv_MainTex;
|
||||
float2 uv_NormalTex;
|
||||
float2 uv_AOTex;
|
||||
float2 uv_DetailTex;
|
||||
float2 uv_DetailNormal;
|
||||
};
|
||||
@@ -32,13 +32,18 @@
|
||||
UNITY_DECLARE_TEX2D(_DetailTex);
|
||||
UNITY_DECLARE_TEX2D(_DetailNormal);
|
||||
half _DetailIntensity;
|
||||
half _DetailContrast;
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
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;
|
||||
o.Albedo *= saturate((UNITY_SAMPLE_TEX2D(_DetailTex, IN.uv_DetailTex).rgb * 2.0) * _DetailIntensity);
|
||||
|
||||
half3 normaltex = UnpackNormal(UNITY_SAMPLE_TEX2D(_NormalTex, IN.uv_NormalTex));
|
||||
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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user