2021-03-31 13:01:43 +02:00
|
|
|
Shader "Hidden/RS/TriPlanarLit"
|
2021-03-31 01:20:21 +02:00
|
|
|
{
|
|
|
|
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
|
|
|
|
|
2021-03-31 13:01:43 +02:00
|
|
|
#include "RSPropertiesCG.cginc"
|
|
|
|
#include "RSUtilsCG.cginc"
|
2021-03-31 01:20:21 +02:00
|
|
|
|
|
|
|
struct Input
|
|
|
|
{
|
2021-03-31 13:01:43 +02:00
|
|
|
float3 worldPos;
|
|
|
|
float3 worldNormal;
|
2021-03-31 01:20:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
void surf (Input IN, inout SurfaceOutputStandard o)
|
|
|
|
{
|
2021-04-20 03:52:32 +02:00
|
|
|
fixed4 c = RS_TriPlanar(_RS_Texture, _RS_Texture_ST, IN.worldPos, IN.worldNormal, _RS_Sharpness);
|
2021-03-31 13:01:43 +02:00
|
|
|
|
|
|
|
o.Albedo = c * _RS_Color;
|
2021-03-31 01:20:21 +02:00
|
|
|
o.Metallic = _RS_Metallic;
|
|
|
|
o.Smoothness = _RS_Glossiness;
|
|
|
|
}
|
|
|
|
ENDCG
|
|
|
|
}
|
|
|
|
FallBack "Diffuse"
|
2021-03-31 13:01:43 +02:00
|
|
|
}
|