diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-07-17 15:06:23 -0700 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-07-17 15:06:23 -0700 |
commit | 040050af19ff7b5b2f5dc5ce5c4b68cfbb7e492a (patch) | |
tree | fcde4fb3af978615315f83204e6d7351f3b5f02c /indra/newview/app_settings/shaders/class1/objects/previewV.glsl | |
parent | f7f9601567ce089f3335407f1d3c7d32dbb18c60 (diff) | |
parent | f975cfd7361729195f2bb14d874e5eacc6140759 (diff) |
Merge branch 'DRTVWR-559' into DRTVWR-583
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/objects/previewV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/objects/previewV.glsl | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index b474a5803f..f51b0f4d9e 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -25,7 +25,6 @@ uniform mat3 normal_matrix; uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; in vec3 position; @@ -54,14 +53,27 @@ float calcDirectionalLight(vec3 n, vec3 l) //==================================================================================================== +#ifdef HAS_SKIN +mat4 getObjectSkinnedTransform(); +uniform mat4 modelview_matrix; +uniform mat4 projection_matrix; +#endif + void main() { - //transform vertex - vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vec3 norm; +#ifdef HAS_SKIN + mat4 mat = getObjectSkinnedTransform(); + mat = modelview_matrix * mat; + vec4 pos = mat * vec4(position.xyz, 1.0); + gl_Position = projection_matrix * pos; + norm = normalize((mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz); +#else + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + norm = normalize(normal_matrix * normal); +#endif + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - - vec3 norm = normalize(normal_matrix * normal); vec4 col = vec4(0,0,0,1); |