summaryrefslogtreecommitdiffstats
path: root/src/Runtime/res/effectlib/blendColorLayers.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/blendColorLayers.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/blendColorLayers.glsllib')
-rw-r--r--src/Runtime/res/effectlib/blendColorLayers.glsllib56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/Runtime/res/effectlib/blendColorLayers.glsllib b/src/Runtime/res/effectlib/blendColorLayers.glsllib
index 395b2f50..e07fe613 100644
--- a/src/Runtime/res/effectlib/blendColorLayers.glsllib
+++ b/src/Runtime/res/effectlib/blendColorLayers.glsllib
@@ -3,43 +3,43 @@
float maxValue( in vec3 t )
{
- return max( max( t.x, t.y ), t.z );
+ return max( max( t.x, t.y ), t.z );
}
vec3 blendColor( in vec3 t, in vec3 b, in float weight, in int blendMode)
{
- vec3 blendResult = t;
- switch( blendMode )
- {
- case color_layer_add :
- blendResult += b;
- break;
- case color_layer_multiply :
- blendResult *= b;
- break;
- case color_layer_screen :
- blendResult += t - t * b;
- break;
- case color_layer_overlay:
- blendResult = (maxValue(t) >= 0.5) ? 2.0 * (t+b - t*b - 0.5) : 2.0 * t*b;
- break;
- case color_layer_blend:
- default:
- // nothing to be done
- break;
- }
+ vec3 blendResult = t;
+ switch( blendMode )
+ {
+ case color_layer_add :
+ blendResult += b;
+ break;
+ case color_layer_multiply :
+ blendResult *= b;
+ break;
+ case color_layer_screen :
+ blendResult += t - t * b;
+ break;
+ case color_layer_overlay:
+ blendResult = (maxValue(t) >= 0.5) ? 2.0 * (t+b - t*b - 0.5) : 2.0 * t*b;
+ break;
+ case color_layer_blend:
+ default:
+ // nothing to be done
+ break;
+ }
- return mix( b, blendResult, weight );
+ return mix( b, blendResult, weight );
}
texture_return blendColorLayers( in color_layer colorLayer[1], in vec3 base, in int monoSource )
-{
- vec3 result = blendColor( colorLayer[0].layer_color, base, colorLayer[0].weight, colorLayer[0].mode );
+{
+ vec3 result = blendColor( colorLayer[0].layer_color, base, colorLayer[0].weight, colorLayer[0].mode );
- texture_return tr;
- tr.tint = result;
- tr.mono = monoChannel( vec4( result, 1.0 ), monoSource );
- return( tr );
+ texture_return tr;
+ tr.tint = result;
+ tr.mono = monoChannel( vec4( result, 1.0 ), monoSource );
+ return( tr );
}
#endif