diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-06-02 11:10:26 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-06-02 11:10:26 +0800 |
commit | aebd601a9399433146933510dcfdb04abe7e03d5 (patch) | |
tree | 2e8b755151a5b1f92297cd477565d7fb246292b9 /indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl | |
parent | 30e33e279b1b2d04951c399f548c3afc3b17fd1b (diff) |
More float operands for float operations
This is so that it doesn't throw a compilation error at runtime
for not defining consistently with float values,
which would be uncastable on some certain other implementation.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl index 5ef3d63eb2..e1a1fda602 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl @@ -145,24 +145,24 @@ vec2 getScreenCoordinate(vec2 screenpos) vec3 getNorm(vec2 screenpos) { vec2 enc = texture(normalMap, screenpos.xy).xy; - vec2 fenc = enc*4-2; + vec2 fenc = enc*4.0-2.0; float f = dot(fenc,fenc); - float g = sqrt(1-f/4); + float g = sqrt(1.0-f/4.0); vec3 n; n.xy = fenc*g; - n.z = 1-f/2; + n.z = 1.0-f/2.0; return n; } vec3 getNormalFromPacked(vec4 packedNormalEnvIntensityFlags) { vec2 enc = packedNormalEnvIntensityFlags.xy; - vec2 fenc = enc*4-2; + vec2 fenc = enc*4.0-2.0; float f = dot(fenc,fenc); - float g = sqrt(1-f/4); + float g = sqrt(1.0-f/4.0); vec3 n; n.xy = fenc*g; - n.z = 1-f/2; + n.z = 1.0-f/2.0; return normalize(n); // TODO: Is this normalize redundant? } @@ -269,7 +269,7 @@ vec4 texture2DLodSpecular(vec2 tc, float lod) vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); float det = min(lod/(proj_lod*0.5), 1.0); float d = min(dist.x, dist.y); - d *= min(1, d * (proj_lod - lod)); // BUG? extra factor compared to diffuse causes N repeats + d *= min(1.0, d * (proj_lod - lod)); // BUG? extra factor compared to diffuse causes N repeats float edge = 0.25*det; ret *= clamp(d/edge, 0.0, 1.0); @@ -385,7 +385,7 @@ vec3 pbrIbl(vec3 diffuseColor, float perceptualRough) { // retrieve a scale and bias to F0. See [1], Figure 3 - vec2 brdf = BRDF(clamp(nv, 0, 1), 1.0-perceptualRough); + vec2 brdf = BRDF(clamp(nv, 0.0, 1.0), 1.0-perceptualRough); vec3 diffuseLight = irradiance; vec3 specularLight = radiance; @@ -545,7 +545,7 @@ uniform float waterSign; void waterClip(vec3 pos) { // TODO: make this less branchy - if (waterSign > 0) + if (waterSign > 0.0) { if ((dot(pos.xyz, waterPlane.xyz) + waterPlane.w) < 0.0) { |