// Made with Amplify Shader Editor v1.9.1.2 // Available at the Unity Asset Store - http://u3d.as/y3X // Force reimport: 2 Shader "AtlasShaders/LitMAS Water 2.5_Quest" { Properties { [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5 [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1) [ASEBegin][Header(Textures)][NoScaleOffset][Normal]_BumpMap("Normal", 2D) = "bump" {} [Header((Non MV ONLY))]_NormalIntensity("Normal Intensity", Range( 0 , 10)) = 0.6 [Header((Non MV ONLY 0.1 Through 1 Recommended))]_NormalTiling("Normal Tiling", Vector) = (0.2,0.2,0,0) [Header(Water Attributes)]_WaterSmoothness("Water Smoothness", Range( 0 , 1)) = 0.8 [HDR]_WaterColor("Water Color", Color) = (0.1333333,0.1333333,0.1333333,1) _WaterSpeedA("Water Speed A", Range( -0.1 , 0.1)) = 0.01 _WaterSpeedB("Water Speed B", Range( -0.1 , 0.1)) = 0.01 [Space(20)][Header(BRDF Lut)][Space(10)][Toggle(_BRDFMAP)] BRDFMAP("Enable BRDF map", Float) = 0 [ASEEnd][NoScaleOffset][SingleLineTexture]g_tBRDFMap("BRDF map", 2D) = "white" {} [Space(30)][Header(Screen Space Reflections)][Space(10)][Toggle(_NO_SSR)] _SSROff("Disable SSR", Float) = 0 [Header(This should be 0 for skinned meshes)] _SSRTemporalMul("Temporal Accumulation Factor", Range(0, 2)) = 1.0 //[Toggle(_SM6_QUAD)] _SM6_Quad("Quad-avg SSR", Float) = 0 } SubShader { LOD 0 Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" } Blend One OneMinusSrcAlpha ZWrite Off Cull Off ZTest LEqual Offset 0 , 0 ColorMask RGBA //LOD 100 Pass { Name "Forward" Tags { "Lightmode"="UniversalForward" } HLSLPROGRAM #pragma multi_compile_fog #define LITMAS_FEATURE_LIGHTMAPPING #pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED #define LITMAS_FEATURE_EMISSION #define PC_REFLECTION_PROBE_BLENDING #define PC_REFLECTION_PROBE_BOX_PROJECTION #define PC_SSAO #define MOBILE_LIGHTS_VERTEX #pragma multi_compile_instancing #define PC_RECEIVE_SHADOWS #define _ISTRANSPARENT #define _SurfaceTransparent #define ASE_SRP_VERSION -1 #pragma vertex vert #pragma fragment frag #pragma target 5.0 #define LITMAS_FEATURE_TS_NORMALS #define LITMAS_FEATURE_SSR #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PlatformCompiler.hlsl" #if defined(SHADER_API_DESKTOP) #endif //StandardForward------------------------------------------------------------------------------------------------------------------------------------------------------------------ //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // // //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- #define SHADERPASS SHADERPASS_FORWARD #define _NORMAL_DROPOFF_TS 1 #define _EMISSION #define _NORMALMAP 1 #if defined(SHADER_API_MOBILE) #if defined(MOBILE_LIGHTS_VERTEX) #define _ADDITIONAL_LIGHTS_VERTEX #endif #if defined(MOBILE_RECEIVE_SHADOWS) #undef _RECEIVE_SHADOWS_OFF #define _MAIN_LIGHT_SHADOWS #define _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _MAIN_LIGHT_SHADOWS_CASCADE #pragma multi_compile_fragment _ _ADDITIONAL_LIGHTS #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS #define _SHADOWS_SOFT 1 #else #define _RECEIVE_SHADOWS_OFF 1 #endif #if defined(MOBILE_SSAO) #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION #endif #if defined(MOBILE_REFLECTION_PROBE_BLENDING) #define _REFLECTION_PROBE_BLENDING #endif #if defined(MOBILE_REFLECTION_PROBE_BOX_PROJECTION) #define _REFLECTION_PROBE_BOX_PROJECTION #endif #else //#define DYNAMIC_SCREEN_SPACE_OCCLUSION #if defined(PC_SSAO) #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION #endif //#define DYNAMIC_ADDITIONAL_LIGHTS #if defined(PC_RECEIVE_SHADOWS) #undef _RECEIVE_SHADOWS_OFF #pragma multi_compile_fragment _ _MAIN_LIGHT_SHADOWS_CASCADE #pragma multi_compile_fragment _ _ADDITIONAL_LIGHTS //#define DYNAMIC_ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS #define _SHADOWS_SOFT 1 #else #define _RECEIVE_SHADOWS_OFF 1 #endif #if defined(PC_REFLECTION_PROBE_BLENDING) #define _REFLECTION_PROBE_BLENDING #endif //#pragma shader_feature_fragment _REFLECTION_PROBE_BOX_PROJECTION // We don't need a keyword for this! the w component of the probe position already branches box vs non-box, & so little cost on pc it doesn't matter #if defined(PC_REFLECTION_PROBE_BOX_PROJECTION) #define _REFLECTION_PROBE_BOX_PROJECTION #endif // Begin Injection STANDALONE_DEFINES from Injection_SSR.hlsl ---------------------------------------------------------- #pragma multi_compile _ _SLZ_SSR_ENABLED #pragma shader_feature_local _ _NO_SSR #if defined(_SLZ_SSR_ENABLED) && !defined(_NO_SSR) && !defined(SHADER_API_MOBILE) #define _SSR_ENABLED #endif // End Injection STANDALONE_DEFINES from Injection_SSR.hlsl ---------------------------------------------------------- #endif #pragma multi_compile_fragment _ _LIGHT_COOKIES #pragma multi_compile _ SHADOWS_SHADOWMASK //#pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED //#pragma multi_compile_fog //#pragma skip_variants FOG_LINEAR FOG_EXP //#pragma multi_compile_fragment _ DEBUG_DISPLAY //#pragma multi_compile_fragment _ _DETAILS_ON //#pragma multi_compile_fragment _ _EMISSION_ON #if defined(LITMAS_FEATURE_LIGHTMAPPING) #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING #endif #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl" #undef UNITY_DECLARE_DEPTH_TEXTURE_INCLUDED #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZLighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZBlueNoise.hlsl" // Begin Injection INCLUDES from Injection_SSR.hlsl ---------------------------------------------------------- #if !defined(SHADER_API_MOBILE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SLZLightingSSR.hlsl" #endif // End Injection INCLUDES from Injection_SSR.hlsl ---------------------------------------------------------- #pragma shader_feature_local_fragment _BRDFMAP struct VertIn { float4 vertex : POSITION; float3 normal : NORMAL; float4 tangent : TANGENT; float4 uv0 : TEXCOORD0; float4 uv1 : TEXCOORD1; float4 uv2 : TEXCOORD2; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct VertOut { float4 vertex : SV_POSITION; float4 uv0XY_bitZ_fog : TEXCOORD0; #if defined(LIGHTMAP_ON) || defined(DYNAMICLIGHTMAP_ON) float4 uv1 : TEXCOORD1; #endif half4 SHVertLights : TEXCOORD2; half4 normXYZ_tanX : TEXCOORD3; float3 wPos : TEXCOORD4; // Begin Injection INTERPOLATORS from Injection_SSR.hlsl ---------------------------------------------------------- float4 lastVertex : TEXCOORD5; // End Injection INTERPOLATORS from Injection_SSR.hlsl ---------------------------------------------------------- // Begin Injection INTERPOLATORS from Injection_NormalMaps.hlsl ---------------------------------------------------------- half4 tanYZ_bitXY : TEXCOORD6; // End Injection INTERPOLATORS from Injection_NormalMaps.hlsl ---------------------------------------------------------- UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; //TEXTURE2D(_BaseMap); //SAMPLER(sampler_BaseMap); //TEXTURE2D(_BumpMap); //TEXTURE2D(_MetallicGlossMap); //TEXTURE2D(_DetailMap); //SAMPLER(sampler_DetailMap); // Begin Injection UNIFORMS from Injection_Emission.hlsl ---------------------------------------------------------- //TEXTURE2D(_EmissionMap); // End Injection UNIFORMS from Injection_Emission.hlsl ---------------------------------------------------------- CBUFFER_START(UnityPerMaterial) float4 _WaterColor; float2 _NormalTiling; float _WaterSpeedA; float _NormalIntensity; float _WaterSpeedB; float _WaterSmoothness; //float4 _BaseMap_ST; //half4 _BaseColor; // Begin Injection MATERIAL_CBUFFER from Injection_NormalMap_CBuffer.hlsl ---------------------------------------------------------- //float4 _DetailMap_ST; //half _Details; //half _Normals; // End Injection MATERIAL_CBUFFER from Injection_NormalMap_CBuffer.hlsl ---------------------------------------------------------- // Begin Injection MATERIAL_CBUFFER from Injection_SSR_CBuffer.hlsl ---------------------------------------------------------- float _SSRTemporalMul; // End Injection MATERIAL_CBUFFER from Injection_SSR_CBuffer.hlsl ---------------------------------------------------------- // Begin Injection MATERIAL_CBUFFER from Injection_Emission.hlsl ---------------------------------------------------------- //half _Emission; //half4 _EmissionColor; //half _EmissionFalloff; //half _BakedMutiplier; // End Injection MATERIAL_CBUFFER from Injection_Emission.hlsl ---------------------------------------------------------- //int _Surface; CBUFFER_END sampler2D _BumpMap; half3 OverlayBlendDetail(half source, half3 destination) { half3 switch0 = round(destination); // if destination >= 0.5 then 1, else 0 assuming 0-1 input half3 blendGreater = mad(mad(2.0, destination, -2.0), 1.0 - source, 1.0); // (2.0 * destination - 2.0) * ( 1.0 - source) + 1.0 half3 blendLesser = (2.0 * source) * destination; return mad(switch0, blendGreater, mad(-switch0, blendLesser, blendLesser)); // switch0 * blendGreater + (1 - switch0) * blendLesser //return half3(destination.r > 0.5 ? blendGreater.r : blendLesser.r, // destination.g > 0.5 ? blendGreater.g : blendLesser.g, // destination.b > 0.5 ? blendGreater.b : blendLesser.b // ); } VertOut vert(VertIn v ) { VertOut o = (VertOut)0; UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = defaultVertexValue; #ifdef ASE_ABSOLUTE_VERTEX_POS v.vertex.xyz = vertexValue; #else v.vertex.xyz += vertexValue; #endif v.normal = v.normal; o.wPos = TransformObjectToWorld(v.vertex.xyz); o.vertex = TransformWorldToHClip(o.wPos); o.uv0XY_bitZ_fog.xy = v.uv0.xy; #if defined(LIGHTMAP_ON) || defined(DIRLIGHTMAP_COMBINED) OUTPUT_LIGHTMAP_UV(v.uv1.xy, unity_LightmapST, o.uv1.xy); #endif #ifdef DYNAMICLIGHTMAP_ON OUTPUT_LIGHTMAP_UV(v.uv2.xy, unity_DynamicLightmapST, o.uv1.zw); #endif // Exp2 fog half clipZ_0Far = UNITY_Z_0_FAR_FROM_CLIPSPACE(o.vertex.z); o.uv0XY_bitZ_fog.w = unity_FogParams.x * clipZ_0Far; // Begin Injection VERTEX_NORMALS from Injection_NormalMaps.hlsl ---------------------------------------------------------- VertexNormalInputs ntb = GetVertexNormalInputs(v.normal, v.tangent); o.normXYZ_tanX = half4(ntb.normalWS, ntb.tangentWS.x); o.tanYZ_bitXY = half4(ntb.tangentWS.yz, ntb.bitangentWS.xy); o.uv0XY_bitZ_fog.z = ntb.bitangentWS.z; // End Injection VERTEX_NORMALS from Injection_NormalMaps.hlsl ---------------------------------------------------------- o.SHVertLights = 0; // Calculate vertex lights and L2 probe lighting on quest o.SHVertLights.xyz = VertexLighting(o.wPos, o.normXYZ_tanX.xyz); #if !defined(LIGHTMAP_ON) && !defined(DYNAMICLIGHTMAP_ON) && defined(SHADER_API_MOBILE) o.SHVertLights.xyz += SampleSHVertex(o.normXYZ_tanX.xyz); #endif // Begin Injection VERTEX_END from Injection_SSR.hlsl ---------------------------------------------------------- #if defined(_SSR_ENABLED) float4 lastWPos = mul(GetPrevObjectToWorldMatrix(), v.vertex); o.lastVertex = mul(prevVP, lastWPos); #endif // End Injection VERTEX_END from Injection_SSR.hlsl ---------------------------------------------------------- return o; } #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) #define ASE_SV_DEPTH SV_DepthLessEqual #else #define ASE_SV_DEPTH SV_Depth #endif half4 frag(VertOut i #ifdef ASE_DEPTH_WRITE_ON , out float outputDepth : ASE_SV_DEPTH #endif ) : SV_Target { UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); float2 temp_cast_1 = (_WaterSpeedA).xx; float2 texCoord401 = i.uv0XY_bitZ_fog.xy * _NormalTiling + float2( 0,0 ); float2 panner402 = ( 1.0 * _Time.y * temp_cast_1 + texCoord401); float3 unpack326 = UnpackNormalScale( tex2D( _BumpMap, panner402 ), _NormalIntensity ); unpack326.z = lerp( 1, unpack326.z, saturate(_NormalIntensity) ); float2 temp_cast_2 = (_WaterSpeedB).xx; float2 panner403 = ( 1.0 * _Time.y * temp_cast_2 + texCoord401); float3 unpack328 = UnpackNormalScale( tex2D( _BumpMap, panner403 ), _NormalIntensity ); unpack328.z = lerp( 1, unpack328.z, saturate(_NormalIntensity) ); //-------------------------------------------------------------------------------------------------------------------------- //--Read Input Data--------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------- //float2 uv_main = mad(float2(i.uv0XY_bitZ_fog.xy), _BaseMap_ST.xy, _BaseMap_ST.zw); //float2 uv_detail = mad(float2(i.uv0XY_bitZ_fog.xy), _DetailMap_ST.xy, _DetailMap_ST.zw); //half4 albedo = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, uv_main); //half4 mas = SAMPLE_TEXTURE2D(_MetallicGlossMap, sampler_BaseMap, uv_main); //albedo *= _BaseColor; //half metallic = mas.r; //half ao = mas.g; //half smoothness = mas.b; //--------------------------------------------------------------------------------------------------------------------------- //---Sample Normal Map------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------- //half3 normalTS = half3(0, 0, 1); //half geoSmooth = 1; //half4 normalMap = half4(0, 0, 1, 0); half3 albedo3 = _WaterColor.rgb; half3 normalTS = BlendNormal( unpack326 , unpack328 ); half3 emission = half3(0,0,0); half3 emissionbaked = half3(0,0,0); // Begin Injection NORMAL_MAP from Injection_NormalMaps.hlsl ---------------------------------------------------------- //normalMap = SAMPLE_TEXTURE2D(_BumpMap, sampler_BaseMap, uv_main); //normalTS = UnpackNormal(normalMap); //normalTS = _Normals ? normalTS : half3(0, 0, 1); //geoSmooth = _Normals ? normalMap.b : 1.0; //smoothness = saturate(smoothness + geoSmooth - 1.0); // End Injection NORMAL_MAP from Injection_NormalMaps.hlsl ---------------------------------------------------------- half metallic = half(0); half3 specular = half3(0.5, 0.5, 0.5); half smoothness = _WaterSmoothness; half ao = half(1); half alpha = _WaterColor.a; half alphaclip = half(0); half alphaclipthresholdshadow = half(0); #ifdef ASE_DEPTH_WRITE_ON float DepthValue = 0; #endif #if defined(_ALPHATEST_ON) clip(alpha - alphaclip); #endif #if defined(_ISTRANSPARENT) _SSRTemporalMul = 0.0; #endif half4 albedo = half4(albedo3.rgb, alpha); //--------------------------------------------------------------------------------------------------------------------------- //---Read Detail Map--------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------- //#if defined(_DETAILS_ON) // Begin Injection DETAIL_MAP from Injection_NormalMaps.hlsl ---------------------------------------------------------- //half4 detailMap = SAMPLE_TEXTURE2D(_DetailMap, sampler_DetailMap, uv_detail); //half3 detailTS = half3(2.0 * detailMap.ag - 1.0, 1.0); //normalTS = BlendNormal(normalTS, detailTS); // End Injection DETAIL_MAP from Injection_NormalMaps.hlsl ---------------------------------------------------------- //smoothness = saturate(2.0 * detailMap.b * smoothness); //albedo.rgb = OverlayBlendDetail(detailMap.r, albedo.rgb); //#endif //--------------------------------------------------------------------------------------------------------------------------- //---Transform Normals To Worldspace----------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------- // Begin Injection NORMAL_TRANSFORM from Injection_NormalMaps.hlsl ---------------------------------------------------------- half3 normalWS = i.normXYZ_tanX.xyz; half3x3 TStoWS = half3x3( i.normXYZ_tanX.w, i.tanYZ_bitXY.z, normalWS.x, i.tanYZ_bitXY.x, i.tanYZ_bitXY.w, normalWS.y, i.tanYZ_bitXY.y, i.uv0XY_bitZ_fog.z, normalWS.z ); normalWS = mul(TStoWS, normalTS); normalWS = normalize(normalWS); // End Injection NORMAL_TRANSFORM from Injection_NormalMaps.hlsl ---------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------// //---Lighting Calculations---------------------------------------------------------------------------------------------------// //---------------------------------------------------------------------------------------------------------------------------// // Begin Injection SPEC_AA from Injection_NormalMaps.hlsl ---------------------------------------------------------- #if !defined(SHADER_API_MOBILE) && !defined(LITMAS_FEATURE_TP) // Specular antialiasing based on normal derivatives. Only on PC to avoid cost of derivatives on Quest smoothness = min(smoothness, SLZGeometricSpecularAA(normalWS)); #endif // End Injection SPEC_AA from Injection_NormalMaps.hlsl ---------------------------------------------------------- #if defined(LIGHTMAP_ON) SLZFragData fragData = SLZGetFragData(i.vertex, i.wPos, normalWS, i.uv1.xy, i.uv1.zw, i.SHVertLights.xyz); #else SLZFragData fragData = SLZGetFragData(i.vertex, i.wPos, normalWS, float2(0, 0), float2(0, 0), i.SHVertLights.xyz); #endif //half4 emission = half4(0,0,0,0); // Begin Injection EMISSION from Injection_Emission.hlsl ---------------------------------------------------------- //UNITY_BRANCH if (_Emission) //{ //emission += SAMPLE_TEXTURE2D(_EmissionMap, sampler_BaseMap, uv_main) * _EmissionColor; //emission.rgb *= lerp(albedo.rgb, half3(1, 1, 1), emission.a); //emission.rgb *= pow(abs(fragData.NoV), _EmissionFalloff); //} // End Injection EMISSION from Injection_Emission.hlsl ---------------------------------------------------------- #if !defined(_SLZ_SPECULAR_SETUP) SLZSurfData surfData = SLZGetSurfDataMetallicGloss(albedo.rgb, saturate(metallic), saturate(smoothness), ao, emission.rgb, albedo.a); #else SLZSurfData surfData; surfData.albedo = albedo.rgb; surfData.specular = specular.rgb; surfData.perceptualRoughness = half(1.0) - saturate(smoothness); surfData.reflectivity = (specular.r + specular.g + specular.b) / half(3.0); surfData.roughness = max(surfData.perceptualRoughness * surfData.perceptualRoughness, 1.0e-3h); surfData.emission = emission.rgb; surfData.occlusion = ao; surfData.alpha = alpha; #endif half4 color = half4(1, 1, 1, 1); #if defined(_SurfaceOpaque) int _Surface = 0; #elif defined(_SurfaceTransparent) int _Surface = 1; #elif defined(_SurfaceFade) int _Surface = 2; #else int _Surface = 0; #endif // Begin Injection LIGHTING_CALC from Injection_SSR.hlsl ---------------------------------------------------------- #if defined(_SSR_ENABLED) half4 noiseRGBA = GetScreenNoiseRGBA(fragData.screenUV); SSRExtraData ssrExtra; ssrExtra.meshNormal = i.normXYZ_tanX.xyz; ssrExtra.lastClipPos = i.lastVertex; ssrExtra.temporalWeight = _SSRTemporalMul; ssrExtra.depthDerivativeSum = 0; ssrExtra.noise = noiseRGBA; ssrExtra.fogFactor = i.uv0XY_bitZ_fog.w; color = SLZPBRFragmentSSR(fragData, surfData, ssrExtra, _Surface); color.rgb = max(0, color.rgb); #else color = SLZPBRFragment(fragData, surfData, _Surface); #endif // End Injection LIGHTING_CALC from Injection_SSR.hlsl ---------------------------------------------------------- // Begin Injection VOLUMETRIC_FOG from Injection_SSR.hlsl ---------------------------------------------------------- #if !defined(_SSR_ENABLED) color = MixFogSurf(color, -fragData.viewDir, i.uv0XY_bitZ_fog.w, _Surface); color = VolumetricsSurf(color, fragData.position, _Surface); #endif // End Injection VOLUMETRIC_FOG from Injection_SSR.hlsl ---------------------------------------------------------- #ifdef ASE_DEPTH_WRITE_ON outputDepth = DepthValue; #endif return color; } //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ENDHLSL } Pass { Name "DepthOnly" Tags { "Lightmode"="DepthOnly" } ColorMask 0 HLSLPROGRAM #pragma multi_compile_fog #define LITMAS_FEATURE_LIGHTMAPPING #pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED #define LITMAS_FEATURE_EMISSION #define PC_REFLECTION_PROBE_BLENDING #define PC_REFLECTION_PROBE_BOX_PROJECTION #define PC_SSAO #define MOBILE_LIGHTS_VERTEX #pragma multi_compile_instancing #define PC_RECEIVE_SHADOWS #define _ISTRANSPARENT #define _SurfaceTransparent #define ASE_SRP_VERSION -1 #pragma vertex vert #pragma fragment frag #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PlatformCompiler.hlsl" //DepthOnly------------------------------------------------------------------------------------------------------------------------------------------------------------------------ #define SHADERPASS SHADERPASS_DEPTHONLY #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl" #pragma shader_feature_local_fragment _BRDFMAP struct appdata { float4 vertex : POSITION; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START( UnityPerMaterial ) float4 _WaterColor; float2 _NormalTiling; float _WaterSpeedA; float _NormalIntensity; float _WaterSpeedB; float _WaterSmoothness; CBUFFER_END v2f vert(appdata v ) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = defaultVertexValue; #ifdef ASE_ABSOLUTE_VERTEX_POS v.vertex.xyz = vertexValue; #else v.vertex.xyz += vertexValue; #endif o.vertex = TransformObjectToHClip(v.vertex.xyz); return o; } #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) #define ASE_SV_DEPTH SV_DepthLessEqual #else #define ASE_SV_DEPTH SV_Depth #endif half4 frag(v2f i #ifdef ASE_DEPTH_WRITE_ON , out float outputDepth : ASE_SV_DEPTH #endif ) : SV_Target { UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); half alpha = _WaterColor.a; half alphaclip = half(0); half alphaclipthresholdshadow = half(0); #ifdef ASE_DEPTH_WRITE_ON float DepthValue = 0; #endif #if defined(_ALPHATEST_ON) clip(alpha - alphaclip); #endif #ifdef ASE_DEPTH_WRITE_ON outputDepth = DepthValue; #endif return 0; } //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ENDHLSL } Pass { Name "DepthNormals" Tags { "Lightmode"="DepthNormals" } HLSLPROGRAM #pragma multi_compile_fog #define LITMAS_FEATURE_LIGHTMAPPING #pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED #define LITMAS_FEATURE_EMISSION #define PC_REFLECTION_PROBE_BLENDING #define PC_REFLECTION_PROBE_BOX_PROJECTION #define PC_SSAO #define MOBILE_LIGHTS_VERTEX #pragma multi_compile_instancing #define PC_RECEIVE_SHADOWS #define _ISTRANSPARENT #define _SurfaceTransparent #define ASE_SRP_VERSION -1 #pragma vertex vert #pragma fragment frag #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PlatformCompiler.hlsl" //StandardDepthNormals------------------------------------------------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // // //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- #define SHADERPASS SHADERPASS_DEPTHNORMALS #if defined(SHADER_API_MOBILE) #else #endif #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/EncodeNormalsTexture.hlsl" #pragma shader_feature_local_fragment _BRDFMAP struct appdata { float4 vertex : POSITION; float3 normal : NORMAL; // Begin Injection VERTEX_IN from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- float4 tangent : TANGENT; float2 uv0 : TEXCOORD0; // End Injection VERTEX_IN from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float4 normalWS : NORMAL; float2 uv0 : TEXCOORD0; // Begin Injection INTERPOLATORS from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- float4 tanYZ_bitXY : TEXCOORD1; float4 uv0XY_bitZ_fog : TEXCOORD2; // End Injection INTERPOLATORS from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; // Begin Injection UNIFORMS from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- //TEXTURE2D(_BumpMap); //SAMPLER(sampler_BumpMap); // End Injection UNIFORMS from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- CBUFFER_START(UnityPerMaterial) float4 _WaterColor; float2 _NormalTiling; float _WaterSpeedA; float _NormalIntensity; float _WaterSpeedB; float _WaterSmoothness; //float4 _BaseMap_ST; //half4 _BaseColor; // Begin Injection MATERIAL_CBUFFER from Injection_NormalMap_CBuffer.hlsl ---------------------------------------------------------- //float4 _DetailMap_ST; //half _Details; //half _Normals; // End Injection MATERIAL_CBUFFER from Injection_NormalMap_CBuffer.hlsl ---------------------------------------------------------- // Begin Injection MATERIAL_CBUFFER from Injection_SSR_CBuffer.hlsl ---------------------------------------------------------- float _SSRTemporalMul; // End Injection MATERIAL_CBUFFER from Injection_SSR_CBuffer.hlsl ---------------------------------------------------------- // Begin Injection MATERIAL_CBUFFER from Injection_Emission_CBuffer.hlsl ---------------------------------------------------------- //half _Emission; //half4 _EmissionColor; //half _EmissionFalloff; //half _BakedMutiplier; // End Injection MATERIAL_CBUFFER from Injection_Emission_CBuffer.hlsl ---------------------------------------------------------- //int _Surface; CBUFFER_END sampler2D _BumpMap; v2f vert(appdata v ) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = v.vertex.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = defaultVertexValue; #ifdef ASE_ABSOLUTE_VERTEX_POS v.vertex.xyz = vertexValue; #else v.vertex.xyz += vertexValue; #endif o.vertex = TransformObjectToHClip(v.vertex.xyz); v.normal = v.normal; // Begin Injection VERTEX_NORMAL from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- VertexNormalInputs ntb = GetVertexNormalInputs(v.normal, v.tangent); o.normalWS = float4(ntb.normalWS, ntb.tangentWS.x); o.tanYZ_bitXY = float4(ntb.tangentWS.yz, ntb.bitangentWS.xy); o.uv0XY_bitZ_fog.zw = ntb.bitangentWS.zz; o.uv0XY_bitZ_fog.xy = v.uv0.xy; // End Injection VERTEX_NORMAL from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- o.uv0 = v.uv0; return o; } #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) #define ASE_SV_DEPTH SV_DepthLessEqual #else #define ASE_SV_DEPTH SV_Depth #endif half4 frag(v2f i #ifdef ASE_DEPTH_WRITE_ON , out float outputDepth : ASE_SV_DEPTH #endif ) : SV_Target { UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); float2 temp_cast_0 = (_WaterSpeedA).xx; float2 texCoord401 = i.uv0.xy * _NormalTiling + float2( 0,0 ); float2 panner402 = ( 1.0 * _Time.y * temp_cast_0 + texCoord401); float3 unpack326 = UnpackNormalScale( tex2D( _BumpMap, panner402 ), _NormalIntensity ); unpack326.z = lerp( 1, unpack326.z, saturate(_NormalIntensity) ); float2 temp_cast_1 = (_WaterSpeedB).xx; float2 panner403 = ( 1.0 * _Time.y * temp_cast_1 + texCoord401); float3 unpack328 = UnpackNormalScale( tex2D( _BumpMap, panner403 ), _NormalIntensity ); unpack328.z = lerp( 1, unpack328.z, saturate(_NormalIntensity) ); half4 normals = half4(0, 0, 0, 1); half3 normalTS = BlendNormal( unpack326 , unpack328 ); // Begin Injection FRAG_NORMALS from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- //half4 normalMap = SAMPLE_TEXTURE2D(_BumpMap, sampler_BumpMap, i.uv0XY_bitZ_fog.xy); //half3 normalTS = UnpackNormal(normalMap); //normalTS = _Normals ? normalTS : half3(0, 0, 1); half3x3 TStoWS = half3x3( i.normalWS.w, i.tanYZ_bitXY.z, i.normalWS.x, i.tanYZ_bitXY.x, i.tanYZ_bitXY.w, i.normalWS.y, i.tanYZ_bitXY.y, i.uv0XY_bitZ_fog.z, i.normalWS.z ); half3 normalWS = mul(TStoWS, normalTS); normalWS = normalize(normalWS); normals = half4(EncodeWSNormalForNormalsTex(normalWS),0); // End Injection FRAG_NORMALS from Injection_NormalMap_DepthNormals.hlsl ---------------------------------------------------------- half alpha = _WaterColor.a; half alphaclip = half(0); half alphaclipthresholdshadow = half(0); #ifdef ASE_DEPTH_WRITE_ON float DepthValue = 0; #endif #if defined(_ALPHATEST_ON) clip(alpha - alphaclip); #endif #ifdef ASE_DEPTH_WRITE_ON outputDepth = DepthValue; #endif return normals; } //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ENDHLSL } Pass { Name "Meta" Tags { "LightMode"="Meta" } Cull Off HLSLPROGRAM #pragma multi_compile_fog #define LITMAS_FEATURE_LIGHTMAPPING #pragma multi_compile_fragment _ _VOLUMETRICS_ENABLED #define LITMAS_FEATURE_EMISSION #define PC_REFLECTION_PROBE_BLENDING #define PC_REFLECTION_PROBE_BOX_PROJECTION #define PC_SSAO #define MOBILE_LIGHTS_VERTEX #pragma multi_compile_instancing #define PC_RECEIVE_SHADOWS #define _ISTRANSPARENT #define _SurfaceTransparent #define ASE_SRP_VERSION -1 #define _NORMAL_DROPOFF_TS 1 #define _EMISSION #define _NORMALMAP 1 #pragma vertex vert #pragma fragment frag #define SHADERPASS SHADERPASS_META #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/PlatformCompiler.hlsl" //StandardMeta.hlsl--------------------------------------------------------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // // //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- #define SHADERPASS SHADERPASS_META #define PASS_META #if defined(SHADER_API_MOBILE) #else #endif //#pragma shader_feature _ EDITOR_VISUALIZATION #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #pragma shader_feature_local_fragment _BRDFMAP //TEXTURE2D(_BaseMap); //SAMPLER(sampler_BaseMap); // Begin Injection UNIFORMS from Injection_Emission_Meta.hlsl ---------------------------------------------------------- //TEXTURE2D(_EmissionMap); // End Injection UNIFORMS from Injection_Emission_Meta.hlsl ---------------------------------------------------------- CBUFFER_START(UnityPerMaterial) float4 _WaterColor; float2 _NormalTiling; float _WaterSpeedA; float _NormalIntensity; float _WaterSpeedB; float _WaterSmoothness; //float4 _BaseMap_ST; //half4 _BaseColor; // Begin Injection MATERIAL_CBUFFER from Injection_NormalMap_CBuffer.hlsl ---------------------------------------------------------- //float4 _DetailMap_ST; //half _Details; //half _Normals; // End Injection MATERIAL_CBUFFER from Injection_NormalMap_CBuffer.hlsl ---------------------------------------------------------- // Begin Injection MATERIAL_CBUFFER from Injection_SSR_CBuffer.hlsl ---------------------------------------------------------- float _SSRTemporalMul; // End Injection MATERIAL_CBUFFER from Injection_SSR_CBuffer.hlsl ---------------------------------------------------------- // Begin Injection MATERIAL_CBUFFER from Injection_Emission_CBuffer.hlsl ---------------------------------------------------------- //half _Emission; //half4 _EmissionColor; //half _EmissionFalloff; //half _BakedMutiplier; // End Injection MATERIAL_CBUFFER from Injection_Emission_CBuffer.hlsl ---------------------------------------------------------- //int _Surface; CBUFFER_END struct appdata { float4 vertex : POSITION; float4 uv0 : TEXCOORD0; float4 uv1 : TEXCOORD1; float4 uv2 : TEXCOORD2; float4 uv3 : TEXCOORD3; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 uv : TEXCOORD0; #ifdef EDITOR_VISUALIZATION float4 VizUV : TEXCOORD1; float4 LightCoord : TEXCOORD2; #endif UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(appdata v ) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); float3 vertexValue = float3(0,0,0); v.vertex.xyz += vertexValue; o.vertex = UnityMetaVertexPosition(v.vertex.xyz, v.uv1.xy, v.uv2.xy); //o.uv = TRANSFORM_TEX(v.uv0.xy, _BaseMap); o.uv = v.uv0.xy; #ifdef EDITOR_VISUALIZATION float2 vizUV = 0; float4 lightCoord = 0; UnityEditorVizData(v.vertex.xyz, v.uv0.xy, v.uv1.xy, v.uv2.xy, vizUV, lightCoord); o.VizUV = float4(vizUV, 0, 0); o.LightCoord = lightCoord; #endif return o; } half4 frag(v2f i ) : SV_Target { UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); MetaInput metaInput = (MetaInput)0; float2 uv_main = i.uv; //half4 albedo = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, i.uv) * _BaseColor; //metaInput.Albedo = albedo.rgb; ///half4 emission = half4(0, 0, 0, 0); // Begin Injection EMISSION from Injection_Emission_Meta.hlsl ---------------------------------------------------------- //if (_Emission) //{ //half4 emissionDefault = _EmissionColor * SAMPLE_TEXTURE2D(_EmissionMap, sampler_BaseMap, i.uv); //emissionDefault.rgb *= _BakedMutiplier * _Emission; //emissionDefault.rgb *= lerp(albedo.rgb, half3(1, 1, 1), emissionDefault.a); //emission += emissionDefault; //} // End Injection EMISSION from Injection_Emission_Meta.hlsl ---------------------------------------------------------- //metaInput.Emission = emission.rgb; metaInput.Albedo = _WaterColor.rgb; half3 emission = half3(0,0,0); half3 bakedemission = emission; metaInput.Emission = bakedemission.rgb; #ifdef EDITOR_VISUALIZATION metaInput.VizUV = i.VizUV.xy; metaInput.LightCoord = i.LightCoord; #endif half alpha = _WaterColor.a; half alphaclip = half(0); half alphaclipthresholdshadow = half(0); #if defined(_ALPHATEST_ON) clip(alpha - alphaclip); #endif return MetaFragment(metaInput); } //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ENDHLSL } /*ase_pass*/ Pass { Name "BakedRaytrace" Tags{ "LightMode" = "BakedRaytrace" } HLSLPROGRAM /*ase_pragma_before*/ #pragma multi_compile _ _EMISSION_ON //StandardBakedRT------------------------------------------------------------------------------------------------------------------------------------------------------------------ //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- // // //----------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------- #define SHADERPASS SHADERPASS_RAYTRACE #include "UnityRaytracingMeshUtils.cginc" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" /*ase_pragma*/ #pragma raytracing BakeHit struct RayPayload { float4 color; float3 dir; }; struct AttributeData { float2 barycentrics; }; struct Vertex { float2 texcoord; float3 normal; }; // Begin Injection UNIFORMS from Injection_Emission_BakedRT.hlsl ---------------------------------------------------------- //Texture2D _BaseMap; //SamplerState sampler_BaseMap; //Texture2D _EmissionMap; //SamplerState sampler_EmissionMap; // End Injection UNIFORMS from Injection_Emission_BakedRT.hlsl ---------------------------------------------------------- CBUFFER_START( UnityPerMaterial ) /*ase_srp_batcher*/ //float4 _BaseMap_ST; //half4 _BaseColor; // Begin Injection MATERIAL_CBUFFER from Injection_NormalMap_CBuffer.hlsl ---------------------------------------------------------- //float4 _DetailMap_ST; //half _Details; //half _Normals; // End Injection MATERIAL_CBUFFER from Injection_NormalMap_CBuffer.hlsl ---------------------------------------------------------- // Begin Injection MATERIAL_CBUFFER from Injection_SSR_CBuffer.hlsl ---------------------------------------------------------- float _SSRTemporalMul; // End Injection MATERIAL_CBUFFER from Injection_SSR_CBuffer.hlsl ---------------------------------------------------------- // Begin Injection MATERIAL_CBUFFER from Injection_Emission_CBuffer.hlsl ---------------------------------------------------------- //half _Emission; //half4 _EmissionColor; //half _EmissionFalloff; //half _BakedMutiplier; // End Injection MATERIAL_CBUFFER from Injection_Emission_CBuffer.hlsl ---------------------------------------------------------- //int _AlphaPreMult; CBUFFER_END /*ase_globals*/ /*ase_funcs*/ //https://coty.tips/raytracing-in-unity/ [shader("closesthit")] void MyClosestHit(inout RayPayload payload, AttributeData attributes : SV_IntersectionAttributes) { payload.color = float4(0,0,0,1); //Intializing payload.dir = float3(1,0,0); // Begin Injection CLOSEST_HIT from Injection_Emission_BakedRT.hlsl ---------------------------------------------------------- uint2 launchIdx = DispatchRaysIndex(); uint primitiveIndex = PrimitiveIndex(); uint3 triangleIndicies = UnityRayTracingFetchTriangleIndices(primitiveIndex); Vertex v0, v1, v2; v0.texcoord = UnityRayTracingFetchVertexAttribute2(triangleIndicies.x, kVertexAttributeTexCoord0); v1.texcoord = UnityRayTracingFetchVertexAttribute2(triangleIndicies.y, kVertexAttributeTexCoord0); v2.texcoord = UnityRayTracingFetchVertexAttribute2(triangleIndicies.z, kVertexAttributeTexCoord0); // v0.normal = UnityRayTracingFetchVertexAttribute3(triangleIndicies.x, kVertexAttributeNormal); // v1.normal = UnityRayTracingFetchVertexAttribute3(triangleIndicies.y, kVertexAttributeNormal); // v2.normal = UnityRayTracingFetchVertexAttribute3(triangleIndicies.z, kVertexAttributeNormal); float3 barycentrics = float3(1.0 - attributes.barycentrics.x - attributes.barycentrics.y, attributes.barycentrics.x, attributes.barycentrics.y); Vertex vInterpolated; vInterpolated.texcoord = v0.texcoord * barycentrics.x + v1.texcoord * barycentrics.y + v2.texcoord * barycentrics.z; //TODO: Extract normal direction to ignore the backside of emissive objects //vInterpolated.normal = v0.normal * barycentrics.x + v1.normal * barycentrics.y + v2.normal * barycentrics.z; // if ( dot(vInterpolated.normal, float3(1,0,0) < 0) ) payload.color = float4(0,10,0,1) ; // else payload.color = float4(10,0,0,1) ; //float4 albedo = float4(_BaseMap.SampleLevel(sampler_BaseMap, vInterpolated.texcoord.xy * _BaseMap_ST.xy + _BaseMap_ST.zw, 0).rgb, 1) * _BaseColor; //float4 emission = _Emission * _EmissionMap.SampleLevel(sampler_EmissionMap, vInterpolated.texcoord * _BaseMap_ST.xy + _BaseMap_ST.zw, 0) * _EmissionColor; half3 albedo = /*ase_frag_out:Albedo;Float3;_Albedo*/half3(0.5, 0.5, 0.5)/*end*/; half3 emission = /*ase_frag_out:Emission;Float3;_Emission*/half3(0,0,0)/*end*/; half3 baked_emission = /*ase_frag_out:Baked Emission;Float3;_EmissionBaked*/emission/*end*/; //emission.rgb *= lerp(albedo.rgb, 1, emission.a); //payload.color.rgb = emission.rgb * _BakedMutiplier; // End Injection CLOSEST_HIT from Injection_Emission_BakedRT.hlsl ---------------------------------------------------------- payload.color.rgb = baked_emission.rgb; } //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ENDHLSL } } CustomEditor "UnityEditor.ShaderGraphLitGUI" Fallback "Hidden/InternalErrorShader" } /*ASEBEGIN Version=19102 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;174;1838.601,-748.1998;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;623634af11bd9ab448550ee777f3493e;True;DepthOnly;0;1;DepthOnly;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;False;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;Lightmode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;175;1838.601,-748.1998;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;623634af11bd9ab448550ee777f3493e;True;DepthNormals;0;2;DepthNormals;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;False;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;Lightmode=DepthNormals;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;176;1838.601,-748.1998;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;623634af11bd9ab448550ee777f3493e;True;ShadowCaster;0;3;ShadowCaster;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;False;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;177;1838.601,-748.1998;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;623634af11bd9ab448550ee777f3493e;True;Meta;0;4;Meta;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;False;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.CommentaryNode;313;-4151.871,-2161.722;Inherit;False;1418.059;651.8691;Blend Normals;11;325;402;403;327;328;415;326;401;419;464;465;Blend Normals;0,0,1,1;0;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;173;-2607.442,-2243.814;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;13;AtlasShaders/LitMAS Water 2.5_Quest;623634af11bd9ab448550ee777f3493e;True;Forward;0;0;Forward;14;False;True;1;1;False;;10;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;False;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;False;False;False;True;1;Lightmode=UniversalForward;True;7;False;0;Hidden/InternalErrorShader;0;0;Standard;24;Workflow;1;0;Surface;1;638699003720200241;Two Sided;0;638631752336588731;Cast Shadows;0;638625370991696133; Use Shadow Threshold;0;0;GPU Instancing;1;638630934546427872;Built-in Fog;1;0;Lightmaps;1;0;Volumetrics;1;0;Decals;0;0;Write Depth;0;638630934308364846; Early Z (broken);0;0;Vertex Position,InvertActionOnDeselection;1;0;Emission;1;0;PC Reflection Probe;3;0;PC Receive Shadows;1;638698887280467123;PC Vertex Lights;0;0;PC SSAO;1;0;Q Reflection Probe;0;0;Q Receive Shadows;0;0;Q Vertex Lights;1;0;Q SSAO;0;0;Environment Reflections;1;0;Meta Pass;1;0;0;5;True;True;True;False;True;False;;False;0 Node;AmplifyShaderEditor.Vector2Node;419;-4128.929,-2098.898;Inherit;False;Property;_NormalTiling;Normal Tiling;2;1;[Header];Create;True;1;(Non MV ONLY 0.1 Through 1 Recommended);0;0;False;0;False;0.2,0.2;0.2,0.2;0;3;FLOAT2;0;FLOAT;1;FLOAT;2 Node;AmplifyShaderEditor.TextureCoordinatesNode;401;-3958.232,-2094.556;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;326;-3298.581,-2079.211;Inherit;True;Property;_TextureSample4;Texture Sample 0;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.RangedFloatNode;415;-3693.89,-1819.401;Inherit;False;Property;_NormalIntensity;Normal Intensity;1;1;[Header];Create;True;1;(Non MV ONLY);0;0;False;0;False;0.6;0.6;0;10;0;1;FLOAT;0 Node;AmplifyShaderEditor.SamplerNode;328;-3289.521,-1856.872;Inherit;True;Property;_TextureSample6;Texture Sample 1;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;1;False;white;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.TexturePropertyNode;327;-3641.464,-1735.701;Float;True;Property;_BumpMap;Normal;0;3;[Header];[NoScaleOffset];[Normal];Create;False;1;Textures;0;0;False;0;False;None;fc7df81110c0e4d2498739bf4d47a49d;True;bump;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1 Node;AmplifyShaderEditor.PannerNode;403;-3598.637,-1945.954;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0.04,0.04;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.PannerNode;402;-3600.307,-2080.229;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;-0.03,0;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.BlendNormalsNode;325;-2937.4,-1951.974;Inherit;False;0;3;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.RangedFloatNode;464;-3966.561,-1962.516;Inherit;False;Property;_WaterSpeedA;Water Speed A;5;0;Create;True;0;0;0;False;0;False;0.01;20;-0.1;0.1;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;465;-3971.561,-1880.516;Inherit;False;Property;_WaterSpeedB;Water Speed B;6;0;Create;True;0;0;0;False;0;False;0.01;20;-0.1;0.1;0;1;FLOAT;0 Node;AmplifyShaderEditor.FunctionNode;466;-2496.218,-2378;Inherit;False;BRDFMap;7;;1;1affaac2d6e57354aaa8d6573a2b32b8;0;1;3;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.ColorNode;229;-2960.438,-2498.733;Inherit;False;Property;_WaterColor;Water Color;4;1;[HDR];Create;True;1;Colors;0;0;False;0;False;0.1333333,0.1333333,0.1333333,1;1.605559,1.605559,1.605559,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.RangedFloatNode;423;-2993.679,-2299.866;Inherit;False;Property;_WaterSmoothness;Water Smoothness;3;1;[Header];Create;True;1;Water Attributes;0;0;False;0;False;0.8;0.192;0;1;0;1;FLOAT;0 WireConnection;173;0;229;0 WireConnection;173;1;325;0 WireConnection;173;6;423;0 WireConnection;173;8;229;4 WireConnection;401;0;419;0 WireConnection;326;0;327;0 WireConnection;326;1;402;0 WireConnection;326;5;415;0 WireConnection;328;0;327;0 WireConnection;328;1;403;0 WireConnection;328;5;415;0 WireConnection;403;0;401;0 WireConnection;403;2;465;0 WireConnection;402;0;401;0 WireConnection;402;2;464;0 WireConnection;325;0;326;0 WireConnection;325;1;328;0 ASEEND*/ //CHKSM=55E1397BD22E40F078A7BA6BC9F76C936DBD6627