summaryrefslogtreecommitdiffstats
path: root/src/Runtime/res/effectlib/sampleProbe.glsllib
diff options
context:
space:
mode:
authorMäättä Antti <antti.maatta@qt.io>2017-10-18 15:36:03 +0300
committerAntti Määttä <antti.maatta@qt.io>2017-10-24 13:23:37 +0000
commit7377640e36ec191e9148affadefdc817dbbe3270 (patch)
treef8e18a136ca0f1264ecfa2e0b0dc881409314cf3 /src/Runtime/res/effectlib/sampleProbe.glsllib
parent034994c8cd31cb035fbb290b229afffc2adf79ff (diff)
Replace UIC with QT3DS from materials and effectlib
Change-Id: Ifc5b409777a978401bd4179599b27fb4aa611844 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Runtime/res/effectlib/sampleProbe.glsllib')
-rw-r--r--src/Runtime/res/effectlib/sampleProbe.glsllib12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Runtime/res/effectlib/sampleProbe.glsllib b/src/Runtime/res/effectlib/sampleProbe.glsllib
index 4ecd416b..53da5aaa 100644
--- a/src/Runtime/res/effectlib/sampleProbe.glsllib
+++ b/src/Runtime/res/effectlib/sampleProbe.glsllib
@@ -36,12 +36,12 @@ uniform vec4 light_probe_props;
uniform vec4 light_probe_rotation;
uniform vec4 light_probe_offset; // light_probe_offset.w = number of mipmaps
-#if UIC_ENABLE_LIGHT_PROBE_2
+#if QT3DS_ENABLE_LIGHT_PROBE_2
uniform sampler2D light_probe2;
uniform vec4 light_probe2_props;
#endif
-#if UIC_ENABLE_IBL_FOV
+#if QT3DS_ENABLE_IBL_FOV
uniform vec4 light_probe_opts;
#endif
@@ -96,7 +96,7 @@ vec2 getProbeSampleUV( vec3 smpDir, vec4 probeRot, vec2 probeOfs )
{
vec2 smpUV;
-#if UIC_ENABLE_IBL_FOV
+#if QT3DS_ENABLE_IBL_FOV
smpUV.x = (2.0 * atan(-smpDir.z, smpDir.x) + 3.14159265358 ) / light_probe_opts.x;
smpUV.y = (2.0 * atan(-smpDir.z, smpDir.y) + 3.14159265358 ) / light_probe_opts.x;
#else
@@ -110,7 +110,7 @@ vec2 getProbeSampleUV( vec3 smpDir, vec4 probeRot, vec2 probeOfs )
vec4 getTopLayerSample( vec3 inDir, float lodShift, vec3 lodOffsets )
{
-#if UIC_ENABLE_LIGHT_PROBE_2
+#if QT3DS_ENABLE_LIGHT_PROBE_2
if ( light_probe2_props.w < 0.5 )
return vec4(0.0, 0.0, 0.0, 0.0);
@@ -142,7 +142,7 @@ vec3 getProbeWeightedSample( vec3 smpDir, float lodShift, float roughness, vec3
vec2 smpUV = getProbeSampleUV( smpDir, light_probe_rotation, light_probe_offset.xy );
float wt = 1.0;
-#if UIC_ENABLE_IBL_FOV
+#if QT3DS_ENABLE_IBL_FOV
wt = min(wt, smoothstep(roughness * -0.25, roughness * 0.25, smpUV.x));
wt = min(wt, smoothstep(roughness * -0.25, roughness * 0.25, smpUV.y));
wt = min(wt, 1.0 - smoothstep(1.0 - roughness*0.25, 1.0 + roughness*0.25, smpUV.x));
@@ -179,7 +179,7 @@ vec3 getProbeWeightedSample( vec3 smpDir, float lodShift, float roughness, vec3
retVal += 0.3 * textureLod( light_probe, smpUV , lodShift+lodOffsets.y ).xyz;
retVal += 0.1 * textureLod( light_probe, smpUV , lodShift+lodOffsets.z ).xyz;
-#if UIC_ENABLE_LIGHT_PROBE_2
+#if QT3DS_ENABLE_LIGHT_PROBE_2
vec4 topSmp = getTopLayerSample( smpDir, lodShift, lodOffsets );
vec3 tempVal = mix( retVal, topSmp.xyz, topSmp.w );
retVal = mix( retVal, tempVal, light_probe2_props.z );