Created
April 14, 2015 16:06
-
-
Save shole/d7b9a0d2f29dbe9bfe05 to your computer and use it in GitHub Desktop.
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
// Shader created with Shader Forge Beta 0.23 | |
// Shader Forge (c) Joachim Holmer - http://www.acegikmo.com/shaderforge/ | |
// Note: Manually altering this data may prevent you from opening it in Shader Forge | |
/*SF_DATA;ver:0.23;sub:START;pass:START;ps:lgpr:1,nrmq:1,limd:0,blpr:3,bsrc:0,bdst:6,culm:2,dpts:2,wrdp:False,uamb:True,mssp:True,ufog:False,aust:True,igpj:True,qofs:0,lico:0,qpre:3,flbk:,rntp:2,lmpd:False,lprd:False,enco:False,frtr:True,vitr:True,dbil:False,rmgx:True,hqsc:False,hqlp:False,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,ofsf:0,ofsu:0;n:type:ShaderForge.SFN_Final,id:1,x:32719,y:32712|emission-636-OUT,disp-1907-OUT,tess-1649-OUT;n:type:ShaderForge.SFN_Tex2dAsset,id:19,x:34366,y:33219,ptlb:depthmap,tex:0a70c16c7b47ab048bc9e03b588c24f6;n:type:ShaderForge.SFN_Tex2d,id:20,x:33638,y:32490,tex:e976c6d3ebc1e4a85aa7186a3192d8c5,ntxv:0,isnm:False|TEX-903-TEX;n:type:ShaderForge.SFN_Tex2d,id:25,x:34184,y:33197,tex:0a70c16c7b47ab048bc9e03b588c24f6,ntxv:0,isnm:False|TEX-19-TEX;n:type:ShaderForge.SFN_Add,id:241,x:34023,y:33216|A-25-R,B-25-G,C-25-B;n:type:ShaderForge.SFN_Divide,id:345,x:33636,y:33197|A-1737-OUT,B-347-OUT;n:type:ShaderForge.SFN_Vector1,id:347,x:33791,y:33334,v1:3;n:type:ShaderForge.SFN_NormalVector,id:463,x:33228,y:33196,pt:False;n:type:ShaderForge.SFN_Multiply,id:464,x:33233,y:33072|A-760-OUT,B-463-OUT,C-864-OUT;n:type:ShaderForge.SFN_Color,id:635,x:33488,y:32279,ptlb:screencolor,c1:0,c2:1,c3:0,c4:1;n:type:ShaderForge.SFN_Multiply,id:636,x:33263,y:32686|A-635-RGB,B-1468-OUT,C-1194-RGB,D-1707-RGB;n:type:ShaderForge.SFN_Subtract,id:760,x:33430,y:33073|A-863-OUT,B-1695-OUT;n:type:ShaderForge.SFN_Divide,id:863,x:33606,y:33076|A-896-OUT,B-345-OUT;n:type:ShaderForge.SFN_ValueProperty,id:864,x:33225,y:33358,ptlb:displacescale,v1:0.1;n:type:ShaderForge.SFN_Vector1,id:896,x:33615,y:33021,v1:1;n:type:ShaderForge.SFN_Tex2dAsset,id:903,x:33802,y:32479,ptlb:texture,tex:e976c6d3ebc1e4a85aa7186a3192d8c5;n:type:ShaderForge.SFN_Tex2d,id:1194,x:33470,y:32858,ptlb:alpha,tex:3a5a96df060a5cf4a9cc0c59e13486b7,ntxv:0,isnm:False;n:type:ShaderForge.SFN_Tex2d,id:1426,x:33953,y:32627,ptlb:backgroundpattern,tex:15a3a5352b8384c739ccbb851e4cea46,ntxv:2,isnm:False;n:type:ShaderForge.SFN_Max,id:1468,x:33450,y:32627|A-20-RGB,B-1872-OUT;n:type:ShaderForge.SFN_ValueProperty,id:1649,x:32785,y:33182,ptlb:tesselationfactor,v1:10;n:type:ShaderForge.SFN_ValueProperty,id:1695,x:33431,y:33208,ptlb:heightoffset,v1:1.5;n:type:ShaderForge.SFN_Tex2d,id:1707,x:33920,y:32899,ptlb:noise,tex:2b531fc14599a3347982f039ffe60bd9,ntxv:0,isnm:False|UVIN-1715-UVOUT;n:type:ShaderForge.SFN_Time,id:1714,x:34503,y:32683;n:type:ShaderForge.SFN_Panner,id:1715,x:34091,y:32920,spu:1,spv:1|UVIN-1717-UVOUT,DIST-1714-T;n:type:ShaderForge.SFN_Rotator,id:1717,x:34303,y:32944|UVIN-1718-UVOUT,SPD-1714-TTR;n:type:ShaderForge.SFN_TexCoord,id:1718,x:34593,y:33052,uv:0;n:type:ShaderForge.SFN_Add,id:1737,x:33819,y:33199|A-241-OUT,B-1842-OUT;n:type:ShaderForge.SFN_Tex2d,id:1785,x:34219,y:33350,ptlb:noise_copy,tex:2b531fc14599a3347982f039ffe60bd9,ntxv:0,isnm:False|UVIN-1809-UVOUT;n:type:ShaderForge.SFN_Panner,id:1809,x:34479,y:33405,spu:1,spv:1|UVIN-1811-UVOUT,DIST-1813-T;n:type:ShaderForge.SFN_Rotator,id:1811,x:34691,y:33429|UVIN-1815-UVOUT,SPD-1813-TTR;n:type:ShaderForge.SFN_Time,id:1813,x:34891,y:33168;n:type:ShaderForge.SFN_TexCoord,id:1815,x:34981,y:33537,uv:0;n:type:ShaderForge.SFN_ValueProperty,id:1841,x:34044,y:33486,ptlb:noiseheight,v1:0.1;n:type:ShaderForge.SFN_Multiply,id:1842,x:34021,y:33344|A-1785-RGB,B-1841-OUT;n:type:ShaderForge.SFN_RemapRangeAdvanced,id:1872,x:33633,y:32648|IN-1426-RGB,IMIN-1873-OUT,IMAX-1874-OUT,OMIN-1873-OUT,OMAX-1875-OUT;n:type:ShaderForge.SFN_Vector1,id:1873,x:33813,y:32680,v1:0;n:type:ShaderForge.SFN_Vector1,id:1874,x:33813,y:32730,v1:1;n:type:ShaderForge.SFN_ValueProperty,id:1875,x:33820,y:32813,ptlb:backgroundpatternvalue,v1:0.05;n:type:ShaderForge.SFN_Fmod,id:1907,x:33039,y:33067|A-464-OUT,B-1926-OUT;n:type:ShaderForge.SFN_ValueProperty,id:1926,x:33042,y:33210,ptlb:depthmod,v1:0.2;proporder:19-635-864-903-1194-1426-1649-1695-1707-1785-1841-1875-1926;pass:END;sub:END;*/ | |
Shader "Shader Forge/holoradar" { | |
Properties { | |
_depthmap ("depthmap", 2D) = "white" {} | |
_screencolor ("screencolor", Color) = (0,1,0,1) | |
_displacescale ("displacescale", Float ) = 0.1 | |
_texture ("texture", 2D) = "white" {} | |
_alpha ("alpha", 2D) = "white" {} | |
_backgroundpattern ("backgroundpattern", 2D) = "black" {} | |
_tesselationfactor ("tesselationfactor", Float ) = 10 | |
_heightoffset ("heightoffset", Float ) = 1.5 | |
_noise ("noise", 2D) = "white" {} | |
_noisecopy ("noise_copy", 2D) = "white" {} | |
_noiseheight ("noiseheight", Float ) = 0.1 | |
_backgroundpatternvalue ("backgroundpatternvalue", Float ) = 0.05 | |
_depthmod ("depthmod", Float ) = 0.2 | |
} | |
SubShader { | |
Tags { | |
"IgnoreProjector"="True" | |
"Queue"="Transparent" | |
"RenderType"="Transparent" | |
} | |
Pass { | |
Name "ForwardBase" | |
Tags { | |
"LightMode"="ForwardBase" | |
} | |
Blend One OneMinusSrcColor | |
Cull Off | |
ZWrite Off | |
Fog {Mode Off} | |
CGPROGRAM | |
#pragma hull hull | |
#pragma domain domain | |
#pragma vertex tessvert | |
#pragma fragment frag | |
#define UNITY_PASS_FORWARDBASE | |
#include "UnityCG.cginc" | |
#pragma multi_compile_fwdbase | |
#pragma exclude_renderers xbox360 ps3 flash | |
#pragma target 5.0 | |
uniform float4 _TimeEditor; | |
uniform sampler2D _depthmap; uniform float4 _depthmap_ST; | |
uniform float4 _screencolor; | |
uniform float _displacescale; | |
uniform sampler2D _texture; uniform float4 _texture_ST; | |
uniform sampler2D _alpha; uniform float4 _alpha_ST; | |
uniform sampler2D _backgroundpattern; uniform float4 _backgroundpattern_ST; | |
uniform float _tesselationfactor; | |
uniform float _heightoffset; | |
uniform sampler2D _noise; uniform float4 _noise_ST; | |
uniform sampler2D _noisecopy; uniform float4 _noisecopy_ST; | |
uniform float _noiseheight; | |
uniform float _backgroundpatternvalue; | |
uniform float _depthmod; | |
struct VertexInput { | |
float4 vertex : POSITION; | |
float3 normal : NORMAL; | |
float4 tangent : TANGENT; | |
float4 uv0 : TEXCOORD0; | |
}; | |
struct VertexOutput { | |
float4 pos : SV_POSITION; | |
float4 uv0 : TEXCOORD0; | |
float4 posWorld : TEXCOORD1; | |
float3 normalDir : TEXCOORD2; | |
}; | |
VertexOutput vert (VertexInput v) { | |
VertexOutput o; | |
o.uv0 = v.uv0; | |
o.normalDir = mul(float4(v.normal,0), _World2Object).xyz; | |
o.posWorld = mul(_Object2World, v.vertex); | |
o.pos = mul(UNITY_MATRIX_MVP, v.vertex); | |
return o; | |
} | |
#ifdef UNITY_CAN_COMPILE_TESSELLATION | |
struct TessVertex { | |
float4 vertex : INTERNALTESSPOS; | |
float3 normal : NORMAL; | |
float4 tangent : TANGENT; | |
float4 uv0 : TEXCOORD0; | |
}; | |
struct OutputPatchConstant { | |
float edge[3] : SV_TessFactor; | |
float inside : SV_InsideTessFactor; | |
float3 vTangent[4] : TANGENT; | |
float2 vUV[4] : TEXCOORD; | |
float3 vTanUCorner[4] : TANUCORNER; | |
float3 vTanVCorner[4] : TANVCORNER; | |
float4 vCWts : TANWEIGHTS; | |
}; | |
TessVertex tessvert (VertexInput v) { | |
TessVertex o; | |
o.vertex = v.vertex; | |
o.normal = v.normal; | |
o.tangent = v.tangent; | |
o.uv0 = v.uv0; | |
return o; | |
} | |
void displacement (inout VertexInput v){ | |
float2 node_1986 = v.uv0; | |
float4 node_25 = tex2Dlod(_depthmap,float4(TRANSFORM_TEX(node_1986.rg, _depthmap),0.0,0)); | |
float4 node_1813 = _Time + _TimeEditor; | |
float4 node_1987 = _Time + _TimeEditor; | |
float node_1811_ang = node_1987.g; | |
float node_1811_spd = node_1813.a; | |
float node_1811_cos = cos(node_1811_spd*node_1811_ang); | |
float node_1811_sin = sin(node_1811_spd*node_1811_ang); | |
float2 node_1811_piv = float2(0.5,0.5); | |
float2 node_1811 = (mul(v.uv0.rg-node_1811_piv,float2x2( node_1811_cos, -node_1811_sin, node_1811_sin, node_1811_cos))+node_1811_piv); | |
float2 node_1809 = (node_1811+node_1813.g*float2(1,1)); | |
v.vertex.xyz += fmod((((1.0/(((node_25.r+node_25.g+node_25.b)+(tex2Dlod(_noisecopy,float4(TRANSFORM_TEX(node_1809, _noisecopy),0.0,0)).rgb*_noiseheight))/3.0))-_heightoffset)*v.normal*_displacescale),_depthmod); | |
} | |
float Tessellation(TessVertex v){ | |
return _tesselationfactor; | |
} | |
OutputPatchConstant hullconst (InputPatch<TessVertex,3> v) { | |
OutputPatchConstant o; | |
float ts = Tessellation( v[0] ); | |
o.edge[0] = ts; | |
o.edge[1] = ts; | |
o.edge[2] = ts; | |
o.inside = ts; | |
return o; | |
} | |
[domain("tri")] | |
[partitioning("fractional_odd")] | |
[outputtopology("triangle_cw")] | |
[patchconstantfunc("hullconst")] | |
[outputcontrolpoints(3)] | |
TessVertex hull (InputPatch<TessVertex,3> v, uint id : SV_OutputControlPointID) { | |
return v[id]; | |
} | |
[domain("tri")] | |
VertexOutput domain (OutputPatchConstant tessFactors, const OutputPatch<TessVertex,3> vi, float3 bary : SV_DomainLocation) { | |
VertexInput v; | |
v.vertex = vi[0].vertex*bary.x + vi[1].vertex*bary.y + vi[2].vertex*bary.z; | |
v.normal = vi[0].normal*bary.x + vi[1].normal*bary.y + vi[2].normal*bary.z; | |
v.tangent = vi[0].tangent*bary.x + vi[1].tangent*bary.y + vi[2].tangent*bary.z; | |
v.uv0 = vi[0].uv0*bary.x + vi[1].uv0*bary.y + vi[2].uv0*bary.z; | |
displacement(v); | |
VertexOutput o = vert(v); | |
return o; | |
} | |
#endif | |
fixed4 frag(VertexOutput i) : COLOR { | |
i.normalDir = normalize(i.normalDir); | |
float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz); | |
/////// Normals: | |
float3 normalDirection = i.normalDir; | |
float nSign = sign( dot( viewDirection, i.normalDir ) ); // Reverse normal if this is a backface | |
i.normalDir *= nSign; | |
normalDirection *= nSign; | |
////// Lighting: | |
////// Emissive: | |
float2 node_1986 = i.uv0; | |
float node_1873 = 0.0; | |
float4 node_1714 = _Time + _TimeEditor; | |
float4 node_1987 = _Time + _TimeEditor; | |
float node_1717_ang = node_1987.g; | |
float node_1717_spd = node_1714.a; | |
float node_1717_cos = cos(node_1717_spd*node_1717_ang); | |
float node_1717_sin = sin(node_1717_spd*node_1717_ang); | |
float2 node_1717_piv = float2(0.5,0.5); | |
float2 node_1717 = (mul(i.uv0.rg-node_1717_piv,float2x2( node_1717_cos, -node_1717_sin, node_1717_sin, node_1717_cos))+node_1717_piv); | |
float2 node_1715 = (node_1717+node_1714.g*float2(1,1)); | |
float3 emissive = (_screencolor.rgb*max(tex2D(_texture,TRANSFORM_TEX(node_1986.rg, _texture)).rgb,(node_1873 + ( (tex2D(_backgroundpattern,TRANSFORM_TEX(node_1986.rg, _backgroundpattern)).rgb - node_1873) * (_backgroundpatternvalue - node_1873) ) / (1.0 - node_1873)))*tex2D(_alpha,TRANSFORM_TEX(node_1986.rg, _alpha)).rgb*tex2D(_noise,TRANSFORM_TEX(node_1715, _noise)).rgb); | |
float3 finalColor = emissive; | |
/// Final Color: | |
return fixed4(finalColor,1); | |
} | |
ENDCG | |
} | |
Pass { | |
Name "ShadowCollector" | |
Tags { | |
"LightMode"="ShadowCollector" | |
} | |
Cull Off | |
Fog {Mode Off} | |
CGPROGRAM | |
#pragma hull hull | |
#pragma domain domain | |
#pragma vertex tessvert | |
#pragma fragment frag | |
#define UNITY_PASS_SHADOWCOLLECTOR | |
#define SHADOW_COLLECTOR_PASS | |
#include "UnityCG.cginc" | |
#include "Lighting.cginc" | |
#pragma fragmentoption ARB_precision_hint_fastest | |
#pragma multi_compile_shadowcollector | |
#pragma exclude_renderers xbox360 ps3 flash | |
#pragma target 5.0 | |
uniform float4 _TimeEditor; | |
uniform sampler2D _depthmap; uniform float4 _depthmap_ST; | |
uniform float _displacescale; | |
uniform float _tesselationfactor; | |
uniform float _heightoffset; | |
uniform sampler2D _noisecopy; uniform float4 _noisecopy_ST; | |
uniform float _noiseheight; | |
uniform float _depthmod; | |
struct VertexInput { | |
float4 vertex : POSITION; | |
float3 normal : NORMAL; | |
float4 tangent : TANGENT; | |
float4 uv0 : TEXCOORD0; | |
}; | |
struct VertexOutput { | |
V2F_SHADOW_COLLECTOR; | |
float4 uv0 : TEXCOORD5; | |
float3 normalDir : TEXCOORD6; | |
}; | |
VertexOutput vert (VertexInput v) { | |
VertexOutput o; | |
o.uv0 = v.uv0; | |
o.normalDir = mul(float4(v.normal,0), _World2Object).xyz; | |
o.pos = mul(UNITY_MATRIX_MVP, v.vertex); | |
TRANSFER_SHADOW_COLLECTOR(o) | |
return o; | |
} | |
#ifdef UNITY_CAN_COMPILE_TESSELLATION | |
struct TessVertex { | |
float4 vertex : INTERNALTESSPOS; | |
float3 normal : NORMAL; | |
float4 tangent : TANGENT; | |
float4 uv0 : TEXCOORD0; | |
}; | |
struct OutputPatchConstant { | |
float edge[3] : SV_TessFactor; | |
float inside : SV_InsideTessFactor; | |
float3 vTangent[4] : TANGENT; | |
float2 vUV[4] : TEXCOORD; | |
float3 vTanUCorner[4] : TANUCORNER; | |
float3 vTanVCorner[4] : TANVCORNER; | |
float4 vCWts : TANWEIGHTS; | |
}; | |
TessVertex tessvert (VertexInput v) { | |
TessVertex o; | |
o.vertex = v.vertex; | |
o.normal = v.normal; | |
o.tangent = v.tangent; | |
o.uv0 = v.uv0; | |
return o; | |
} | |
void displacement (inout VertexInput v){ | |
float2 node_1988 = v.uv0; | |
float4 node_25 = tex2Dlod(_depthmap,float4(TRANSFORM_TEX(node_1988.rg, _depthmap),0.0,0)); | |
float4 node_1813 = _Time + _TimeEditor; | |
float4 node_1989 = _Time + _TimeEditor; | |
float node_1811_ang = node_1989.g; | |
float node_1811_spd = node_1813.a; | |
float node_1811_cos = cos(node_1811_spd*node_1811_ang); | |
float node_1811_sin = sin(node_1811_spd*node_1811_ang); | |
float2 node_1811_piv = float2(0.5,0.5); | |
float2 node_1811 = (mul(v.uv0.rg-node_1811_piv,float2x2( node_1811_cos, -node_1811_sin, node_1811_sin, node_1811_cos))+node_1811_piv); | |
float2 node_1809 = (node_1811+node_1813.g*float2(1,1)); | |
v.vertex.xyz += fmod((((1.0/(((node_25.r+node_25.g+node_25.b)+(tex2Dlod(_noisecopy,float4(TRANSFORM_TEX(node_1809, _noisecopy),0.0,0)).rgb*_noiseheight))/3.0))-_heightoffset)*v.normal*_displacescale),_depthmod); | |
} | |
float Tessellation(TessVertex v){ | |
return _tesselationfactor; | |
} | |
OutputPatchConstant hullconst (InputPatch<TessVertex,3> v) { | |
OutputPatchConstant o; | |
float ts = Tessellation( v[0] ); | |
o.edge[0] = ts; | |
o.edge[1] = ts; | |
o.edge[2] = ts; | |
o.inside = ts; | |
return o; | |
} | |
[domain("tri")] | |
[partitioning("fractional_odd")] | |
[outputtopology("triangle_cw")] | |
[patchconstantfunc("hullconst")] | |
[outputcontrolpoints(3)] | |
TessVertex hull (InputPatch<TessVertex,3> v, uint id : SV_OutputControlPointID) { | |
return v[id]; | |
} | |
[domain("tri")] | |
VertexOutput domain (OutputPatchConstant tessFactors, const OutputPatch<TessVertex,3> vi, float3 bary : SV_DomainLocation) { | |
VertexInput v; | |
v.vertex = vi[0].vertex*bary.x + vi[1].vertex*bary.y + vi[2].vertex*bary.z; | |
v.normal = vi[0].normal*bary.x + vi[1].normal*bary.y + vi[2].normal*bary.z; | |
v.tangent = vi[0].tangent*bary.x + vi[1].tangent*bary.y + vi[2].tangent*bary.z; | |
v.uv0 = vi[0].uv0*bary.x + vi[1].uv0*bary.y + vi[2].uv0*bary.z; | |
displacement(v); | |
VertexOutput o = vert(v); | |
return o; | |
} | |
#endif | |
fixed4 frag(VertexOutput i) : COLOR { | |
i.normalDir = normalize(i.normalDir); | |
SHADOW_COLLECTOR_FRAGMENT(i) | |
} | |
ENDCG | |
} | |
Pass { | |
Name "ShadowCaster" | |
Tags { | |
"LightMode"="ShadowCaster" | |
} | |
Cull Off | |
Offset 1, 1 | |
Fog {Mode Off} | |
CGPROGRAM | |
#pragma hull hull | |
#pragma domain domain | |
#pragma vertex tessvert | |
#pragma fragment frag | |
#define UNITY_PASS_SHADOWCASTER | |
#include "UnityCG.cginc" | |
#include "Lighting.cginc" | |
#pragma fragmentoption ARB_precision_hint_fastest | |
#pragma multi_compile_shadowcaster | |
#pragma exclude_renderers xbox360 ps3 flash | |
#pragma target 5.0 | |
uniform float4 _TimeEditor; | |
uniform sampler2D _depthmap; uniform float4 _depthmap_ST; | |
uniform float _displacescale; | |
uniform float _tesselationfactor; | |
uniform float _heightoffset; | |
uniform sampler2D _noisecopy; uniform float4 _noisecopy_ST; | |
uniform float _noiseheight; | |
uniform float _depthmod; | |
struct VertexInput { | |
float4 vertex : POSITION; | |
float3 normal : NORMAL; | |
float4 tangent : TANGENT; | |
float4 uv0 : TEXCOORD0; | |
}; | |
struct VertexOutput { | |
V2F_SHADOW_CASTER; | |
float4 uv0 : TEXCOORD1; | |
float3 normalDir : TEXCOORD2; | |
}; | |
VertexOutput vert (VertexInput v) { | |
VertexOutput o; | |
o.uv0 = v.uv0; | |
o.normalDir = mul(float4(v.normal,0), _World2Object).xyz; | |
o.pos = mul(UNITY_MATRIX_MVP, v.vertex); | |
TRANSFER_SHADOW_CASTER(o) | |
return o; | |
} | |
#ifdef UNITY_CAN_COMPILE_TESSELLATION | |
struct TessVertex { | |
float4 vertex : INTERNALTESSPOS; | |
float3 normal : NORMAL; | |
float4 tangent : TANGENT; | |
float4 uv0 : TEXCOORD0; | |
}; | |
struct OutputPatchConstant { | |
float edge[3] : SV_TessFactor; | |
float inside : SV_InsideTessFactor; | |
float3 vTangent[4] : TANGENT; | |
float2 vUV[4] : TEXCOORD; | |
float3 vTanUCorner[4] : TANUCORNER; | |
float3 vTanVCorner[4] : TANVCORNER; | |
float4 vCWts : TANWEIGHTS; | |
}; | |
TessVertex tessvert (VertexInput v) { | |
TessVertex o; | |
o.vertex = v.vertex; | |
o.normal = v.normal; | |
o.tangent = v.tangent; | |
o.uv0 = v.uv0; | |
return o; | |
} | |
void displacement (inout VertexInput v){ | |
float2 node_1990 = v.uv0; | |
float4 node_25 = tex2Dlod(_depthmap,float4(TRANSFORM_TEX(node_1990.rg, _depthmap),0.0,0)); | |
float4 node_1813 = _Time + _TimeEditor; | |
float4 node_1991 = _Time + _TimeEditor; | |
float node_1811_ang = node_1991.g; | |
float node_1811_spd = node_1813.a; | |
float node_1811_cos = cos(node_1811_spd*node_1811_ang); | |
float node_1811_sin = sin(node_1811_spd*node_1811_ang); | |
float2 node_1811_piv = float2(0.5,0.5); | |
float2 node_1811 = (mul(v.uv0.rg-node_1811_piv,float2x2( node_1811_cos, -node_1811_sin, node_1811_sin, node_1811_cos))+node_1811_piv); | |
float2 node_1809 = (node_1811+node_1813.g*float2(1,1)); | |
v.vertex.xyz += fmod((((1.0/(((node_25.r+node_25.g+node_25.b)+(tex2Dlod(_noisecopy,float4(TRANSFORM_TEX(node_1809, _noisecopy),0.0,0)).rgb*_noiseheight))/3.0))-_heightoffset)*v.normal*_displacescale),_depthmod); | |
} | |
float Tessellation(TessVertex v){ | |
return _tesselationfactor; | |
} | |
OutputPatchConstant hullconst (InputPatch<TessVertex,3> v) { | |
OutputPatchConstant o; | |
float ts = Tessellation( v[0] ); | |
o.edge[0] = ts; | |
o.edge[1] = ts; | |
o.edge[2] = ts; | |
o.inside = ts; | |
return o; | |
} | |
[domain("tri")] | |
[partitioning("fractional_odd")] | |
[outputtopology("triangle_cw")] | |
[patchconstantfunc("hullconst")] | |
[outputcontrolpoints(3)] | |
TessVertex hull (InputPatch<TessVertex,3> v, uint id : SV_OutputControlPointID) { | |
return v[id]; | |
} | |
[domain("tri")] | |
VertexOutput domain (OutputPatchConstant tessFactors, const OutputPatch<TessVertex,3> vi, float3 bary : SV_DomainLocation) { | |
VertexInput v; | |
v.vertex = vi[0].vertex*bary.x + vi[1].vertex*bary.y + vi[2].vertex*bary.z; | |
v.normal = vi[0].normal*bary.x + vi[1].normal*bary.y + vi[2].normal*bary.z; | |
v.tangent = vi[0].tangent*bary.x + vi[1].tangent*bary.y + vi[2].tangent*bary.z; | |
v.uv0 = vi[0].uv0*bary.x + vi[1].uv0*bary.y + vi[2].uv0*bary.z; | |
displacement(v); | |
VertexOutput o = vert(v); | |
return o; | |
} | |
#endif | |
fixed4 frag(VertexOutput i) : COLOR { | |
i.normalDir = normalize(i.normalDir); | |
SHADOW_CASTER_FRAGMENT(i) | |
} | |
ENDCG | |
} | |
} | |
FallBack "Diffuse" | |
CustomEditor "ShaderForgeMaterialInspector" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment