Created
May 22, 2021 04:59
-
-
Save antoinefortin/eafbce8f0430b61ba21096a0e474220d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Use this to clear GBuffer like...*/ | |
| float3 GetNormalWorldSpace(float2 uv, float depth) | |
| { | |
| float3 normalWS = 0.0f; | |
| if (depth > 0.0f) | |
| { | |
| NormalData normalData; | |
| const float4 normalBuffer = LOAD_TEXTURE2D_X(_NormalBufferTexture, uv); | |
| DecodeFromNormalBuffer(normalBuffer, uv, normalData); | |
| normalWS = normalData.normalWS; | |
| } | |
| return normalWS; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment