diff options
Diffstat (limited to 'Studio/Content/Material Library/paper_artistic.shader')
-rw-r--r-- | Studio/Content/Material Library/paper_artistic.shader | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Studio/Content/Material Library/paper_artistic.shader b/Studio/Content/Material Library/paper_artistic.shader index 6c7b075..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; @@ -126,7 +128,7 @@ vec3 computeFrontMaterialEmissive() 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 * normalizedMix( bsdf_component[2]( bsdf_component(transmission_weight, diffuseTransmissionBSDF( -normal, lightDir, viewDir, lightDiffuse, vec4( ftmp0, 1.0), uTranslucentFalloff, uDiffuseLightWrap )) ,bsdf_component(reflection_weight, diffuseReflectionBSDF( normal, lightDir, viewDir, lightDiffuse, 0.000000 )) ) ); + layers[0].base += tmpShadowTerm * normalizedMix( bsdf_component[2]( bsdf_component(transmission_weight, diffuseTransmissionBSDF( -normal, lightDir, viewDir, lightDiffuse, vec4( ftmp0, 1.0), uTranslucentFalloff, uDiffuseLightWrap )) ,bsdf_component(reflection_weight, diffuseReflectionBSDF( normal, lightDir, lightDiffuse )) ) ); #endif } @@ -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 ) |