Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This file is just some shared placeholder attributes and varyings for Outline Post Process
- // I've included some informative comments from Colin Leung's example URPToonLitShader which has some interesting organization.
- // https://github.com/ColinLeung-NiloCat/UnityURPToonLitShaderExample/blob/master/SimpleURPToonLitOutlineExample_Shared.hlsl
- // #pragma once is a safe guard best practice in almost every .hlsl (need Unity2020 or up),
- // doing this can make sure your .hlsl's user can include this .hlsl anywhere anytime without producing any multi include conflict
- #pragma once
- // We don't have "UnityCG.cginc" in SRP/URP's package anymore, so:
- // Including the following two hlsl files is enough for shading with Universal Pipeline. Everything is included in them.
- // Core.hlsl will include SRP shader library, all constant buffers not related to materials (perobject, percamera, perframe).
- // It also includes matrix/space conversion functions and fog.
- // Lighting.hlsl will include the light functions/data to abstract light constants. You should use GetMainLight and GetLight functions
- // that initialize Light struct. Lighting.hlsl also include GI, Light BDRF functions. It also includes Shadows.
- // Required by all Universal Render Pipeline shaders.
- // It will include Unity built-in shader variables (except the lighting variables)
- // (https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html
- // It will also include many utilitary functions.
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- // Include this if you are doing a lit shader. This includes lighting shader variables,
- // lighting and shadow functions
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- struct Attributes
- {
- float4 positionOS : POSITION;
- float2 uv : TEXCOORD0;
- };
- struct Varyings
- {
- float4 positionHCS : SV_POSITION;
- float2 uv : TEXCOORD0;
- };
Add Comment
Please, Sign In to add comment