Make byteround less expensive (thanks hrydgard!)

This commit is contained in:
Dwayne Slater 2018-04-07 18:26:14 -04:00
parent 734279ff22
commit 234161ba62

View File

@ -1101,19 +1101,19 @@ float LookupLightingLUTSigned(int lut_index, float pos) {
}
float byteround(float x) {
return round(x * 255.0) / 255.0;
return round(x * 255.0) * (1.0 / 255.0);
}
vec2 byteround(vec2 x) {
return round(x * 255.0) / 255.0;
return round(x * 255.0) * (1.0 / 255.0);
}
vec3 byteround(vec3 x) {
return round(x * 255.0) / 255.0;
return round(x * 255.0) * (1.0 / 255.0);
}
vec4 byteround(vec4 x) {
return round(x * 255.0) / 255.0;
return round(x * 255.0) * (1.0 / 255.0);
}
)";