183 lines
7.2 KiB
Plaintext
183 lines
7.2 KiB
Plaintext
|
// Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
|
||
|
Shader "Hidden/TerrainEngine/Details/UniversalPipeline/WavingDoublePass"
|
||
|
{
|
||
|
Properties
|
||
|
{
|
||
|
_WavingTint ("Fade Color", Color) = (.7,.6,.5, 0)
|
||
|
_MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
|
||
|
_WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1)
|
||
|
_Cutoff ("Cutoff", float) = 0.5
|
||
|
}
|
||
|
SubShader
|
||
|
{
|
||
|
Tags {"Queue" = "Geometry+200" "RenderType" = "Grass" "IgnoreProjector" = "True" "RenderPipeline" = "UniversalPipeline" "UniversalMaterialType" = "SimpleLit" }//"DisableBatching"="True"
|
||
|
Cull Off
|
||
|
LOD 200
|
||
|
|
||
|
Pass
|
||
|
{
|
||
|
Name "ForwardLit"
|
||
|
Tags
|
||
|
{
|
||
|
"LightMode" = "UniversalForward"
|
||
|
}
|
||
|
AlphaToMask On
|
||
|
|
||
|
HLSLPROGRAM
|
||
|
#pragma target 2.0
|
||
|
|
||
|
// -------------------------------------
|
||
|
// Universal Pipeline keywords
|
||
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
||
|
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
||
|
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
||
|
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
||
|
#pragma multi_compile _ _LIGHT_LAYERS
|
||
|
#pragma multi_compile _ _FORWARD_PLUS
|
||
|
#pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
|
||
|
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
||
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
||
|
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
|
||
|
#pragma multi_compile_fragment _ _LIGHT_COOKIES
|
||
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
||
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
|
||
|
|
||
|
// -------------------------------------
|
||
|
// Unity defined keywords
|
||
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
||
|
#pragma multi_compile _ LIGHTMAP_ON
|
||
|
#pragma multi_compile_fog
|
||
|
#pragma multi_compile_fragment _ DEBUG_DISPLAY
|
||
|
|
||
|
//--------------------------------------
|
||
|
// GPU Instancing
|
||
|
#pragma multi_compile_instancing
|
||
|
#pragma instancing_options renderinglayer
|
||
|
|
||
|
#pragma vertex WavingGrassVert
|
||
|
#pragma fragment LitPassFragmentGrass
|
||
|
#define _ALPHATEST_ON
|
||
|
|
||
|
#include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassInput.hlsl"
|
||
|
#include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl"
|
||
|
|
||
|
ENDHLSL
|
||
|
}
|
||
|
|
||
|
Pass
|
||
|
{
|
||
|
Name "GBuffer"
|
||
|
Tags
|
||
|
{
|
||
|
"LightMode" = "UniversalGBuffer"
|
||
|
}
|
||
|
|
||
|
HLSLPROGRAM
|
||
|
#pragma target 4.5
|
||
|
|
||
|
// Deferred Rendering Path does not support the OpenGL-based graphics API:
|
||
|
// Desktop OpenGL, OpenGL ES 3.0, WebGL 2.0.
|
||
|
#pragma exclude_renderers gles3 glcore
|
||
|
|
||
|
// -------------------------------------
|
||
|
// Universal Pipeline keywords
|
||
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
||
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
||
|
#pragma multi_compile_fragment _ _LIGHT_COOKIES
|
||
|
#pragma multi_compile_fragment _ _RENDER_PASS_ENABLED
|
||
|
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
|
||
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
||
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
|
||
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
|
||
|
|
||
|
// -------------------------------------
|
||
|
// Unity defined keywords
|
||
|
#pragma multi_compile _ LIGHTMAP_ON
|
||
|
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
||
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
||
|
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
||
|
|
||
|
//--------------------------------------
|
||
|
// GPU Instancing
|
||
|
#pragma multi_compile_instancing
|
||
|
#pragma instancing_options renderinglayer
|
||
|
|
||
|
#pragma vertex WavingGrassVert
|
||
|
#pragma fragment LitPassFragmentGrass
|
||
|
#define _ALPHATEST_ON
|
||
|
#define TERRAIN_GBUFFER
|
||
|
|
||
|
#include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassInput.hlsl"
|
||
|
#include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl"
|
||
|
|
||
|
ENDHLSL
|
||
|
}
|
||
|
|
||
|
Pass
|
||
|
{
|
||
|
Name "DepthOnly"
|
||
|
Tags{"LightMode" = "DepthOnly"}
|
||
|
|
||
|
ZWrite On
|
||
|
ColorMask R
|
||
|
Cull Off
|
||
|
|
||
|
HLSLPROGRAM
|
||
|
#pragma target 2.0
|
||
|
|
||
|
#pragma vertex DepthOnlyVertex
|
||
|
#pragma fragment DepthOnlyFragment
|
||
|
|
||
|
// -------------------------------------
|
||
|
// Material Keywords
|
||
|
#define _ALPHATEST_ON
|
||
|
#pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
|
||
|
|
||
|
//--------------------------------------
|
||
|
// GPU Instancing
|
||
|
#pragma multi_compile_instancing
|
||
|
|
||
|
#include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassInput.hlsl"
|
||
|
#include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassPasses.hlsl"
|
||
|
ENDHLSL
|
||
|
}
|
||
|
|
||
|
// This pass is used when drawing to a _CameraNormalsTexture texture with the forward renderer or the depthNormal prepass with the deferred renderer.
|
||
|
Pass
|
||
|
{
|
||
|
Name "DepthNormalsOnly"
|
||
|
Tags{"LightMode" = "DepthNormalsOnly"}
|
||
|
|
||
|
ZWrite On
|
||
|
Cull Off
|
||
|
|
||
|
HLSLPROGRAM
|
||
|
#pragma target 2.0
|
||
|
|
||
|
#pragma vertex DepthNormalOnlyVertex
|
||
|
#pragma fragment DepthNormalOnlyFragment
|
||
|
|
||
|
// -------------------------------------
|
||
|
// Universal Pipeline keywords
|
||
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
|
||
|
|
||
|
// -------------------------------------
|
||
|
// Material Keywords
|
||
|
#define _ALPHATEST_ON
|
||
|
#pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
|
||
|
|
||
|
// -------------------------------------
|
||
|
// Unity defined keywords
|
||
|
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT // forward-only variant
|
||
|
|
||
|
//--------------------------------------
|
||
|
// GPU Instancing
|
||
|
#pragma multi_compile_instancing
|
||
|
|
||
|
#include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassInput.hlsl"
|
||
|
#include "Packages/com.unity.render-pipelines.universal/Shaders/Terrain/WavingGrassDepthNormalsPass.hlsl"
|
||
|
ENDHLSL
|
||
|
}
|
||
|
}
|
||
|
}
|