Temp FIN
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
// Unity's HLSL seems not to support dynamic array size, so we can only set this before compilation
|
||||
#define MAX_SORTED_PIXELS 8
|
||||
#define POW_2_24 16777216
|
||||
|
||||
//https://github.com/GameTechDev/AOIT-Update/blob/master/OIT_DX11/AOIT%20Technique/AOIT.hlsl
|
||||
// UnpackRGBA takes a uint value and converts it to a float4
|
||||
@@ -27,7 +28,7 @@ uint PackRGBA(float4 unpackedInput)
|
||||
}
|
||||
|
||||
float UnpackDepth(uint uDepthSampleIdx) {
|
||||
return (float)(uDepthSampleIdx >> 8UL) / (pow(2, 24) - 1);
|
||||
return (float)(uDepthSampleIdx >> 8UL) / (POW_2_24 - 1);
|
||||
}
|
||||
|
||||
uint UnpackSampleIdx(uint uDepthSampleIdx) {
|
||||
@@ -35,7 +36,7 @@ uint UnpackSampleIdx(uint uDepthSampleIdx) {
|
||||
}
|
||||
|
||||
uint PackDepthSampleIdx(float depth, uint uSampleIdx) {
|
||||
uint d = (uint)(saturate(depth) * (pow(2, 24) - 1));
|
||||
uint d = (uint)(saturate(depth) * (POW_2_24 - 1));
|
||||
return d << 8UL | uSampleIdx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user