16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 17:29:18 +02:00

support specular occlusion using bent normals

This commit is contained in:
Wls50
2025-11-28 23:36:26 +01:00
committed by Hirek
parent aa0b6e9965
commit 7316a35b00
5 changed files with 24 additions and 148 deletions

View File

@@ -1,6 +1,6 @@
#ifndef GBUFFER_SSAO_HLSLI
#define GBUFFER_SSAO_HLSLI
Texture2D<float> g_SSAO : register(t5);
Texture2D<float4> g_SSAO : register(t5);
float4 R8G8B8A8_UNORM_to_FLOAT4( uint packedInput )
{
@@ -19,8 +19,11 @@ void DecodeVisibilityBentNormal( const uint packedValue, out float visibility, o
visibility = decoded.w;
}
float GetSSAO(in uint2 pixel_position) {
return g_SSAO[pixel_position];
float4 GetBentNormal(in uint2 pixel_position) {
float4 bent_normal = g_SSAO[pixel_position];
bent_normal.xyz = 2. * bent_normal.xyz - 1.;
bent_normal.z *= -1.;
return bent_normal;
}
#endif