123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- Shader "Hidden/Lux URP/Lit (Add Pass)"
- {
- Properties
- {
- // Layer count is passed down to guide height-blend enable/disable, due
- // to the fact that heigh-based blend will be broken with multipass.
- [HideInInspector] [PerRendererData] _NumLayersCount ("Total Layer Count", Float) = 1.0
- // set by terrain engine
- [HideInInspector] _Control("Control (RGBA)", 2D) = "red" {}
- [HideInInspector] _Splat3("Layer 3 (A)", 2D) = "white" {}
- [HideInInspector] _Splat2("Layer 2 (B)", 2D) = "white" {}
- [HideInInspector] _Splat1("Layer 1 (G)", 2D) = "white" {}
- [HideInInspector] _Splat0("Layer 0 (R)", 2D) = "white" {}
- [HideInInspector] _Normal3("Normal 3 (A)", 2D) = "bump" {}
- [HideInInspector] _Normal2("Normal 2 (B)", 2D) = "bump" {}
- [HideInInspector] _Normal1("Normal 1 (G)", 2D) = "bump" {}
- [HideInInspector] _Normal0("Normal 0 (R)", 2D) = "bump" {}
- [HideInInspector][Gamma] _Metallic0("Metallic 0", Range(0.0, 1.0)) = 0.0
- [HideInInspector][Gamma] _Metallic1("Metallic 1", Range(0.0, 1.0)) = 0.0
- [HideInInspector][Gamma] _Metallic2("Metallic 2", Range(0.0, 1.0)) = 0.0
- [HideInInspector][Gamma] _Metallic3("Metallic 3", Range(0.0, 1.0)) = 0.0
- [HideInInspector] _Smoothness0("Smoothness 0", Range(0.0, 1.0)) = 1.0
- [HideInInspector] _Smoothness1("Smoothness 1", Range(0.0, 1.0)) = 1.0
- [HideInInspector] _Smoothness2("Smoothness 2", Range(0.0, 1.0)) = 1.0
- [HideInInspector] _Smoothness3("Smoothness 3", Range(0.0, 1.0)) = 1.0
- // used in fallback on old cards & base map
- [HideInInspector] _BaseMap("BaseMap (RGB)", 2D) = "white" {}
- [HideInInspector] _BaseColor("Main Color", Color) = (1,1,1,1)
- }
- // NOTE: Here we skip alpha testing (this is the add pass) and fully rely on Ztesting (ZTest Equal)
- HLSLINCLUDE
- //#pragma multi_compile_fragment __ _ALPHATEST_ON
- ENDHLSL
- SubShader
- {
- Tags { "Queue" = "Geometry-99" "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" "IgnoreProjector" = "True"}
- Pass
- {
- Name "TerrainAddLit"
- Tags { "LightMode" = "UniversalForward" }
- // This handles deph and clip holes!
- ZTest Equal
- Blend One One
- HLSLPROGRAM
- // Required to compile gles 2.0 with standard srp library
- #pragma prefer_hlslcc gles
- #pragma exclude_renderers d3d11_9x
- #pragma target 3.0
- #pragma vertex SplatmapVert
- #pragma fragment SplatmapFragment
- // -------------------------------------
- // Lightweight Pipeline keywords
- #pragma multi_compile _ _MAIN_LIGHT_SHADOWS
- #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
- #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
- #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
- #pragma multi_compile_fragment _ _SHADOWS_SOFT
- #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
- #pragma multi_compile _ SHADOWS_SHADOWMASK
- #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
- // -------------------------------------
- // Unity defined keywords
- #pragma multi_compile _ DIRLIGHTMAP_COMBINED
- #pragma multi_compile _ LIGHTMAP_ON
- #pragma multi_compile_fog
- #pragma multi_compile_instancing
- #pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap
- #pragma shader_feature_local _NORMALMAP
- // Sample normal in pixel shader when doing instancing
- #pragma shader_feature_local _TERRAIN_INSTANCED_PERPIXEL_NORMAL
- #define TERRAIN_SPLAT_ADDPASS
- #include "Includes/TerrainLitInput.hlsl"
- #include "Includes/TerrainLitPasses.hlsl"
- ENDHLSL
- }
- }
- Fallback "Hidden/InternalErrorShader"
- }
|