summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2019-05-06 16:23:06 +0300
committerMahmoud Badri <mahmoud.badri@qt.io>2019-05-06 16:50:30 +0000
commitd9e04d60fc7bd12187ef7cfab87d093fb90759ef (patch)
tree0021303a35b2fc5e5014c71eea40312716014cf1
parentf4570615677464bcf3e69086320def6c6b8841ff (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>
-rw-r--r--Studio/Content/Material Library/aluminium_anodized.shader2
-rw-r--r--Studio/Content/Material Library/aluminium_anodized_emissive.shader6
-rw-r--r--Studio/Content/Material Library/aluminum.shader2
-rw-r--r--Studio/Content/Material Library/aluminum_brushed.shader2
-rw-r--r--Studio/Content/Material Library/aluminum_emissive.shader18
-rw-r--r--Studio/Content/Material Library/bamboo_natural_matte_emissive.shader4
-rw-r--r--Studio/Content/Material Library/carbon_fiber_emissive.shader2
-rw-r--r--Studio/Content/Material Library/carpaint_blue_standard.shader8
-rw-r--r--Studio/Content/Material Library/carpaint_color_peel_2_layer.shader6
-rw-r--r--Studio/Content/Material Library/carpaint_yellow_standard.shader8
-rw-r--r--Studio/Content/Material Library/copper.shader2
-rw-r--r--Studio/Content/Material Library/paper_office.shader4
-rw-r--r--Studio/Content/Material Library/plastic_structured_red.shader2
-rw-r--r--Studio/Content/Material Library/plastic_structured_red_emissive.shader4
-rw-r--r--Studio/Content/Material Library/porcelain.shader2
-rw-r--r--Studio/Content/Material Library/powder_coat.shader6
-rw-r--r--Studio/Content/Material Library/powder_coat_emissive.shader4
-rw-r--r--Studio/Content/Material Library/rubber_studded_black.shader8
-rw-r--r--Studio/Content/Material Library/rubber_studded_emissive.shader4
-rw-r--r--Studio/Content/Material Library/simple_glass.shader2
-rw-r--r--Studio/Content/Material Library/thin_glass_frosted.shader6
-rw-r--r--Studio/Content/Material Library/thin_glass_frosted_sp.shader2
-rw-r--r--Studio/Content/Material Library/thin_glass_refractive.shader2
23 files changed, 53 insertions, 53 deletions
diff --git a/Studio/Content/Material Library/aluminium_anodized.shader b/Studio/Content/Material Library/aluminium_anodized.shader
index f989cbcd..17da9fb3 100644
--- a/Studio/Content/Material Library/aluminium_anodized.shader
+++ b/Studio/Content/Material Library/aluminium_anodized.shader
@@ -153,7 +153,7 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = fresnelLayer( normal, vec3( 22, 22, 22 ), 1.000000, vec4( base_color, 1.0).rgb, layers[0].layer, layers[0].base, alpha );
+ color = fresnelLayer( normal, vec3( 22, 22, 22 ), 1.000000, base_color.rgb, layers[0].layer, layers[0].base, alpha );
return color;
}
diff --git a/Studio/Content/Material Library/aluminium_anodized_emissive.shader b/Studio/Content/Material Library/aluminium_anodized_emissive.shader
index 22ebcab4..1c3233f2 100644
--- a/Studio/Content/Material Library/aluminium_anodized_emissive.shader
+++ b/Studio/Content/Material Library/aluminium_anodized_emissive.shader
@@ -99,13 +99,13 @@ 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, tmp3, 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, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).tint ) ) ) ) ) );
+ return( vec3(1.0) * vec3( vec3( ( intensity *( emission_color.rgb * ( fileTexture(emissive_texture, vec3(0.0), vec3(1.0), mono_alpha, tmp3, vec2(0.0, 1.0), vec2(0.0, 1.0), wrap_repeat, wrap_repeat, gamma_default ).tint * fileTexture(emissive_mask_texture, vec3(0.0), vec3(1.0), mono_alpha, tmp3, 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 )
{
#if QT3DS_ENABLE_CG_LIGHTING
- layers[0].base += tmpShadowTerm * vec4( 0.0, 0.0, 0.0, 1.0 );
+ layers[0].base += tmpShadowTerm * vec4(0.0, 0.0, 0.0, 1.0);
layers[0].layer += tmpShadowTerm * microfacetBSDF( layers[0].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, roughness, roughness, scatter_reflect );
#endif
@@ -189,7 +189,7 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = fresnelLayer( normal, vec3( 22, 22, 22 ), 1.000000, vec4( base_color, 1.0).rgb, layers[0].layer, layers[0].base, alpha );
+ color = fresnelLayer( normal, vec3( 22, 22, 22 ), 1.000000, base_color.rgb, layers[0].layer, layers[0].base, alpha );
return color;
}
diff --git a/Studio/Content/Material Library/aluminum.shader b/Studio/Content/Material Library/aluminum.shader
index 00909fa3..e2a5beac 100644
--- a/Studio/Content/Material Library/aluminum.shader
+++ b/Studio/Content/Material Library/aluminum.shader
@@ -198,7 +198,7 @@ void computeTemporaries()
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;
}
diff --git a/Studio/Content/Material Library/aluminum_brushed.shader b/Studio/Content/Material Library/aluminum_brushed.shader
index a3492898..594b4faa 100644
--- a/Studio/Content/Material Library/aluminum_brushed.shader
+++ b/Studio/Content/Material Library/aluminum_brushed.shader
@@ -199,7 +199,7 @@ void computeTemporaries()
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;
}
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;
}
diff --git a/Studio/Content/Material Library/bamboo_natural_matte_emissive.shader b/Studio/Content/Material Library/bamboo_natural_matte_emissive.shader
index fde99ae1..7096c146 100644
--- a/Studio/Content/Material Library/bamboo_natural_matte_emissive.shader
+++ b/Studio/Content/Material Library/bamboo_natural_matte_emissive.shader
@@ -111,10 +111,10 @@ 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 ) ), tmp2 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).tint ) ) ) ) );
+ return( vec3(1.0) * vec3( vec3( ( intensity *( emission_color.rgb * fileTexture(emissive_texture, vec3(0.0), vec3(1.0), mono_alpha, transformCoordinate( rotationTranslationScale( vec3(0.0), vec3(0.0), vec3(1.0) ), tmp2 ), 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 )
+void computeFrontLayerColor(in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 lightDiffuse, in vec3 lightSpecular, in float materialIOR, float aoFactor)
{
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].layer += tmpShadowTerm * microfacetBSDF( layers[0].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, roughness, roughness, scatter_reflect );
diff --git a/Studio/Content/Material Library/carbon_fiber_emissive.shader b/Studio/Content/Material Library/carbon_fiber_emissive.shader
index 255ec618..fae9b7bb 100644
--- a/Studio/Content/Material Library/carbon_fiber_emissive.shader
+++ b/Studio/Content/Material Library/carbon_fiber_emissive.shader
@@ -130,7 +130,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 ) ), tmp3 ), 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.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( 1.000000, 1.000000, 1.000000 ) ), tmp3 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), 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 )
diff --git a/Studio/Content/Material Library/carpaint_blue_standard.shader b/Studio/Content/Material Library/carpaint_blue_standard.shader
index 5fed8438..b28a8144 100644
--- a/Studio/Content/Material Library/carpaint_blue_standard.shader
+++ b/Studio/Content/Material Library/carpaint_blue_standard.shader
@@ -110,7 +110,7 @@ void computeFrontLayerColor( in vec3 normal, in vec3 lightDir, in vec3 viewDir,
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].layer += tmpShadowTerm * microfacetBSDF( layers[0].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, 0.000000, 0.000000, scatter_reflect );
- layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color, grazing_base_color, 5.000000, diffuseReflectionBSDF( normal, lightDir, viewDir, lightDiffuse, 0.000000 ) );
+ layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color.rgb, grazing_base_color.rgb, 5.000000, diffuseReflectionBSDF( normal, lightDir, viewDir, lightDiffuse, 0.000000 ) );
layers[1].layer += tmpShadowTerm * microfacetBSDF( layers[1].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, 0.200000, 0.200000, scatter_reflect );
#endif
@@ -121,7 +121,7 @@ void computeFrontAreaColor( in int lightIdx, in vec4 lightDiffuse, in vec4 light
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].layer += tmpShadowTerm * lightSpecular * sampleAreaGlossy( layers[0].tanFrame, varWorldPos, lightIdx, viewDir, 0.000000, 0.000000 );
- layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color, grazing_base_color, 5.000000, lightDiffuse * sampleAreaDiffuse( layers[1].tanFrame, varWorldPos, lightIdx ) );
+ layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color.rgb, grazing_base_color.rgb, 5.000000, lightDiffuse * sampleAreaDiffuse( layers[1].tanFrame, varWorldPos, lightIdx ) );
layers[1].layer += tmpShadowTerm * lightSpecular * sampleAreaGlossy( layers[1].tanFrame, varWorldPos, lightIdx, viewDir, 0.200000, 0.200000 );
#endif
@@ -132,13 +132,13 @@ void computeFrontLayerEnvironment( in vec3 normal, in vec3 viewDir, float aoFact
#if !QT3DS_ENABLE_LIGHT_PROBE
layers[0].layer += tmpShadowTerm * microfacetSampledBSDF( layers[0].tanFrame, viewDir, 0.000000, 0.000000, scatter_reflect );
- layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color, grazing_base_color, 5.000000, diffuseReflectionBSDFEnvironment( normal, 0.000000 ) * aoFactor );
+ layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color.rgb, grazing_base_color.rgb, 5.000000, diffuseReflectionBSDFEnvironment( normal, 0.000000 ) * aoFactor );
layers[1].layer += tmpShadowTerm * microfacetSampledBSDF( layers[1].tanFrame, viewDir, 0.200000, 0.200000, scatter_reflect );
#else
layers[0].layer += tmpShadowTerm * sampleGlossyAniso( layers[0].tanFrame, viewDir, 0.000000, 0.000000 );
- layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color, grazing_base_color, 5.000000, sampleDiffuse( layers[1].tanFrame ) * aoFactor );
+ layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color.rgb, grazing_base_color.rgb, 5.000000, sampleDiffuse( layers[1].tanFrame ) * aoFactor );
layers[1].layer += tmpShadowTerm * sampleGlossyAniso( layers[1].tanFrame, viewDir, 0.200000, 0.200000 );
#endif
diff --git a/Studio/Content/Material Library/carpaint_color_peel_2_layer.shader b/Studio/Content/Material Library/carpaint_color_peel_2_layer.shader
index 2db1bf52..c435306c 100644
--- a/Studio/Content/Material Library/carpaint_color_peel_2_layer.shader
+++ b/Studio/Content/Material Library/carpaint_color_peel_2_layer.shader
@@ -222,9 +222,9 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = weightedLayer( ftmp3, vec4( vec3( 1, 0.01, 0.01 ), 1.0).rgb, layers[2].layer, layers[2].base * vec4( base_color, 1.0), alpha );
- color = weightedLayer( ftmp2, vec4( flake_color, 1.0).rgb, layers[1].layer, color, color.a );
- color = fresnelLayer( ftmp0, vec3( coating_ior ), coat_weight, vec4( coat_color, 1.0).rgb, layers[0].layer, color, color.a );
+ color = weightedLayer( ftmp3, vec4( vec3( 1, 0.01, 0.01 ), 1.0).rgb, layers[2].layer, layers[2].base * vec4( base_color.rgb, 1.0), alpha );
+ color = weightedLayer( ftmp2, flake_color.rgb, layers[1].layer, color, color.a );
+ color = fresnelLayer( ftmp0, vec3( coating_ior ), coat_weight, coat_color.rgb, layers[0].layer, color, color.a );
return color;
}
diff --git a/Studio/Content/Material Library/carpaint_yellow_standard.shader b/Studio/Content/Material Library/carpaint_yellow_standard.shader
index 52d32e8b..7e795114 100644
--- a/Studio/Content/Material Library/carpaint_yellow_standard.shader
+++ b/Studio/Content/Material Library/carpaint_yellow_standard.shader
@@ -110,7 +110,7 @@ void computeFrontLayerColor( in vec3 normal, in vec3 lightDir, in vec3 viewDir,
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].layer += tmpShadowTerm * microfacetBSDF( layers[0].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, 0.000000, 0.000000, scatter_reflect );
- layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color, grazing_base_color, 5.000000, diffuseReflectionBSDF( normal, lightDir, viewDir, lightDiffuse, 0.000000 ) );
+ layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color.rgb, grazing_base_color.rgb, 5.000000, diffuseReflectionBSDF( normal, lightDir, viewDir, lightDiffuse, 0.000000 ) );
layers[1].layer += tmpShadowTerm * microfacetBSDF( layers[1].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, 0.200000, 0.200000, scatter_reflect );
#endif
@@ -121,7 +121,7 @@ void computeFrontAreaColor( in int lightIdx, in vec4 lightDiffuse, in vec4 light
#if QT3DS_ENABLE_CG_LIGHTING
layers[0].layer += tmpShadowTerm * lightSpecular * sampleAreaGlossy( layers[0].tanFrame, varWorldPos, lightIdx, viewDir, 0.000000, 0.000000 );
- layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color, grazing_base_color, 5.000000, lightDiffuse * sampleAreaDiffuse( layers[1].tanFrame, varWorldPos, lightIdx ) );
+ layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color.rgb, grazing_base_color.rgb, 5.000000, lightDiffuse * sampleAreaDiffuse( layers[1].tanFrame, varWorldPos, lightIdx ) );
layers[1].layer += tmpShadowTerm * lightSpecular * sampleAreaGlossy( layers[1].tanFrame, varWorldPos, lightIdx, viewDir, 0.200000, 0.200000 );
#endif
@@ -132,13 +132,13 @@ void computeFrontLayerEnvironment( in vec3 normal, in vec3 viewDir, float aoFact
#if !QT3DS_ENABLE_LIGHT_PROBE
layers[0].layer += tmpShadowTerm * microfacetSampledBSDF( layers[0].tanFrame, viewDir, 0.000000, 0.000000, scatter_reflect );
- layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color, grazing_base_color, 5.000000, diffuseReflectionBSDFEnvironment( normal, 0.000000 ) * aoFactor );
+ layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color.rgb, grazing_base_color.rgb, 5.000000, diffuseReflectionBSDFEnvironment( normal, 0.000000 ) * aoFactor );
layers[1].layer += tmpShadowTerm * microfacetSampledBSDF( layers[1].tanFrame, viewDir, 0.200000, 0.200000, scatter_reflect );
#else
layers[0].layer += tmpShadowTerm * sampleGlossyAniso( layers[0].tanFrame, viewDir, 0.000000, 0.000000 );
- layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color, grazing_base_color, 5.000000, sampleDiffuse( layers[1].tanFrame ) * aoFactor );
+ layers[1].base += tmpShadowTerm * directionalFactor( normal, viewDir, normal_base_color.rgb, grazing_base_color.rgb, 5.000000, sampleDiffuse( layers[1].tanFrame ) * aoFactor );
layers[1].layer += tmpShadowTerm * sampleGlossyAniso( layers[1].tanFrame, viewDir, 0.200000, 0.200000 );
#endif
diff --git a/Studio/Content/Material Library/copper.shader b/Studio/Content/Material Library/copper.shader
index 5f407def..cf9e1ad4 100644
--- a/Studio/Content/Material Library/copper.shader
+++ b/Studio/Content/Material Library/copper.shader
@@ -153,7 +153,7 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = fresnelLayer( normal, vec3( 25.65, 25.65, 25.65 ), 1.000000, vec4( metal_color, 1.0).rgb, layers[0].layer, layers[0].base, alpha );
+ color = fresnelLayer( normal, vec3( 25.65, 25.65, 25.65 ), 1.000000, metal_color.rgb, layers[0].layer, layers[0].base, alpha );
return color;
}
diff --git a/Studio/Content/Material Library/paper_office.shader b/Studio/Content/Material Library/paper_office.shader
index 22f60721..6f183a55 100644
--- a/Studio/Content/Material Library/paper_office.shader
+++ b/Studio/Content/Material Library/paper_office.shader
@@ -215,14 +215,14 @@ vec3 computeNormal()
void computeTemporaries()
{
tmp1 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( texture_tiling[0], texture_tiling[1], 1.000000 ) ), textureCoordinateInfo( texCoord0, tangent, binormal ) );
- ftmp0 = blendColorLayers( color_layer[1]( color_layer(blendColorLayers( color_layer[1]( color_layer(fileTexture(transmission_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp1, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).tint, 0.700000, color_layer_blend ) ), paper_color, mono_average ).tint, 1.000000, color_layer_multiply ) ), vec3( 1, 1, 1 ), mono_average ).tint;
+ ftmp0 = blendColorLayers( color_layer[1]( color_layer(blendColorLayers( color_layer[1]( color_layer(fileTexture(transmission_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp1, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).tint, 0.700000, color_layer_blend ) ), paper_color.rgb, mono_average ).tint, 1.000000, color_layer_multiply ) ), vec3( 1, 1, 1 ), mono_average ).tint;
tmpShadowTerm = evalBakedShadowMap( texCoord0 );
}
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = layers[0].base * vec4( paper_color, 1.0);
+ color = layers[0].base * vec4( paper_color.rgb, 1.0);
return color;
}
diff --git a/Studio/Content/Material Library/plastic_structured_red.shader b/Studio/Content/Material Library/plastic_structured_red.shader
index f9be9ec3..1e6b7981 100644
--- a/Studio/Content/Material Library/plastic_structured_red.shader
+++ b/Studio/Content/Material Library/plastic_structured_red.shader
@@ -179,7 +179,7 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = fresnelLayer( normal, vec3( material_ior ), 0.350000, vec4( vec3( 1, 1, 1 ), 1.0).rgb, layers[0].layer, layers[0].base * vec4( diffuse_color, 1.0), alpha );
+ color = fresnelLayer( normal, vec3( material_ior ), 0.350000, vec4( vec3( 1, 1, 1 ), 1.0).rgb, layers[0].layer, layers[0].base * vec4( diffuse_color.rgb, 1.0), alpha );
return color;
}
diff --git a/Studio/Content/Material Library/plastic_structured_red_emissive.shader b/Studio/Content/Material Library/plastic_structured_red_emissive.shader
index 9e834df2..f85719ec 100644
--- a/Studio/Content/Material Library/plastic_structured_red_emissive.shader
+++ b/Studio/Content/Material Library/plastic_structured_red_emissive.shader
@@ -114,7 +114,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 ) ), textureCoordinateInfo( texCoord0, tangent, binormal ) ), 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.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( 1.000000, 1.000000, 1.000000 ) ), textureCoordinateInfo( texCoord0, tangent, binormal ) ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), 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 )
@@ -203,7 +203,7 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = fresnelLayer( normal, vec3( material_ior ), 0.350000, vec4( vec3( 1, 1, 1 ), 1.0).rgb, layers[0].layer, layers[0].base * vec4( diffuse_color, 1.0), alpha );
+ color = fresnelLayer( normal, vec3( material_ior ), 0.350000, vec4( vec3( 1, 1, 1 ), 1.0).rgb, layers[0].layer, layers[0].base * vec4( diffuse_color.rgb, 1.0), alpha );
return color;
}
diff --git a/Studio/Content/Material Library/porcelain.shader b/Studio/Content/Material Library/porcelain.shader
index b21cda76..8b5978ea 100644
--- a/Studio/Content/Material Library/porcelain.shader
+++ b/Studio/Content/Material Library/porcelain.shader
@@ -156,7 +156,7 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = fresnelLayer( normal, vec3( material_ior ), glossy_weight, vec4( vec3( 1, 1, 1 ), 1.0).rgb, layers[0].layer, layers[0].base * vec4( porcelain_color, 1.0), alpha );
+ color = fresnelLayer( normal, vec3( material_ior ), glossy_weight, vec4( vec3( 1, 1, 1 ), 1.0).rgb, layers[0].layer, layers[0].base * vec4( porcelain_color.rgb, 1.0), alpha );
return color;
}
diff --git a/Studio/Content/Material Library/powder_coat.shader b/Studio/Content/Material Library/powder_coat.shader
index e5c55ae5..c26fa044 100644
--- a/Studio/Content/Material Library/powder_coat.shader
+++ b/Studio/Content/Material Library/powder_coat.shader
@@ -185,14 +185,14 @@ vec3 computeNormal()
void computeTemporaries()
{
- ftmp0 = vec3( reflectivity );
- tmpShadowTerm = evalBakedShadowMap( texCoord0 );
+ ftmp0 = vec3( reflectivity );
+ tmpShadowTerm = evalBakedShadowMap( texCoord0 );
}
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = weightedLayer( diffuse_weight, vec4( powdercoat_diffuse_color, 1.0).rgb, layers[1].layer, layers[1].base, alpha );
+ color = weightedLayer( diffuse_weight, powdercoat_diffuse_color.rgb, layers[1].layer, layers[1].base, alpha );
color = fresnelLayer( normal, vec3( material_ior ), glossy_weight, vec4( ftmp0, 1.0).rgb, layers[0].layer, color, color.a );
return color;
}
diff --git a/Studio/Content/Material Library/powder_coat_emissive.shader b/Studio/Content/Material Library/powder_coat_emissive.shader
index 4470c960..40560793 100644
--- a/Studio/Content/Material Library/powder_coat_emissive.shader
+++ b/Studio/Content/Material Library/powder_coat_emissive.shader
@@ -110,7 +110,7 @@ bool evalTwoSided()
vec3 computeFrontMaterialEmissive()
{
- return( vec3( 1.0, 1.0, 1.0) * vec3( vec3( ( ( 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 ) ), tmp3 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).tint*emission_color )*intensity ) ) ) );
+ return( vec3( 1.0, 1.0, 1.0) * vec3( vec3( ( ( 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 ) ), tmp3 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).tint * emission_color.rgb ) * intensity ) ) ) );
}
void computeFrontLayerColor( in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 lightDiffuse, in vec3 lightSpecular, in float materialIOR, float aoFactor )
@@ -227,7 +227,7 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = weightedLayer( diffuse_weight, vec4( powdercoat_diffuse_color, 1.0).rgb, layers[1].layer, layers[1].base, alpha );
+ color = weightedLayer( diffuse_weight, powdercoat_diffuse_color.rgb, layers[1].layer, layers[1].base, alpha );
color = fresnelLayer( normal, vec3( material_ior ), glossy_weight, vec4( ftmp0, 1.0).rgb, layers[0].layer, color, color.a );
return color;
}
diff --git a/Studio/Content/Material Library/rubber_studded_black.shader b/Studio/Content/Material Library/rubber_studded_black.shader
index b6173812..a2af7d0d 100644
--- a/Studio/Content/Material Library/rubber_studded_black.shader
+++ b/Studio/Content/Material Library/rubber_studded_black.shader
@@ -183,15 +183,15 @@ vec3 computeNormal()
void computeTemporaries()
{
- tmp4 = fileBumpTexture(bump_texture, bump_amount, mono_average, transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( texture_tiling[0], texture_tiling[1], 1.000000 ) ), textureCoordinateInfo( texCoord0, tangent, binormal ) ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal );
- tmpShadowTerm = evalBakedShadowMap( texCoord0 );
+ tmp4 = fileBumpTexture(bump_texture, bump_amount, mono_average, transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( texture_tiling[0], texture_tiling[1], 1.000000 ) ), textureCoordinateInfo( texCoord0, tangent, binormal ) ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal );
+ tmpShadowTerm = evalBakedShadowMap( texCoord0 );
}
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = weightedLayer( 1.000000, vec4( base_color, 1.0).rgb, layers[1].layer, layers[1].base, alpha );
- color = fresnelLayer( tmp4, vec3( material_ior ), glossy_weight, vec4( vec3( 1, 1, 1 ), 1.0).rgb, layers[0].layer, color, color.a );
+ color = weightedLayer( 1.0, base_color.rgb, layers[1].layer, layers[1].base, alpha );
+ color = fresnelLayer( tmp4, vec3( material_ior ), glossy_weight, vec3(1.0), layers[0].layer, color, color.a );
return color;
}
diff --git a/Studio/Content/Material Library/rubber_studded_emissive.shader b/Studio/Content/Material Library/rubber_studded_emissive.shader
index ff4526ae..de45c938 100644
--- a/Studio/Content/Material Library/rubber_studded_emissive.shader
+++ b/Studio/Content/Material Library/rubber_studded_emissive.shader
@@ -109,7 +109,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, tmp6, 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, tmp6, 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, tmp6, 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, tmp6, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), 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 )
@@ -209,7 +209,7 @@ void computeTemporaries()
vec4 computeLayerWeights( in float alpha )
{
vec4 color;
- color = weightedLayer( 1.000000, vec4( base_color, 1.0).rgb, layers[1].layer, layers[1].base, alpha );
+ color = weightedLayer( 1.000000, base_color.rgb, layers[1].layer, layers[1].base, alpha );
color = fresnelLayer( tmp5, vec3( material_ior ), glossy_weight, vec4( vec3( 1, 1, 1 ), 1.0).rgb, layers[0].layer, color, color.a );
return color;
}
diff --git a/Studio/Content/Material Library/simple_glass.shader b/Studio/Content/Material Library/simple_glass.shader
index bf3b75c6..09aa2c9b 100644
--- a/Studio/Content/Material Library/simple_glass.shader
+++ b/Studio/Content/Material Library/simple_glass.shader
@@ -173,7 +173,7 @@ vec4 computeGlass(in vec3 normal, in float materialIOR, in float alpha, in vec4
{
vec4 rgba = color;
float ratio = simpleFresnel( normal, materialIOR, uFresnelPower );
- vec3 absorb_color = ( log( glass_color )/-1.000000 );
+ vec3 absorb_color = ( log( glass_color.rgb )/-1.000000 );
// prevent log(0) -> inf number issue
if ( isinf(absorb_color.r) ) absorb_color.r = 1.0;
if ( isinf(absorb_color.g) ) absorb_color.g = 1.0;
diff --git a/Studio/Content/Material Library/thin_glass_frosted.shader b/Studio/Content/Material Library/thin_glass_frosted.shader
index d1719431..b66c4cd9 100644
--- a/Studio/Content/Material Library/thin_glass_frosted.shader
+++ b/Studio/Content/Material Library/thin_glass_frosted.shader
@@ -258,7 +258,7 @@ vec3 getRefractUV( in vec2 baseUV, in vec3 normal, in float materialIOR, in floa
vec4 doFakeInnerLight( in vec3 normal, in vec3 absorb_color )
{
- vec3 lightColor = intLightCol * intLightBrt;
+ vec3 lightColor = intLightCol.rgb * intLightBrt;
float cosRot = cos(intLightRot * 0.01745329251);
float sinRot = sin(intLightRot * 0.01745329251);
@@ -284,7 +284,7 @@ vec4 computeGlass(in vec3 normal, in float materialIOR, in float alpha, in vec4
{
vec4 rgba = color;
float ratio = simpleFresnel( normal, materialIOR, uFresnelPower );
- vec3 absorb_color = ( log( glass_color ) * -1.000000 );
+ vec3 absorb_color = ( log( glass_color.rgb ) * -1.000000 );
// prevent log(0) -> inf number issue
if ( isinf(absorb_color.r) ) absorb_color.r = 1.0;
if ( isinf(absorb_color.g) ) absorb_color.g = 1.0;
@@ -300,7 +300,7 @@ vec4 computeGlass(in vec3 normal, in float materialIOR, in float alpha, in vec4
vec3 refractColor = refractValue.a * refractValue.rgb + (1.0 - refractValue.a) * value.rgb;
refractColor = refractColor * (vec3(1.0) - absorb_color);
- vec4 internalColor = doFakeInnerLight( normal, glass_color );
+ vec4 internalColor = doFakeInnerLight( normal, glass_color.rgb );
refractColor += internalColor.rgb * internalColor.a;
rgba = vec4(mix(refractColor, rgba.rgb, ratio), 1.0);
diff --git a/Studio/Content/Material Library/thin_glass_frosted_sp.shader b/Studio/Content/Material Library/thin_glass_frosted_sp.shader
index d6a20ecd..6619ec2d 100644
--- a/Studio/Content/Material Library/thin_glass_frosted_sp.shader
+++ b/Studio/Content/Material Library/thin_glass_frosted_sp.shader
@@ -216,7 +216,7 @@ vec4 computeGlass(in vec3 normal, in float materialIOR, in float alpha, in vec4
{
vec4 rgba = color;
float ratio = simpleFresnel( normal, materialIOR, uFresnelPower );
- vec3 absorb_color = ( log( glass_color )/-1.000000 );
+ vec3 absorb_color = ( log( glass_color.rgb )/-1.000000 );
// prevent log(0) -> inf number issue
if ( isinf(absorb_color.r) ) absorb_color.r = 1.0;
if ( isinf(absorb_color.g) ) absorb_color.g = 1.0;
diff --git a/Studio/Content/Material Library/thin_glass_refractive.shader b/Studio/Content/Material Library/thin_glass_refractive.shader
index 958faf0c..16cf172d 100644
--- a/Studio/Content/Material Library/thin_glass_refractive.shader
+++ b/Studio/Content/Material Library/thin_glass_refractive.shader
@@ -175,7 +175,7 @@ vec4 computeGlass(in vec3 normal, in float materialIOR, in float alpha, in vec4
{
vec4 rgba = color;
float ratio = simpleFresnel( normal, materialIOR, uFresnelPower );
- vec3 absorb_color = ( log( glass_color )/-1.000000 );
+ vec3 absorb_color = ( log( glass_color.rgb )/-1.000000 );
// prevent log(0) -> inf number issue
if ( isinf(absorb_color.r) ) absorb_color.r = 1.0;
if ( isinf(absorb_color.g) ) absorb_color.g = 1.0;