diff options
author | Määttä Antti <antti.maatta@qt.io> | 2017-11-30 12:41:44 +0200 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2018-01-10 12:41:04 +0000 |
commit | a15e4a54f78e330c613a2e63d8004169c05d94be (patch) | |
tree | 5f3f58b9a0cc2a1dd547ccc3276f28c49fa7c9cf /src/Runtime/res/effectlib/gradient3Recolor.glsllib | |
parent | 16185339fc737bfabb415265cdc9beef7146407e (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/gradient3Recolor.glsllib')
-rw-r--r-- | src/Runtime/res/effectlib/gradient3Recolor.glsllib | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Runtime/res/effectlib/gradient3Recolor.glsllib b/src/Runtime/res/effectlib/gradient3Recolor.glsllib index 18556f3e..ba7d5937 100644 --- a/src/Runtime/res/effectlib/gradient3Recolor.glsllib +++ b/src/Runtime/res/effectlib/gradient3Recolor.glsllib @@ -35,15 +35,15 @@ float gradientInterpolate( in int interpolationMode, in float value ) case gradient_interpolation_linear : return( value ); case gradient_interpolation_off : - return( 0.0f ); + return( 0.0 ); case gradient_interpolation_ease_in : - return( 1.0f - pow( 1.0f - value, 2.0f/3.0f ) ); + return( 1.0 - pow( 1.0 - value, 2.0/3.0 ) ); case gradient_interpolation_ease_out : - return( pow( value, 2.0f/3.0f ) ); + return( pow( value, 2.0/3.0 ) ); case gradient_interpolation_ease_in_out : - return( ( value <= 0.5f ) - ? 0.5f * pow( 2.0f * value, 2.0f/3.0f ) - : 0.5f + 0.5f * ( 1.0f - pow( 2.0f * ( 1.0f - value ), 2.0f/3.0f ) ) ); + return( ( value <= 0.5 ) + ? 0.5 * pow( 2.0 * value, 2.0/3.0 ) + : 0.5 + 0.5 * ( 1.0 - pow( 2.0 * ( 1.0 - value ), 2.0/3.0 ) ) ); default: return( value ); // default is linear } @@ -67,7 +67,7 @@ texture_return gradient3Recolor( in float gradientPositions[3], in vec3 gradient float relPos = gradientInterpolate( interpolationModes[index], ( pos - gradientPositions[index] ) / ( gradientPositions[index+1] - gradientPositions[index] ) ); tr.tint = mix( gradientColors[index], gradientColors[index+1], relPos ); } - tr.mono = 0.0f; + tr.mono = 0.0; return( tr ); } |