Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/components/textures/shaders/chunks/commonHelpers.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,19 @@ float sample1(
else return 0.0;
}

bool isNaN(float x) {
return x != x;
}

bool isNaNBits(float x) {
uint bits = floatBitsToUint(x);
uint exponent = bits & 0x7F800000u;
uint mantissa = bits & 0x007FFFFFu;
return (exponent == 0x7F800000u) && (mantissa != 0u);
}

void denorm(out float x){
void denorm(inout float x){
x *= (valueRange.y - valueRange.x);
x += valueRange.x;
}

void norm(out float x){
void norm(inout float x){
x -= valueRange.x;
x /= (valueRange.y - valueRange.x);
}
Expand All @@ -62,9 +58,9 @@ void rescaler(inout float x){

vec2 reprojector(
#ifdef IS_FLAT
out vec2 texCoord
inout vec2 texCoord
#else
out vec3 texCoord
inout vec3 texCoord
#endif
) {
vec2 originalCoord = texCoord.xy;
Expand Down
Loading