-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
269 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!21 &2100000 | ||
Material: | ||
serializedVersion: 6 | ||
m_ObjectHideFlags: 0 | ||
m_PrefabParentObject: {fileID: 0} | ||
m_PrefabInternal: {fileID: 0} | ||
m_Name: Displacement | ||
m_Shader: {fileID: 4800000, guid: 3f813ef63d6c1ef4ab60b3c391d9990d, type: 3} | ||
m_ShaderKeywords: | ||
m_LightmapFlags: 4 | ||
m_EnableInstancingVariants: 0 | ||
m_DoubleSidedGI: 0 | ||
m_CustomRenderQueue: -1 | ||
stringTagMap: {} | ||
disabledShaderPasses: [] | ||
m_SavedProperties: | ||
serializedVersion: 3 | ||
m_TexEnvs: | ||
- _BumpMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailAlbedoMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailMask: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailNormalMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DispTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _EmissionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MainTex: | ||
m_Texture: {fileID: 2800000, guid: d00dc0188602a864c8716d3c78d72645, type: 3} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MetallicGlossMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _OcclusionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _ParallaxMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _Splat: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
m_Floats: | ||
- _BumpScale: 1 | ||
- _Cutoff: 0.5 | ||
- _DetailNormalMapScale: 1 | ||
- _Displacement: -0.339 | ||
- _DstBlend: 0 | ||
- _GlossMapScale: 1 | ||
- _Glossiness: 0.5 | ||
- _GlossyReflections: 1 | ||
- _Metallic: 0 | ||
- _Mode: 0 | ||
- _OcclusionStrength: 1 | ||
- _Parallax: 0.02 | ||
- _SmoothnessTextureChannel: 0 | ||
- _SpecularHighlights: 1 | ||
- _SrcBlend: 1 | ||
- _Tess: 4 | ||
- _UVSec: 0 | ||
- _ZWrite: 1 | ||
m_Colors: | ||
- _Color: {r: 1, g: 1, b: 1, a: 1} | ||
- _Color2: {r: 0.39061943, g: 0.50041425, b: 0.6226415, a: 1} | ||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} | ||
- _SplatLocation: {r: 0, g: 0, b: 0, a: 0} | ||
- _SplatRemap: {r: 0, g: 0, b: 0, a: 0} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Shader "Custom/NewSurfaceShader" { | ||
Properties { | ||
_Color ("Color", Color) = (1,1,1,1) | ||
_MainTex ("Albedo (RGB)", 2D) = "white" {} | ||
_Glossiness ("Smoothness", Range(0,1)) = 0.5 | ||
_Metallic ("Metallic", Range(0,1)) = 0.0 | ||
} | ||
SubShader { | ||
Tags { "RenderType"="Opaque" } | ||
LOD 200 | ||
|
||
CGPROGRAM | ||
// Physically based Standard lighting model, and enable shadows on all light types | ||
#pragma surface surf Standard fullforwardshadows | ||
|
||
// Use shader model 3.0 target, to get nicer looking lighting | ||
#pragma target 3.0 | ||
|
||
sampler2D _MainTex; | ||
|
||
struct Input { | ||
float2 uv_MainTex; | ||
}; | ||
|
||
half _Glossiness; | ||
half _Metallic; | ||
fixed4 _Color; | ||
|
||
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. | ||
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. | ||
// #pragma instancing_options assumeuniformscaling | ||
UNITY_INSTANCING_BUFFER_START(Props) | ||
// put more per-instance properties here | ||
UNITY_INSTANCING_BUFFER_END(Props) | ||
|
||
void surf (Input IN, inout SurfaceOutputStandard o) { | ||
// Albedo comes from a texture tinted by color | ||
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; | ||
o.Albedo = c.rgb; | ||
// Metallic and smoothness come from slider variables | ||
o.Metallic = _Metallic; | ||
o.Smoothness = _Glossiness; | ||
o.Alpha = c.a; | ||
} | ||
ENDCG | ||
} | ||
FallBack "Diffuse" | ||
} |
9 changes: 9 additions & 0 deletions
9
Assets/Runningtap/Reveal/Shaders/NewSurfaceShader.shader.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
Assets/Runningtap/Reveal/Shaders/RevealDisplacement.shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' | ||
|
||
Shader "Runningtap/Reveal/Displacement" { | ||
Properties | ||
{ | ||
_Tess ("Tessellation", Range(1,32)) = 4 | ||
_Displacement ("Displacement", Range(-1.0, 1.0)) = 0.3 | ||
_MainTex ("Albedo (RGB)", 2D) = "white" {} | ||
_Color ("Color", Color) = (1,1,1,1) | ||
_Color2 ("Color2", Color) = (1,1,1,1) | ||
_Splat ("SplatMap", 2D) = "black" {} | ||
_SplatRemap ("SplatOffset", Vector) = (0,0,0,0) | ||
} | ||
|
||
SubShader | ||
{ | ||
Tags { "RenderType"="Opaque" } | ||
LOD 300 | ||
|
||
CGPROGRAM | ||
#pragma surface surf Standard fullforwardshadows vertex:disp tessellate:tessDistance | ||
#pragma target 4.6 | ||
#include "Tessellation.cginc" | ||
|
||
struct appdata | ||
{ | ||
float4 vertex : POSITION; | ||
float4 tangent : TANGENT; | ||
float3 normal : NORMAL; | ||
float2 texcoord : TEXCOORD0; | ||
float2 texcoord1 : TEXCOORD1; | ||
float2 texcoord2 : TEXCOORD2; | ||
}; | ||
|
||
struct Input | ||
{ | ||
float2 uv_MainTex; | ||
float3 worldPos; | ||
}; | ||
|
||
UNITY_INSTANCING_BUFFER_START(Props) | ||
UNITY_DEFINE_INSTANCED_PROP(sampler2D, _MainTex) | ||
UNITY_DEFINE_INSTANCED_PROP(sampler2D, _Splat) | ||
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color) | ||
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color2) | ||
UNITY_DEFINE_INSTANCED_PROP(float4, _SplatRemap) | ||
UNITY_DEFINE_INSTANCED_PROP(half, _Tess) | ||
UNITY_DEFINE_INSTANCED_PROP(half, _Displacement ) | ||
UNITY_INSTANCING_BUFFER_END(Props) | ||
|
||
void disp (inout appdata v) | ||
{ | ||
float2 WUV = (mul (unity_ObjectToWorld, v.vertex).xz - _SplatRemap.xy)/ _SplatRemap.zw; | ||
|
||
float d = tex2Dlod(_Splat, float4(WUV, 0, 0)).r * _Displacement; | ||
v.vertex.xyz += v.normal * d; | ||
} | ||
|
||
float4 tessDistance (appdata v0, appdata v1, appdata v2) | ||
{ | ||
float minDist = 10.0; | ||
float maxDist = 50.0; | ||
return UnityDistanceBasedTess(v0.vertex, v1.vertex, v2.vertex, minDist, maxDist, _Tess); | ||
} | ||
|
||
void surf (Input IN, inout SurfaceOutputStandard o) | ||
{ | ||
float2 WUV = (IN.worldPos.xz - _SplatRemap.xy)/ _SplatRemap.zw; | ||
|
||
half mask = tex2Dlod(_Splat, float4(WUV, 0, 0)).r; | ||
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; | ||
fixed4 c2 = tex2D(_MainTex, IN.uv_MainTex) * _Color2; | ||
|
||
float4 mix = lerp(c, c2, mask); | ||
//o.Alpha = saturate(mix); | ||
o.Albedo = mix.rgb; | ||
o.Alpha = c.a; | ||
} | ||
ENDCG | ||
} | ||
FallBack "Diffuse" | ||
} |
9 changes: 9 additions & 0 deletions
9
Assets/Runningtap/Reveal/Shaders/RevealDisplacement.shader.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"dependencies": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!1386491679 &1 | ||
PresetManager: | ||
m_ObjectHideFlags: 0 | ||
m_DefaultList: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
m_EditorVersion: 2017.3.0f3 | ||
m_EditorVersion: 2018.1.1f1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters