summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2022-10-31 09:42:27 -0700
committerCosmic Linden <cosmic@lindenlab.com>2022-11-02 12:55:18 -0700
commit9e7b725c15ea0bfea5246eb81dd7a100b7ac5b6b (patch)
treebbc065c955992f45933c0f9d83d61761121d589f /indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
parentd042ad67ed4db72bf0265804e26610e565f15cf2 (diff)
SL-18485: Render GLTF materials with extension KHR_texture_transform with approprate texture transforms
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl30
1 files changed, 14 insertions, 16 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
index 7376e9eb47..39419e9d78 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
@@ -36,15 +36,16 @@ uniform sampler2D specularMap; // Packed: Occlusion, Metal, Roughness
out vec4 frag_data[4];
-VARYING vec3 vary_position;
-VARYING vec4 vertex_color;
-VARYING vec3 vary_normal;
-VARYING vec3 vary_tangent;
+in vec3 vary_position;
+in vec4 vertex_color;
+in vec3 vary_normal;
+in vec3 vary_tangent;
flat in float vary_sign;
-VARYING vec2 vary_texcoord0;
-VARYING vec2 vary_texcoord1;
-VARYING vec2 vary_texcoord2;
+in vec2 basecolor_texcoord;
+in vec2 normal_texcoord;
+in vec2 metallic_roughness_texcoord;
+in vec2 emissive_texcoord;
uniform float minimum_alpha; // PBR alphaMode: MASK, See: mAlphaCutoff, setAlphaCutoff()
@@ -56,19 +57,16 @@ uniform mat3 normal_matrix;
void main()
{
-// IF .mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
-// vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb;
-// else
- vec4 albedo = texture2D(diffuseMap, vary_texcoord0.xy).rgba;
- if (albedo.a < minimum_alpha)
+ vec4 basecolor = texture2D(diffuseMap, basecolor_texcoord.xy).rgba;
+ if (basecolor.a < minimum_alpha)
{
discard;
}
- vec3 col = vertex_color.rgb * srgb_to_linear(albedo.rgb);
+ vec3 col = vertex_color.rgb * srgb_to_linear(basecolor.rgb);
// from mikktspace.com
- vec3 vNt = texture2D(bumpMap, vary_texcoord1.xy).xyz*2.0-1.0;
+ vec3 vNt = texture2D(bumpMap, normal_texcoord.xy).xyz*2.0-1.0;
float sign = vary_sign;
vec3 vN = vary_normal;
vec3 vT = vary_tangent.xyz;
@@ -81,13 +79,13 @@ void main()
// occlusion 1.0
// roughness 0.0
// metal 0.0
- vec3 spec = texture2D(specularMap, vary_texcoord2.xy).rgb;
+ vec3 spec = texture2D(specularMap, metallic_roughness_texcoord.xy).rgb;
spec.g *= roughnessFactor;
spec.b *= metallicFactor;
vec3 emissive = emissiveColor;
- emissive *= srgb_to_linear(texture2D(emissiveMap, vary_texcoord0.xy).rgb);
+ emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
tnorm *= gl_FrontFacing ? 1.0 : -1.0;