From 567c5bbb76be2b4c56d7997dc23ff0b527d94d76 Mon Sep 17 00:00:00 2001 From: REDDRAGON Date: Mon, 23 Apr 2018 20:16:37 +0200 Subject: [PATCH] Redo: voxel normal encoding naming --- MAGE/Shaders/shaders/voxelization/voxel.hlsli | 4 ++-- MAGE/Shaders/shaders/voxelization/voxelization.hlsli | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MAGE/Shaders/shaders/voxelization/voxel.hlsli b/MAGE/Shaders/shaders/voxelization/voxel.hlsli index 29408a2f6..f3c484151 100644 --- a/MAGE/Shaders/shaders/voxelization/voxel.hlsli +++ b/MAGE/Shaders/shaders/voxelization/voxel.hlsli @@ -24,11 +24,11 @@ float3 DecodeRadiance(uint encoded_L) { return LogLuvToRGB(UnpackR8G8B8A8(encoded_L)); } -uint EncodeUnitVector(float3 n) { +uint EncodeNormal(float3 n) { return PackR16G16(NORMAL_ENCODE_FUNCTION(n)); } -float3 DecodeUnitVector(uint encoded_n) { +float3 DecodeNormal(uint encoded_n) { return NORMAL_DECODE_FUNCTION(UnpackR16G16(encoded_n)); } diff --git a/MAGE/Shaders/shaders/voxelization/voxelization.hlsli b/MAGE/Shaders/shaders/voxelization/voxelization.hlsli index 67490b187..b9947f166 100644 --- a/MAGE/Shaders/shaders/voxelization/voxelization.hlsli +++ b/MAGE/Shaders/shaders/voxelization/voxelization.hlsli @@ -75,7 +75,7 @@ void PS(PSInputPositionNormalTexture input) { // Encode the radiance and normal. const uint encoded_L = EncodeRadiance(L); - const uint endoced_n = EncodeUnitVector(n_world); + const uint endoced_n = EncodeNormal(n_world); // Store the encoded radiance and normal. InterlockedMax(voxel_grid[flat_index].encoded_L, encoded_L); InterlockedMax(voxel_grid[flat_index].encoded_n, endoced_n); //TODO