summaryrefslogtreecommitdiffstats
path: root/src/Runtime/res/effectlib/microfacetBSDF.glsllib
diff options
context:
space:
mode:
authorMäättä Antti <antti.maatta@qt.io>2017-11-30 12:41:44 +0200
committerAntti Määttä <antti.maatta@qt.io>2018-01-10 12:41:04 +0000
commita15e4a54f78e330c613a2e63d8004169c05d94be (patch)
tree5f3f58b9a0cc2a1dd547ccc3276f28c49fa7c9cf /src/Runtime/res/effectlib/microfacetBSDF.glsllib
parent16185339fc737bfabb415265cdc9beef7146407e (diff)
Improve custom material GLES2 support
Implement light shader property setting for custom materials when constant buffers are not supported. Remove floating point .f from glsllib. Task-number: QT3DS-36 Change-Id: I30df0ef8841daaa166910c2384613a1c9f4e6b46 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Runtime/res/effectlib/microfacetBSDF.glsllib')
-rw-r--r--src/Runtime/res/effectlib/microfacetBSDF.glsllib14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Runtime/res/effectlib/microfacetBSDF.glsllib b/src/Runtime/res/effectlib/microfacetBSDF.glsllib
index e164fcad..8e489107 100644
--- a/src/Runtime/res/effectlib/microfacetBSDF.glsllib
+++ b/src/Runtime/res/effectlib/microfacetBSDF.glsllib
@@ -93,7 +93,7 @@ float DtermGGXAniso( in mat3 tanFrame, in vec3 L, in vec3 V, in float roughnessU
vec4 microfacetBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecular, float ior,
in float roughnessU, in float roughnessV, int mode )
{
- vec4 rgba = vec4( 0.0f, 0.0f, 0.0f, 1.0f );
+ vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
vec3 H = normalize(L + V);
float HdotL = clamp(dot(H, L), 0.0, 1.0);
float NdotL = dot(tanFrame[2], L);
@@ -123,17 +123,17 @@ vec4 microfacetBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecul
vec4 microfacetBSDFEnvironment( in mat3 tanFrame, in vec3 viewDir, in float roughnessU, in float roughnessV, int mode )
{
- vec3 rgb = vec3( 0.0f, 0.0f, 0.0f );
+ vec3 rgb = vec3( 0.0, 0.0, 0.0 );
#if !QT3DS_ENABLE_LIGHT_PROBE
if ( uEnvironmentMappingEnabled )
{
float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
vec3 R = reflect( -viewDir, tanFrame[2] );
rgb = 0.01 * evalEnvironmentMap( R, roughness );
- rgb = microfacetBSDF( tanFrame, R, viewDir, rgb, 1.0f, roughnessU, roughnessV, scatter_reflect ).rgb;
+ rgb = microfacetBSDF( tanFrame, R, viewDir, rgb, 1.0, roughnessU, roughnessV, scatter_reflect ).rgb;
}
#endif
- return( vec4( rgb, 1.0f ) );
+ return( vec4( rgb, 1.0 ) );
}
@@ -211,7 +211,7 @@ vec3 sampleEnv(in vec3 L, float pdf, uint sampleCount, float roughness )
float b = 0.5*log2( pdf * d );
// convert coord to 2D
- vec2 tc = vec2( ( atan( L.x, -L.z ) + PI ) / ( 2.0f * PI ), acos( -L.y ) / PI );
+ vec2 tc = vec2( ( atan( L.x, -L.z ) + PI ) / ( 2.0 * PI ), acos( -L.y ) / PI );
float weight = step( 0.0001, roughness );
float lod = max( 0.0, min( (a - b)*weight, envMapLevels ));
@@ -221,7 +221,7 @@ vec3 sampleEnv(in vec3 L, float pdf, uint sampleCount, float roughness )
vec4 microfacetSampledBSDF( in mat3 tanFrame, in vec3 viewDir, in float roughnessU, in float roughnessV, int mode )
{
- vec3 rgb = vec3( 0.0f, 0.0f, 0.0f );
+ vec3 rgb = vec3( 0.0, 0.0, 0.0 );
float roughness = clamp( calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] ), 0.0, 1.0 );
@@ -253,7 +253,7 @@ vec4 microfacetSampledBSDF( in mat3 tanFrame, in vec3 viewDir, in float roughnes
rgb /= float(NumSamples);
- return( vec4( rgb, 1.0f ) );
+ return( vec4( rgb, 1.0 ) );
}
#endif