diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 259: SceneRefract: The GLSL [ES] built-in 'refract()' expects a ratio of refractive

Message ID 20121221195612.28689.99907.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Jesse Barker Dec. 21, 2012, 7:56 p.m. UTC
------------------------------------------------------------
revno: 259
committer: Jesse Barker <jesse.barker@linaro.org>
branch nick: trunk
timestamp: Fri 2012-12-21 11:54:32 -0800
message:
  SceneRefract: The GLSL [ES] built-in 'refract()' expects a ratio of refractive
  indices, so make the back interface value a reciprocal of the front.
modified:
  data/shaders/light-refract.frag


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'data/shaders/light-refract.frag'
--- data/shaders/light-refract.frag	2012-12-14 00:06:17 +0000
+++ data/shaders/light-refract.frag	2012-12-21 19:54:32 +0000
@@ -29,7 +29,7 @@ 
     // object.
     vec2 normcoord = back_position.st * point_five + point_five;
     vec3 back_normal = texture2D(NormalMap, normcoord).xyz;
-    vec3 back_refraction = refract(back_position, back_normal, 1.0);
+    vec3 back_refraction = refract(back_position, back_normal, 1.0/RefractiveIndex);
     // Use the transmitted vector from the exit point to determine where
     // the vector would intersect the environment (in this case a background
     // image.