diff options
author | Sabrina Shanman <cosmic@lindenlab.com> | 2022-11-02 20:10:04 +0000 |
---|---|---|
committer | Sabrina Shanman <cosmic@lindenlab.com> | 2022-11-02 20:10:04 +0000 |
commit | 81011a318e7cd1e4ef5bfb1f2cc52274c7d78b8a (patch) | |
tree | 22f022676dd453143d3758c52572228f71782f42 /indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl | |
parent | 106b1a6e6add67f7770d508d8be1d0eff77ebd32 (diff) | |
parent | 9e7b725c15ea0bfea5246eb81dd7a100b7ac5b6b (diff) |
Merged in SL-18485 (pull request #1183)
SL-18485: Render GLTF materials with extension KHR_texture_transform with approprate texture transforms
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl index 5573c02a60..25bf19b4ec 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl @@ -37,25 +37,27 @@ uniform mat3 normal_matrix; uniform mat4 modelview_projection_matrix; #endif -uniform mat4 texture_matrix0; +uniform mat3 texture_basecolor_matrix; +uniform mat3 texture_normal_matrix; +uniform mat3 texture_metallic_roughness_matrix; +uniform mat3 texture_emissive_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 tangent; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec2 texcoord1; -ATTRIBUTE vec2 texcoord2; +in vec3 position; +in vec4 diffuse_color; +in vec3 normal; +in vec4 tangent; +in vec2 texcoord0; -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; -VARYING vec2 vary_texcoord2; +out vec2 basecolor_texcoord; +out vec2 normal_texcoord; +out vec2 metallic_roughness_texcoord; +out vec2 emissive_texcoord; -VARYING vec4 vertex_color; +out vec4 vertex_color; -VARYING vec3 vary_tangent; +out vec3 vary_tangent; flat out float vary_sign; -VARYING vec3 vary_normal; +out vec3 vary_normal; void main() { @@ -73,9 +75,11 @@ void main() gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); #endif - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy; - vary_texcoord2 = (texture_matrix0 * vec4(texcoord2,0,1)).xy; + basecolor_texcoord = (texture_basecolor_matrix * vec3(texcoord0,1)).xy; + normal_texcoord = (texture_normal_matrix * vec3(texcoord0,1)).xy; + metallic_roughness_texcoord = (texture_metallic_roughness_matrix * vec3(texcoord0,1)).xy; + emissive_texcoord = (texture_emissive_matrix * vec3(texcoord0,1)).xy; + #ifdef HAS_SKIN vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz; vec3 t = (mat*vec4(tangent.xyz+position.xyz,1.0)).xyz-pos.xyz; |