summaryrefslogtreecommitdiffstats
path: root/src/Runtime/res/effectlib/refraction.glsllib
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@qt.io>2017-12-07 10:56:06 +0100
committerTomi Korpipää <tomi.korpipaa@qt.io>2017-12-14 06:56:38 +0000
commitf28c93051d3bb9a800a4a3a04209aea5f16ab1a9 (patch)
tree9ca98aa63d57dea1adb6313f9a745a39caf1278d /src/Runtime/res/effectlib/refraction.glsllib
parent611f47ded9a119edb3a8bed39387958f5fc3a655 (diff)
Convert Tabs -> Spaces and Removed trailing whitespace from effectlib
This was done to make syncing the effectlib shaders in 3D Studio with the effectlib shaders in the 2.0 runtime where they had already been sanitized. This makes the diffing process easier, and will also bring things into line with the Qt coding standard. Change-Id: I0c45dcb7110cc31a24cce24d72b53e1d451b701b Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Runtime/res/effectlib/refraction.glsllib')
-rw-r--r--src/Runtime/res/effectlib/refraction.glsllib22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Runtime/res/effectlib/refraction.glsllib b/src/Runtime/res/effectlib/refraction.glsllib
index 271ca44f..f961c50e 100644
--- a/src/Runtime/res/effectlib/refraction.glsllib
+++ b/src/Runtime/res/effectlib/refraction.glsllib
@@ -42,11 +42,11 @@ vec3 refraction( in sampler2D sampler, in float materialIOR )
vec2 newUV = vec2(gl_FragCoord.xy/texSize);
if ( xdir > ydir)
{
- newUV = ( viewDir.x > 0.0) ? newUV + displace.xy : newUV - displace.xy;
+ newUV = ( viewDir.x > 0.0) ? newUV + displace.xy : newUV - displace.xy;
}
else
{
- newUV = ( viewDir.y > 0.0) ? newUV - displace.xy : newUV + displace.xy;
+ newUV = ( viewDir.y > 0.0) ? newUV - displace.xy : newUV + displace.xy;
}
vec3 refractColor = texture( sampler, newUV ).rgb;
@@ -72,15 +72,15 @@ vec3 refractBlur( in sampler2D sampler, in vec3 viewDir, in float materialIOR, i
for (int y = -sz; y <= sz; ++y)
{
- for (int x = -sz; x <= sz; ++x)
- {
- float wt = float(x*x + y*y) / (blurWidth * 0.5);
- wt = exp2(-wt);
- //refractColor += wt * textureOffset( sampler, newUV, ivec2(x, y) ).rgb;
- vec2 uvOfs = vec2(x, y) * texSize;
- refractColor += wt * texture( sampler, newUV+uvOfs).rgb;
- wtsum += wt;
- }
+ for (int x = -sz; x <= sz; ++x)
+ {
+ float wt = float(x*x + y*y) / (blurWidth * 0.5);
+ wt = exp2(-wt);
+ //refractColor += wt * textureOffset( sampler, newUV, ivec2(x, y) ).rgb;
+ vec2 uvOfs = vec2(x, y) * texSize;
+ refractColor += wt * texture( sampler, newUV+uvOfs).rgb;
+ wtsum += wt;
+ }
}
return refractColor / wtsum;