From a37d31d37efd9e9130354609829461635603fb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Fri, 9 Oct 2020 11:51:46 +0300 Subject: Convert Material library to use images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic7754a206a0c0205d71ce78bc42d90c10abbba25 Reviewed-by: Tomi Korpipää --- .../aluminium_anodized_emissive.shader | 11 +++++---- Studio/Content/Material Library/aluminum.shader | 10 +++++---- .../Material Library/aluminum_anisotropic.shader | 10 ++++++--- .../Material Library/aluminum_brushed.shader | 14 ++++++++---- .../Material Library/aluminum_emissive.shader | 25 ++++++++++++--------- .../aluminum_textured_aniso.shader | 12 +++++----- Studio/Content/Material Library/asphalt.shader | 10 ++++++--- .../Material Library/bamboo_natural_matte.shader | 14 +++++++----- .../bamboo_natural_matte_emissive.shader | 19 ++++++++++------ .../Content/Material Library/carbon_fiber.shader | 25 +++++++++++++-------- .../Material Library/carbon_fiber_emissive.shader | 26 ++++++++++++---------- Studio/Content/Material Library/concrete.shader | 13 ++++++----- .../Material Library/leather_smoothed_black.shader | 13 +++++++---- Studio/Content/Material Library/mesh_fence.shader | 13 ++++++----- .../Material Library/metal_mesh_fine.shader | 15 ++++++++----- .../Content/Material Library/paper_artistic.shader | 15 ++++++++----- .../Content/Material Library/paper_office.shader | 11 +++++---- .../Material Library/plastic_structured_red.shader | 2 +- .../plastic_structured_red_emissive.shader | 11 ++++++--- Studio/Content/Material Library/powder_coat.shader | 2 +- .../Material Library/powder_coat_emissive.shader | 6 ++--- .../Material Library/rubber_studded_black.shader | 2 +- .../rubber_studded_emissive.shader | 16 ++++++++----- .../steel_milled_concentric.shader | 21 +++++++++-------- .../Material Library/thin_glass_frosted.shader | 6 ++--- .../Material Library/thin_glass_frosted_sp.shader | 8 +++---- .../Content/Material Library/walnut_matte.shader | 12 +++++----- res/effectlib/customMaterial.glsllib | 16 +++++-------- res/effectlib/evalBakedShadowMap.glsllib | 2 +- res/effectlib/transformCoordinate.glsllib | 9 ++++++++ 30 files changed, 227 insertions(+), 142 deletions(-) diff --git a/Studio/Content/Material Library/aluminium_anodized_emissive.shader b/Studio/Content/Material Library/aluminium_anodized_emissive.shader index ae5beba..444f620 100644 --- a/Studio/Content/Material Library/aluminium_anodized_emissive.shader +++ b/Studio/Content/Material Library/aluminium_anodized_emissive.shader @@ -68,7 +68,8 @@ struct texture_return // temporary declarations -texture_coordinate_info tmp3; +texture_coordinate_info tmp1; +texture_coordinate_info tmp2; vec4 tmpShadowTerm; layer_result layers[1]; @@ -99,7 +100,8 @@ bool evalTwoSided() vec3 computeFrontMaterialEmissive() { - 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 ) ) ) ) ) ); + return intensity * emission_color.rgb * fileTexture(emissive_texture, vec3(0.0), vec3(1.0), mono_alpha, 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), vec3(1.0), mono_alpha, 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 ) @@ -182,8 +184,9 @@ vec3 computeNormal() void computeTemporaries() { - tmp3 = 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 ) ); - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + tmp1 = textureCoordinateInfo( texcoordTransformed_emissive_texture(texCoord0), tangent, binormal ); + tmp2 = textureCoordinateInfo( texcoordTransformed_emissive_mask_texture(texCoord0), tangent, binormal ); + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/aluminum.shader b/Studio/Content/Material Library/aluminum.shader index a046e5f..efd61fb 100644 --- a/Studio/Content/Material Library/aluminum.shader +++ b/Studio/Content/Material Library/aluminum.shader @@ -73,9 +73,10 @@ struct texture_return // temporary declarations texture_coordinate_info tmp1; +texture_coordinate_info tmp3; float tmp2; float ftmp0; - vec4 tmpShadowTerm; +vec4 tmpShadowTerm; layer_result layers[1]; @@ -184,14 +185,15 @@ float evalCutout() vec3 computeNormal() { - return( fileBumpTexture(bump_texture, bump_amount, mono_average, tmp1, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ) ); + return( fileBumpTexture(bump_texture, bump_amount, mono_average, scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ) ); } void computeTemporaries() { - tmp1 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), tiling ), textureCoordinateInfo( texCoord0, tangent, binormal ) ); + tmp1 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_roughness_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_reflection_texture(texCoord0), tangent, binormal ) ); tmp2 = fileTexture(roughness_texture, vec3( roughness_map_offset ), vec3( roughness_map_scale ), mono_luminance, tmp1, 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, tmp1, 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, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } diff --git a/Studio/Content/Material Library/aluminum_anisotropic.shader b/Studio/Content/Material Library/aluminum_anisotropic.shader index 14a211c..c9d604e 100644 --- a/Studio/Content/Material Library/aluminum_anisotropic.shader +++ b/Studio/Content/Material Library/aluminum_anisotropic.shader @@ -84,6 +84,8 @@ struct anisotropy_return // temporary declarations +texture_coordinate_info tmp1; +texture_coordinate_info tmp2; texture_coordinate_info tmp3; texture_return tmp4; anisotropy_return tmp5; @@ -217,9 +219,11 @@ vec3 computeNormal() void computeTemporaries() { - tmp3 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( tiling[0], tiling[1], 1.000000 ) ), textureCoordinateInfo( texCoord0, tangent, binormal ) ); - tmp4 = fileTexture(reflection_texture, vec3( reflection_map_offset ), vec3( reflection_map_scale ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ); - tmp5 = anisotropyConversion( fileTexture(reflection_texture, vec3( roughness_map_offset ), vec3( roughness_map_scale ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, anisotropy, fileTexture(aniso_rot_texture, vec3( aniso_tex_color_offset ), vec3( aniso_tex_color_scale ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono, tangent, false ); + tmp1 = scaleCoordinate(vec3( tiling[0], tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_aniso_rot_texture(texCoord0), tangent, binormal ) ); + tmp2 = scaleCoordinate(vec3( tiling[0], tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_reflection_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(vec3( tiling[0], tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp4 = 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_linear ); + tmp5 = anisotropyConversion( fileTexture(reflection_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_linear ).mono, anisotropy, fileTexture(aniso_rot_texture, vec3( aniso_tex_color_offset ), vec3( aniso_tex_color_scale ), mono_luminance, tmp1, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono, tangent, false ); tmp6 = tmp4.tint; tmp8 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); ftmp0 = tmp5.roughness_u; diff --git a/Studio/Content/Material Library/aluminum_brushed.shader b/Studio/Content/Material Library/aluminum_brushed.shader index 9fefa35..079c159 100644 --- a/Studio/Content/Material Library/aluminum_brushed.shader +++ b/Studio/Content/Material Library/aluminum_brushed.shader @@ -72,6 +72,9 @@ struct texture_return // temporary declarations texture_coordinate_info tmp1; +texture_coordinate_info tmp2; +texture_coordinate_info tmp3; +texture_coordinate_info tmp4; float ftmp0; float ftmp1; float ftmp2; @@ -189,10 +192,13 @@ vec3 computeNormal() void computeTemporaries() { - tmp1 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), tiling ), textureCoordinateInfo( texCoord0, tangent, binormal ) ); - ftmp0 = fileTexture(brush_texture, vec3( 0.5, 0.5, 0.5 ), vec3( 0.5, 0.5, 0.5 ), mono_luminance, tmp1, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; - ftmp1 = fileTexture(roughness_texture_u, vec3( 0.12, 0.12, 0.12 ), vec3( ( 0.800000*brushing_strength ) ), mono_luminance, tmp1, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; - ftmp2 = fileTexture(roughness_texture_v, vec3( ( 0.150000+( 0.400000*reflection_stretch ) ) ), vec3( ( 0.100000+( reflection_stretch*0.300000 ) ) ), mono_luminance, tmp1, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; + tmp1 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_brush_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_roughness_texture_u(texCoord0), tangent, binormal ) ); + tmp4 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_roughness_texture_v(texCoord0), tangent, binormal ) ); + ftmp0 = fileTexture(brush_texture, vec3( 0.5, 0.5, 0.5 ), vec3( 0.5, 0.5, 0.5 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; + ftmp1 = fileTexture(roughness_texture_u, vec3( 0.12, 0.12, 0.12 ), vec3( ( 0.800000*brushing_strength ) ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; + ftmp2 = fileTexture(roughness_texture_v, vec3( ( 0.150000+( 0.400000*reflection_stretch ) ) ), vec3( ( 0.100000+( reflection_stretch*0.300000 ) ) ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono; tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } diff --git a/Studio/Content/Material Library/aluminum_emissive.shader b/Studio/Content/Material Library/aluminum_emissive.shader index fa5d505..15645cb 100644 --- a/Studio/Content/Material Library/aluminum_emissive.shader +++ b/Studio/Content/Material Library/aluminum_emissive.shader @@ -79,7 +79,9 @@ struct texture_return // temporary declarations texture_coordinate_info tmp1; texture_coordinate_info tmp2; -float tmp3; +texture_coordinate_info tmp3; +texture_coordinate_info tmp4; +float tmp5; float ftmp0; vec4 tmpShadowTerm; @@ -112,14 +114,15 @@ bool evalTwoSided() vec3 computeFrontMaterialEmissive() { - 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 ) ) ) ) ) ); + return intensity * emission_color.rgb * fileTexture(emissive_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_alpha, 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, 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 ) { #if QT3DS_ENABLE_CG_LIGHTING 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, tmp3, tmp3, scatter_reflect ); + layers[0].layer += tmpShadowTerm * microfacetBSDF( layers[0].tanFrame, lightDir, viewDir, lightSpecular, materialIOR, tmp5, tmp5, scatter_reflect ); #endif } @@ -128,7 +131,7 @@ void computeFrontAreaColor( in int lightIdx, in vec4 lightDiffuse, in vec4 light { #if QT3DS_ENABLE_CG_LIGHTING layers[0].base += tmpShadowTerm * vec4( 0.0, 0.0, 0.0, 1.0 ); - layers[0].layer += tmpShadowTerm * lightSpecular * sampleAreaGlossy( layers[0].tanFrame, varWorldPos, lightIdx, viewDir, tmp3, tmp3 ); + layers[0].layer += tmpShadowTerm * lightSpecular * sampleAreaGlossy( layers[0].tanFrame, varWorldPos, lightIdx, viewDir, tmp5, tmp5 ); #endif } @@ -137,11 +140,11 @@ void computeFrontLayerEnvironment( in vec3 normal, in vec3 viewDir, float aoFact { #if !QT3DS_ENABLE_LIGHT_PROBE layers[0].base += tmpShadowTerm * vec4( 0.0, 0.0, 0.0, 1.0 ); - layers[0].layer += tmpShadowTerm * microfacetSampledBSDF( layers[0].tanFrame, viewDir, tmp3, tmp3, scatter_reflect ); + layers[0].layer += tmpShadowTerm * microfacetSampledBSDF( layers[0].tanFrame, viewDir, tmp5, tmp5, scatter_reflect ); #else layers[0].base += tmpShadowTerm * vec4( 0.0, 0.0, 0.0, 1.0 ); - layers[0].layer += tmpShadowTerm * sampleGlossy( layers[0].tanFrame, viewDir, tmp3 ); + layers[0].layer += tmpShadowTerm * sampleGlossy( layers[0].tanFrame, viewDir, tmp5 ); #endif } @@ -195,10 +198,12 @@ vec3 computeNormal() void computeTemporaries() { - 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; + tmp1 = textureCoordinateInfo( texcoordTransformed_emissive_texture(texCoord0), tangent, binormal ); + tmp2 = textureCoordinateInfo( texcoordTransformed_emissive_mask_texture(texCoord0), tangent, binormal ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_roughness_texture(texCoord0), tangent, binormal ) ); + tmp4 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_reflection_texture(texCoord0), tangent, binormal ) ); + tmp5 = fileTexture(roughness_texture, vec3( roughness_map_offset ), vec3( roughness_map_scale ), mono_luminance, tmp3, 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, tmp4, vec2( 0.0, 1.0 ), vec2( 0.0, 1.0 ), wrap_repeat, wrap_repeat, gamma_default ).mono; tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } diff --git a/Studio/Content/Material Library/aluminum_textured_aniso.shader b/Studio/Content/Material Library/aluminum_textured_aniso.shader index 58679ab..49973e4 100644 --- a/Studio/Content/Material Library/aluminum_textured_aniso.shader +++ b/Studio/Content/Material Library/aluminum_textured_aniso.shader @@ -85,8 +85,9 @@ struct anisotropy_return // temporary declarations -texture_coordinate_info tmp2; texture_coordinate_info tmp4; +texture_coordinate_info tmp11; +texture_coordinate_info tmp12; texture_return tmp5; anisotropy_return tmp7; vec3 tmp8; @@ -219,12 +220,13 @@ vec3 computeNormal() void computeTemporaries() { - tmp2 = textureCoordinateInfo( texCoord0, tangent, binormal ); - tmp4 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( tiling[0], tiling[1], 1.000000 ) ), tmp2 ); + tmp4 = scaleCoordinate(vec3( tiling[0], tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_reflection_texture(texCoord0), tangent, binormal ) ); + tmp11 = scaleCoordinate(vec3( tiling[0], tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp12 = scaleCoordinate(vec3( aniso_tiling[0], aniso_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_aniso_rot_texture(texCoord0), tangent, binormal ) ); tmp5 = fileTexture(reflection_texture, vec3( reflection_map_offset ), vec3( reflection_map_scale ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ); - tmp7 = anisotropyConversion( fileTexture(reflection_texture, vec3( roughness_map_offset ), vec3( roughness_map_scale ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, anisotropy, fileTexture(aniso_rot_texture, vec3( aniso_tex_color_offset ), vec3( aniso_tex_color_scale ), mono_luminance, transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( aniso_tiling[0], aniso_tiling[1], 1.000000 ) ), tmp2 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono, tangent, false ); + tmp7 = anisotropyConversion( fileTexture(reflection_texture, vec3( roughness_map_offset ), vec3( roughness_map_scale ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, anisotropy, fileTexture(aniso_rot_texture, vec3( aniso_tex_color_offset ), vec3( aniso_tex_color_scale ), mono_luminance, tmp12, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_default ).mono, tangent, false ); tmp8 = tmp5.tint; - tmp10 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + tmp10 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp11, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); ftmp0 = tmp7.roughness_u; ftmp1 = tmp7.roughness_v; ftmp2 = tmp7.tangent_u; diff --git a/Studio/Content/Material Library/asphalt.shader b/Studio/Content/Material Library/asphalt.shader index aa21338..e4ee412 100644 --- a/Studio/Content/Material Library/asphalt.shader +++ b/Studio/Content/Material Library/asphalt.shader @@ -70,6 +70,8 @@ struct texture_return // temporary declarations texture_coordinate_info tmp2; +texture_coordinate_info tmp3; +texture_coordinate_info tmp4; vec3 tmp5; vec3 ftmp0; vec3 ftmp1; @@ -197,10 +199,12 @@ vec3 computeNormal() void computeTemporaries() { - tmp2 = 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 ) ); + tmp2 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_reflect_texture(texCoord0), tangent, binormal ) ); + tmp4 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); tmp5 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; + ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } diff --git a/Studio/Content/Material Library/bamboo_natural_matte.shader b/Studio/Content/Material Library/bamboo_natural_matte.shader index 334ab50..aefadcd 100644 --- a/Studio/Content/Material Library/bamboo_natural_matte.shader +++ b/Studio/Content/Material Library/bamboo_natural_matte.shader @@ -70,6 +70,8 @@ struct texture_return // temporary declarations texture_coordinate_info tmp2; +texture_coordinate_info tmp3; +texture_coordinate_info tmp4; vec3 tmp5; vec3 ftmp0; vec3 ftmp1; @@ -197,11 +199,13 @@ vec3 computeNormal() void computeTemporaries() { - tmp2 = 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 ) ); - tmp5 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + tmp2 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_reflect_texture(texCoord0), tangent, binormal ) ); + tmp4 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp5 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/bamboo_natural_matte_emissive.shader b/Studio/Content/Material Library/bamboo_natural_matte_emissive.shader index 6fe274b..2ffae65 100644 --- a/Studio/Content/Material Library/bamboo_natural_matte_emissive.shader +++ b/Studio/Content/Material Library/bamboo_natural_matte_emissive.shader @@ -75,6 +75,8 @@ struct texture_return // temporary declarations texture_coordinate_info tmp2; texture_coordinate_info tmp3; +texture_coordinate_info tmp4; +texture_coordinate_info tmp5; vec3 tmp6; vec3 ftmp0; vec3 ftmp1; @@ -111,7 +113,7 @@ bool evalTwoSided() vec3 computeFrontMaterialEmissive() { - 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 ) ) ) ) ); + return intensity * emission_color.rgb * fileTexture(emissive_texture, vec3(0.0), vec3(1.0), mono_alpha, 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) @@ -202,12 +204,15 @@ vec3 computeNormal() void computeTemporaries() { - tmp2 = textureCoordinateInfo( texCoord0, tangent, binormal ); - tmp3 = 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 ) ), tmp2 ); - tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.0); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_emissive_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp4 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_reflect_texture(texCoord0), tangent, binormal ) ); + tmp4 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp5, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/carbon_fiber.shader b/Studio/Content/Material Library/carbon_fiber.shader index e4817d4..c1d5e74 100644 --- a/Studio/Content/Material Library/carbon_fiber.shader +++ b/Studio/Content/Material Library/carbon_fiber.shader @@ -83,6 +83,9 @@ struct texture_return // temporary declarations +texture_coordinate_info tmp0; +texture_coordinate_info tmp1; +texture_coordinate_info tmp2; texture_coordinate_info tmp3; anisotropy_return tmp4; vec3 tmp6; @@ -224,15 +227,19 @@ vec3 computeNormal() void computeTemporaries() { - tmp3 = 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 ) ); - tmp4 = anisotropyConversion( base_roughness, anisotropy, fileTexture(anisotropy_rotation_texture, vec3( 0, 0, 0 ), vec3( 3.14, 3.14, 3.14 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, tangent, false ); - tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - ftmp0 = tmp4.roughness_u; - ftmp1 = tmp4.roughness_v; - ftmp2 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp3 = tmp4.tangent_u; - ftmp4 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.0); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_reflect_texture(texCoord0), tangent, binormal ) ); + tmp1 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp0 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_anisotropy_rotation_texture(texCoord0), tangent, binormal ) ); + tmp4 = anisotropyConversion( base_roughness, anisotropy, fileTexture(anisotropy_rotation_texture, vec3( 0, 0, 0 ), vec3( 3.14, 3.14, 3.14 ), mono_luminance, tmp0, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, tangent, false ); + tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + ftmp0 = tmp4.roughness_u; + ftmp1 = tmp4.roughness_v; + ftmp2 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp3 = tmp4.tangent_u; + ftmp4 = fileTexture(diffuse_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_srgb ).tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/carbon_fiber_emissive.shader b/Studio/Content/Material Library/carbon_fiber_emissive.shader index c65f259..b5e1a03 100644 --- a/Studio/Content/Material Library/carbon_fiber_emissive.shader +++ b/Studio/Content/Material Library/carbon_fiber_emissive.shader @@ -20,7 +20,6 @@ - @@ -87,6 +86,7 @@ struct texture_return // temporary declarations +texture_coordinate_info tmp2; texture_coordinate_info tmp3; texture_coordinate_info tmp4; anisotropy_return tmp5; @@ -130,7 +130,7 @@ bool evalTwoSided() vec3 computeFrontMaterialEmissive() { - 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 ) ) ) ) ); + return intensity * emission_color.rgb * fileTexture(emissive_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_alpha, tmp4, 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 ) @@ -229,16 +229,18 @@ vec3 computeNormal() void computeTemporaries() { - tmp3 = textureCoordinateInfo( texCoord0, tangent, binormal ); - tmp4 = 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 ) ), tmp3 ); - tmp5 = anisotropyConversion( base_roughness, anisotropy, fileTexture(anisotropy_rotation_texture, vec3( 0, 0, 0 ), vec3( 3.14, 3.14, 3.14 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, tangent, false ); - tmp7 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - ftmp0 = tmp5.roughness_u; - ftmp1 = tmp5.roughness_v; - ftmp2 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp3 = tmp5.tangent_u; - ftmp4 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.000000 ); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_emissive_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp4 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_anisotropy_rotation_texture(texCoord0), tangent, binormal ) ); + tmp5 = anisotropyConversion( base_roughness, anisotropy, fileTexture(anisotropy_rotation_texture, vec3( 0, 0, 0 ), vec3( 3.14, 3.14, 3.14 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, tangent, false ); + tmp7 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + ftmp0 = tmp5.roughness_u; + ftmp1 = tmp5.roughness_v; + ftmp2 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp3 = tmp5.tangent_u; + ftmp4 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/concrete.shader b/Studio/Content/Material Library/concrete.shader index cabf1d2..7d215cf 100644 --- a/Studio/Content/Material Library/concrete.shader +++ b/Studio/Content/Material Library/concrete.shader @@ -68,6 +68,7 @@ struct texture_return // temporary declarations +texture_coordinate_info tmp2; texture_coordinate_info tmp3; vec3 tmp6; vec3 ftmp0; @@ -196,11 +197,13 @@ vec3 computeNormal() void computeTemporaries() { - tmp3 = 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 ) ); - tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - ftmp0 = fileTexture(bump_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.0); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + ftmp0 = fileTexture(bump_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/leather_smoothed_black.shader b/Studio/Content/Material Library/leather_smoothed_black.shader index 05036e4..e5d876a 100644 --- a/Studio/Content/Material Library/leather_smoothed_black.shader +++ b/Studio/Content/Material Library/leather_smoothed_black.shader @@ -70,6 +70,8 @@ struct texture_return // temporary declarations texture_coordinate_info tmp2; +texture_coordinate_info tmp3; +texture_coordinate_info tmp4; vec3 tmp5; vec3 ftmp0; vec3 ftmp1; @@ -197,10 +199,13 @@ vec3 computeNormal() void computeTemporaries() { - tmp2 = 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 ) ); - tmp5 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.0); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp4 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_reflect_texture(texCoord0), tangent, binormal ) ); + tmp5 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp4, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } diff --git a/Studio/Content/Material Library/mesh_fence.shader b/Studio/Content/Material Library/mesh_fence.shader index 3ed0943..5565fd2 100644 --- a/Studio/Content/Material Library/mesh_fence.shader +++ b/Studio/Content/Material Library/mesh_fence.shader @@ -69,6 +69,7 @@ struct layer_result // temporary declarations +texture_coordinate_info tmp2; texture_coordinate_info tmp3; texture_return tmp4; vec3 tmp5; @@ -197,11 +198,13 @@ vec3 computeNormal() void computeTemporaries() { - tmp3 = 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 ) ); - tmp4 = fileTexture(diffuse_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_srgb ); - tmp5 = tangentSpaceNormalTexture( bump_texture, bump_amount, false, false, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat ); - ftmp0 = tmp4.tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.0); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp4 = fileTexture(diffuse_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_srgb ); + tmp5 = tangentSpaceNormalTexture( bump_texture, bump_amount, false, false, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat ); + ftmp0 = tmp4.tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/metal_mesh_fine.shader b/Studio/Content/Material Library/metal_mesh_fine.shader index 21441f0..b60b1a6 100644 --- a/Studio/Content/Material Library/metal_mesh_fine.shader +++ b/Studio/Content/Material Library/metal_mesh_fine.shader @@ -69,7 +69,9 @@ struct layer_result // temporary declarations +texture_coordinate_info tmp1; texture_coordinate_info tmp2; +texture_coordinate_info tmp3; vec3 tmp4; vec3 tmp6; vec4 tmpShadowTerm; @@ -186,7 +188,7 @@ float computeIOR() float evalCutout() { - return( fileTexture(cutout_opacity_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono ); + return( fileTexture(cutout_opacity_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_linear ).mono ); } vec3 computeNormal() @@ -196,10 +198,13 @@ vec3 computeNormal() void computeTemporaries() { - tmp2 = 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 ) ); - tmp4 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; - tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.0); + tmp1 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_cutout_opacity_texture(texCoord0), tangent, binormal ) ); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp4 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; + tmp6 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/paper_artistic.shader b/Studio/Content/Material Library/paper_artistic.shader index 38c1548..6c5c156 100644 --- a/Studio/Content/Material Library/paper_artistic.shader +++ b/Studio/Content/Material Library/paper_artistic.shader @@ -89,7 +89,9 @@ struct layer_result // temporary declarations +texture_coordinate_info tmp0; texture_coordinate_info tmp1; +texture_coordinate_info tmp3; vec3 tmp2; vec3 ftmp0; vec4 tmpShadowTerm; @@ -210,15 +212,18 @@ float evalCutout() vec3 computeNormal() { - return( tangentSpaceNormalTexture( bump_texture, bump_amount, false, false, tmp1, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat ) ); + return( tangentSpaceNormalTexture( bump_texture, bump_amount, false, false, tmp0, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat ) ); } 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 ) ); - tmp2 = fileTexture(diffuse_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_srgb ).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_linear ).tint, 1.000000, color_layer_blend ) ), tmp2, mono_average ).tint, 1.000000, color_layer_multiply ) ), vec3( 1, 1, 1 ), mono_average ).tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.0); + tmp0 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ); + tmp1 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_transmission_texture(texCoord0), tangent, binormal ) ); + tmp2 = fileTexture(diffuse_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_srgb ).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, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint, 1.000000, color_layer_blend ) ), tmp2, mono_average ).tint, 1.000000, color_layer_multiply ) ), vec3( 1, 1, 1 ), mono_average ).tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/paper_office.shader b/Studio/Content/Material Library/paper_office.shader index 5be6c7e..ec27c16 100644 --- a/Studio/Content/Material Library/paper_office.shader +++ b/Studio/Content/Material Library/paper_office.shader @@ -90,6 +90,7 @@ struct layer_result // temporary declarations texture_coordinate_info tmp1; +texture_coordinate_info tmp2; vec3 ftmp0; vec4 tmpShadowTerm; @@ -209,14 +210,16 @@ float evalCutout() vec3 computeNormal() { - return( fileBumpTexture(bump_texture, bump_amount, mono_average, tmp1, 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.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ) ); } 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.rgb, mono_average ).tint, 1.000000, color_layer_multiply ) ), vec3( 1, 1, 1 ), mono_average ).tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.0); + tmp1 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_transmission_texture(texCoord0), tangent, binormal ) ); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(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.rgb, mono_average ).tint, 1.000000, color_layer_multiply ) ), vec3( 1, 1, 1 ), mono_average ).tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/plastic_structured_red.shader b/Studio/Content/Material Library/plastic_structured_red.shader index 2aab2c4..9710d75 100644 --- a/Studio/Content/Material Library/plastic_structured_red.shader +++ b/Studio/Content/Material Library/plastic_structured_red.shader @@ -168,7 +168,7 @@ float evalCutout() vec3 computeNormal() { - return( perlinNoiseBumpTexture( transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( ( texture_scaling*10.000000 ) ) ), coordinateSource(texture_coordinate_object, 0 ) ), bump_factor, 1.000000, false, false, 0.000000, 6, true, vec3( 0.000000, 0.000000, 0.000000 ), 0.070000, 0.300000, 1.000000, normal ) ); + return( perlinNoiseBumpTexture( scaleCoordinate(vec3(texture_scaling*10.000000), coordinateSource(texture_coordinate_object, 0 ) ), bump_factor, 1.000000, false, false, 0.000000, 6, true, vec3( 0.000000, 0.000000, 0.000000 ), 0.070000, 0.300000, 1.000000, normal ) ); } void computeTemporaries() diff --git a/Studio/Content/Material Library/plastic_structured_red_emissive.shader b/Studio/Content/Material Library/plastic_structured_red_emissive.shader index 28708b5..ed2d7bb 100644 --- a/Studio/Content/Material Library/plastic_structured_red_emissive.shader +++ b/Studio/Content/Material Library/plastic_structured_red_emissive.shader @@ -78,6 +78,8 @@ struct texture_return // temporary declarations +texture_coordinate_info tmp1; +texture_coordinate_info tmp2; vec4 tmpShadowTerm; layer_result layers[1]; @@ -114,7 +116,8 @@ bool evalTwoSided() vec3 computeFrontMaterialEmissive() { - 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 ) ) ) ) ); + return intensity * emission_color.rgb * fileTexture(emissive_texture, vec3(0.0), vec3(1.0), mono_alpha, 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), vec3(1.0), mono_alpha, 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 ) @@ -192,12 +195,14 @@ float evalCutout() vec3 computeNormal() { - return( perlinNoiseBumpTexture( transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( ( texture_scaling*10.000000 ) ) ), coordinateSource(texture_coordinate_object, 0 ) ), bump_factor, 1.000000, false, false, 0.000000, 6, true, vec3( 0.000000, 0.000000, 0.000000 ), 0.070000, 0.300000, 1.000000, normal ) ); + return( perlinNoiseBumpTexture( scaleCoordinate( vec3(texture_scaling*10.000000), coordinateSource(texture_coordinate_object, 0 ) ), bump_factor, 1.000000, false, false, 0.000000, 6, true, vec3( 0.000000, 0.000000, 0.000000 ), 0.070000, 0.300000, 1.000000, normal ) ); } void computeTemporaries() { - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + tmp1 = textureCoordinateInfo( texcoordTransformed_emissive_texture(texCoord0), tangent, binormal ); + tmp2 = textureCoordinateInfo( texcoordTransformed_emissive_mask_texture(texCoord0), tangent, binormal ); + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/powder_coat.shader b/Studio/Content/Material Library/powder_coat.shader index 3456639..7113d38 100644 --- a/Studio/Content/Material Library/powder_coat.shader +++ b/Studio/Content/Material Library/powder_coat.shader @@ -180,7 +180,7 @@ float evalCutout() vec3 computeNormal() { - return( fileBumpTexture(powdercoat_bump_texture, bump_factor, mono_average, transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), texture_scaling ), textureCoordinateInfo( texCoord0, tangent, binormal ) ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ) ); + return( fileBumpTexture(powdercoat_bump_texture, bump_factor, mono_average, scaleCoordinate(texture_scaling, textureCoordinateInfo( texcoordTransformed_powdercoat_bump_texture(texCoord0), tangent, binormal ) ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ) ); } void computeTemporaries() diff --git a/Studio/Content/Material Library/powder_coat_emissive.shader b/Studio/Content/Material Library/powder_coat_emissive.shader index 88ccb6f..21f58a7 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.rgb ) * intensity ) ) ) ); + return intensity * emission_color.rgb * 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; } void computeFrontLayerColor( in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 lightDiffuse, in vec3 lightSpecular, in float materialIOR, float aoFactor ) @@ -214,12 +214,12 @@ float evalCutout() vec3 computeNormal() { - return( fileBumpTexture(powdercoat_bump_texture, bump_factor, mono_average, transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), texture_scaling ), tmp3 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ) ); + return( fileBumpTexture(powdercoat_bump_texture, bump_factor, mono_average, scaleCoordinate(texture_scaling, textureCoordinateInfo(texcoordTransformed_powdercoat_bump_texture(texCoord0), tangent, binormal )), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ) ); } void computeTemporaries() { - tmp3 = textureCoordinateInfo( texCoord0, tangent, binormal ); + tmp3 = textureCoordinateInfo( texcoordTransformed_emissive_texture(texCoord0), tangent, binormal ); ftmp0 = vec3( reflectivity ); tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } diff --git a/Studio/Content/Material Library/rubber_studded_black.shader b/Studio/Content/Material Library/rubber_studded_black.shader index e98c5f9..e8f5560 100644 --- a/Studio/Content/Material Library/rubber_studded_black.shader +++ b/Studio/Content/Material Library/rubber_studded_black.shader @@ -183,7 +183,7 @@ 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 ); + tmp4 = fileBumpTexture(bump_texture, bump_amount, mono_average, scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal ) ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } diff --git a/Studio/Content/Material Library/rubber_studded_emissive.shader b/Studio/Content/Material Library/rubber_studded_emissive.shader index c031554..5dfc75a 100644 --- a/Studio/Content/Material Library/rubber_studded_emissive.shader +++ b/Studio/Content/Material Library/rubber_studded_emissive.shader @@ -73,9 +73,10 @@ struct texture_return // temporary declarations +texture_coordinate_info tmp1; +texture_coordinate_info tmp2; texture_coordinate_info tmp3; vec3 tmp5; -texture_coordinate_info tmp6; vec4 tmpShadowTerm; layer_result layers[2]; @@ -109,7 +110,8 @@ bool evalTwoSided() vec3 computeFrontMaterialEmissive() { - 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 ) ) ) ) ) ); + return intensity * emission_color.rgb * fileTexture(emissive_texture, vec3(0.0), vec3(1.0), mono_alpha, 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), vec3(1.0), mono_alpha, 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 ) @@ -200,10 +202,12 @@ vec3 computeNormal() void computeTemporaries() { - tmp3 = textureCoordinateInfo( texCoord0, tangent, binormal ); - tmp5 = 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 ) ), tmp3 ), vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - tmp6 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), vec3( 1.000000, 1.000000, 1.000000 ) ), tmp3 ); - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + vec3 tiling = vec3( texture_tiling[0], texture_tiling[1], 1.000000 ); + tmp1 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_emissive_texture(texCoord0), tangent, binormal )); + tmp2 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_emissive_mask_texture(texCoord0), tangent, binormal )); + tmp3 = scaleCoordinate(tiling, textureCoordinateInfo( texcoordTransformed_bump_texture(texCoord0), tangent, binormal )); + tmp5 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/steel_milled_concentric.shader b/Studio/Content/Material Library/steel_milled_concentric.shader index 9e73f5e..4cad29e 100644 --- a/Studio/Content/Material Library/steel_milled_concentric.shader +++ b/Studio/Content/Material Library/steel_milled_concentric.shader @@ -75,6 +75,8 @@ struct texture_return // temporary declarations +texture_coordinate_info tmp1; +texture_coordinate_info tmp2; texture_coordinate_info tmp3; texture_return tmp4; anisotropy_return tmp5; @@ -198,15 +200,16 @@ vec3 computeNormal() void computeTemporaries() { - tmp3 = 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 ) ); - tmp4 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ); - tmp5 = anisotropyConversion( tmp4.mono, anisotropy, fileTexture(anisotropy_rot_texture, vec3( -1, -1, -1 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, tangent, false ); - ftmp0 = tmp5.roughness_u; - ftmp1 = tmp5.roughness_v; - ftmp2 = fileTexture(diffuse_texture, vec3( 1, 1, 1 ), vec3( -1, -1, -1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp3 = tmp5.tangent_u; - ftmp4 = tmp4.tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + tmp2 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_anisotropy_rot_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp4 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ); + tmp5 = anisotropyConversion( tmp4.mono, anisotropy, fileTexture(anisotropy_rot_texture, vec3( -1, -1, -1 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).mono, tangent, false ); + ftmp0 = tmp5.roughness_u; + ftmp1 = tmp5.roughness_v; + ftmp2 = fileTexture(diffuse_texture, vec3( 1, 1, 1 ), vec3( -1, -1, -1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp3 = tmp5.tangent_u; + ftmp4 = tmp4.tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/thin_glass_frosted.shader b/Studio/Content/Material Library/thin_glass_frosted.shader index cd140b7..63b0c4e 100644 --- a/Studio/Content/Material Library/thin_glass_frosted.shader +++ b/Studio/Content/Material Library/thin_glass_frosted.shader @@ -212,10 +212,8 @@ vec3 computeNormal() void computeTemporaries() { - //tmp0 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), refractCoords ), coordinateSource(texture_coordinate_world, 0 ) ); - //ftmp1 = perlinNoiseBumpTexture( tmp0, refractScale, 1.000000, false, false, 0.000000, 1, false, vec3( 0.000000, 0.000000, 0.000000 ), 1.0, 0.5, 1.000000, viewDir ); - tmp0 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), bumpCoords ), textureCoordinateInfo( texCoord0, tangent, binormal ) ); - tmp1 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), bumpCoords ), coordinateSource(texture_coordinate_world, 0 ) ); + tmp0 = scaleCoordinate(bumpCoords, textureCoordinateInfo( texcoordTransformed_glass_bump(texCoord0), tangent, binormal )); + tmp1 = scaleCoordinate(bumpCoords, coordinateSource(texture_coordinate_world, 0 )); ftmp1 = viewDir; ftmp0 = vec3( reflectivity_amount ); tmpShadowTerm = evalBakedShadowMap( texCoord0 ); diff --git a/Studio/Content/Material Library/thin_glass_frosted_sp.shader b/Studio/Content/Material Library/thin_glass_frosted_sp.shader index 38dbac2..8e4547a 100644 --- a/Studio/Content/Material Library/thin_glass_frosted_sp.shader +++ b/Studio/Content/Material Library/thin_glass_frosted_sp.shader @@ -190,10 +190,10 @@ vec3 computeNormal() void computeTemporaries() { - tmp0 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), noiseCoords ), coordinateSource(texture_coordinate_world, 0 ) ); - tmp1 = transformCoordinate( rotationTranslationScale( vec3( 0.000000, 0.000000, 0.000000 ), vec3( 0.000000, 0.000000, 0.000000 ), bumpCoords ), coordinateSource(texture_coordinate_world, 0 ) ); - ftmp0 = vec3( reflectivity_amount ); - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + tmp0 = scaleCoordinate(noiseCoords, coordinateSource(texture_coordinate_world, 0 ) ); + tmp1 = scaleCoordinate(bumpCoords, coordinateSource(texture_coordinate_world, 0 ) ); + ftmp0 = vec3( reflectivity_amount ); + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/Studio/Content/Material Library/walnut_matte.shader b/Studio/Content/Material Library/walnut_matte.shader index 5b1c48b..e3b3ac4 100644 --- a/Studio/Content/Material Library/walnut_matte.shader +++ b/Studio/Content/Material Library/walnut_matte.shader @@ -70,6 +70,7 @@ struct texture_return // temporary declarations texture_coordinate_info tmp2; +texture_coordinate_info tmp3; vec3 tmp5; vec3 ftmp0; vec3 ftmp1; @@ -197,11 +198,12 @@ vec3 computeNormal() void computeTemporaries() { - tmp2 = 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 ) ); - tmp5 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); - ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; - ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; - tmpShadowTerm = evalBakedShadowMap( texCoord0 ); + tmp2 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_reflect_texture(texCoord0), tangent, binormal ) ); + tmp3 = scaleCoordinate(vec3( texture_tiling[0], texture_tiling[1], 1.000000 ), textureCoordinateInfo( texcoordTransformed_diffuse_texture(texCoord0), tangent, binormal ) ); + tmp5 = fileBumpTexture(bump_texture, bump_amount, mono_average, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, normal ); + ftmp0 = fileTexture(reflect_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp2, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_linear ).tint; + ftmp1 = fileTexture(diffuse_texture, vec3( 0, 0, 0 ), vec3( 1, 1, 1 ), mono_luminance, tmp3, vec2( 0.000000, 1.000000 ), vec2( 0.000000, 1.000000 ), wrap_repeat, wrap_repeat, gamma_srgb ).tint; + tmpShadowTerm = evalBakedShadowMap( texCoord0 ); } vec4 computeLayerWeights( in float alpha ) diff --git a/res/effectlib/customMaterial.glsllib b/res/effectlib/customMaterial.glsllib index 83756ec..9f7ae77 100644 --- a/res/effectlib/customMaterial.glsllib +++ b/res/effectlib/customMaterial.glsllib @@ -31,23 +31,19 @@ #ifndef CUSTOM_MATERIAL_GLSLLIB #define CUSTOM_MATERIAL_GLSLLIB 1 -vec4 getTransformedSample(sampler2D sampler, vec2 coord, vec3 transformU, vec3 transformV) -{ - const vec3 coord3 = vec3(coord, 1.0); - return texture(sampler, vec2(dot(transformU, coord3), dot(transformV, coord3))); -} - #define SNAPPER_SAMPLER2D(samplerName, samplerNiceName, texFilter, texWrap, showUI ) \ uniform sampler2D samplerName; \ uniform vec3 samplerName##TransformU; \ uniform vec3 samplerName##TransformV; \ - vec4 samplerName##Transformed(vec2 coord) \ + vec3 texcoordTransformed_##samplerName(vec3 coord) \ + { \ + return vec3(dot(samplerName##TransformU, coord), dot(samplerName##TransformV, coord), coord.z); \ + } \ + vec4 sampleTransformed_##samplerName(vec3 coord) \ { \ - return getTransformedSample(samplerName, coord, samplerName##TransformU, samplerName##TransformV); \ + return texture(samplerName, texcoordTransformed_##samplerName(coord).xy); \ } - - // some useful defines #ifndef PI #define PI 3.14159265358979 diff --git a/res/effectlib/evalBakedShadowMap.glsllib b/res/effectlib/evalBakedShadowMap.glsllib index a283d8a..7ea3887 100644 --- a/res/effectlib/evalBakedShadowMap.glsllib +++ b/res/effectlib/evalBakedShadowMap.glsllib @@ -30,7 +30,7 @@ vec4 evalBakedShadowMap( in vec3 inCoords ) { - vec4 shadowCol = (uShadowMappingEnabled) ? texture( uBakedShadowTexture, inCoords.xy ) : vec4( 1.0, 1.0, 1.0, 1.0 ); + vec4 shadowCol = (uShadowMappingEnabled) ? texture( uBakedShadowTexture, texcoordTransformed_uBakedShadowTexture(inCoords).xy ) : vec4( 1.0, 1.0, 1.0, 1.0 ); return shadowCol; } diff --git a/res/effectlib/transformCoordinate.glsllib b/res/effectlib/transformCoordinate.glsllib index ccdf7d0..cbe20e7 100644 --- a/res/effectlib/transformCoordinate.glsllib +++ b/res/effectlib/transformCoordinate.glsllib @@ -40,4 +40,13 @@ texture_coordinate_info transformCoordinate( in mat4 transform, in texture_coord return( tci ); } +texture_coordinate_info scaleCoordinate(in vec3 scale, in texture_coordinate_info coordinate) +{ + texture_coordinate_info tci; + tci.position = scale * coordinate.position; + tci.tangent_u = scale * coordinate.tangent_u; + tci.tangent_v = scale * coordinate.tangent_v; + return tci; +} + #endif -- cgit v1.2.3