Upload project file

This commit is contained in:
Misaki
2024-08-15 17:00:11 +09:00
parent 684c51a8c0
commit e441bb7911
162 changed files with 63084 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
//#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl"
#ifndef DECODEDEPTHNORMALS_INCLUDED
#define DECODEDEPTHNORMALS_INCLUDED
inline float DecodeFloatRG(float2 enc) {
float2 kDecodeDot = float2(1.0, 1 / 255.0);
return dot(enc, kDecodeDot);
}
inline float3 DecodeViewNormalStereo(float4 enc4) {
float kScale = 1.7777;
float3 nn = enc4.xyz * float3(2 * kScale, 2 * kScale, 0) + float3(-kScale, -kScale, 1);
float g = 2.0 / dot(nn.xyz, nn.xyz);
float3 n;
n.xy = g * nn.xy;
n.z = g - 1;
return n;
}
inline void DecodeDepthNormal(float4 enc, out float depth, out float3 normal) {
depth = DecodeFloatRG(enc.zw);
normal = DecodeViewNormalStereo(enc);
}
#endif