diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-05-06 16:23:06 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-05-06 16:50:30 +0000 |
commit | d9e04d60fc7bd12187ef7cfab87d093fb90759ef (patch) | |
tree | 0021303a35b2fc5e5014c71eea40312716014cf1 /Studio/Content/Material Library/aluminum_emissive.shader | |
parent | f4570615677464bcf3e69086320def6c6b8841ff (diff) |
Update custom material shaders to work with alpha channel colors
Task-number: QT3DS-3395
Change-Id: I462629e7c4b616fde7f7c9354477b2ab3f836fb9
Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'Studio/Content/Material Library/aluminum_emissive.shader')
-rw-r--r-- | Studio/Content/Material Library/aluminum_emissive.shader | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Studio/Content/Material Library/aluminum_emissive.shader b/Studio/Content/Material Library/aluminum_emissive.shader index 5512dcd0..ed480124 100644 --- a/Studio/Content/Material Library/aluminum_emissive.shader +++ b/Studio/Content/Material Library/aluminum_emissive.shader @@ -112,7 +112,7 @@ bool evalTwoSided() vec3 computeFrontMaterialEmissive() { - return( vec3( 1.0, 1.0, 1.0) * vec3( vec3( ( intensity*( emission_color*( fileTexture(emissive_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_alpha, transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( 1.000000, 1.000000, 1.000000 ) ), tmp1 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).tint*fileTexture(emissive_mask_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_alpha, transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), emissive_mask_offset, vec3( 1.000000, 1.000000, 1.000000 ) ), tmp1 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).tint ) ) ) ) ) ); + return( vec3( 1.0, 1.0, 1.0) * vec3( vec3( ( intensity*( emission_color.rgb *( fileTexture(emissive_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_alpha, transformCoordinate( rotationTranslationScale( vec3( 0.0, 0.0, 0.0 ), vec3( 0.0, 0.0, 0.0 ), vec3( 1.0, 1.0, 1.0 ) ), tmp1 ), vec2( 0.0, 1.0 ), vec2( 0.0, 1.0 ), wrap_repeat, wrap_repeat, gamma_default ).tint*fileTexture(emissive_mask_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_alpha, transformCoordinate( rotationTranslationScale( vec3( 0.0, 0.0, 0.0 ), emissive_mask_offset, vec3( 1.0, 1.0, 1.0 ) ), tmp1 ), vec2( 0.0, 1.0 ), vec2( 0.0, 1.0 ), wrap_repeat, wrap_repeat, gamma_default ).tint ) ) ) ) ) ); } void computeFrontLayerColor( in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 lightDiffuse, in vec3 lightSpecular, in float materialIOR, float aoFactor ) @@ -185,27 +185,27 @@ float computeIOR() float evalCutout() { - return( 1.000000 ); + return( 1.0 ); } vec3 computeNormal() { - return( fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ) ); + return( fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.0, 1.0 ), vec2( 0.0, 1.0 ), wrap_repeat, wrap_repeat, normal ) ); } void computeTemporaries() { - tmp1 = textureCoordinateInfo( texCoord0, tangent, binormal ); - tmp2 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), tiling ), tmp1 ); - tmp3 = fileTexture(roughness_texture, vec3( roughness_map_offset ), vec3( roughness_map_scale ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; - ftmp0 = fileTexture(reflection_texture, vec3( reflection_map_offset ), vec3( reflection_map_scale ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + tmp1 = textureCoordinateInfo( texCoord0, tangent, binormal ); + tmp2 = transformCoordinate( rotationTranslationScale( vec3( 0.0, 0.0, 0.0 ), vec3( 0.0, 0.0, 0.0 ), tiling ), tmp1 ); + tmp3 = fileTexture(roughness_texture, vec3( roughness_map_offset ), vec3( roughness_map_scale ), mono_luminance, tmp2, vec2( 0.0, 1.0 ), vec2( 0.0, 1.0 ), wrap_repeat, wrap_repeat, gamma_default ).mono; + ftmp0 = fileTexture(reflection_texture, vec3( reflection_map_offset ), vec3( reflection_map_scale ), mono_luminance, tmp2, vec2( 0.0, 1.0 ), vec2( 0.0, 1.0 ), wrap_repeat, wrap_repeat, gamma_default ).mono; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) { vec4 color; - color = weightedLayer( ftmp0, vec4( metal_color, 1.0).rgb, layers[0].layer, layers[0].base, alpha ); + color = weightedLayer( ftmp0, metal_color.rgb, layers[0].layer, layers[0].base, alpha ); return color; } |