diff options
author | Nicky <nicky.dasmijn@posteo.nl> | 2022-06-05 14:27:28 +0200 |
---|---|---|
committer | Nicky <nicky.dasmijn@posteo.nl> | 2022-06-05 14:27:28 +0200 |
commit | 95d5938eefa26f4814154219315db50aa511fc4f (patch) | |
tree | f4b964ee1723645d6a43668cb59b988d56523ac9 /indra/newview/app_settings/shaders/class1/objects/simpleV.glsl | |
parent | 6b0427dbc2e88271f7704a6c65f2bc2ea11a5928 (diff) | |
parent | 027dbc2ccfe3a94db10fc1f85f7c0ee58c4eed4f (diff) |
Merge remote-tracking branch 'origin/DRTVWR-543-maint_cmake' into DRTVWR-543-maint_cmake
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/objects/simpleV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/objects/simpleV.glsl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index 9ef7704b70..2025174f7d 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -44,12 +44,16 @@ void calcAtmospherics(vec3 inPositionEye); VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; +#ifdef HAS_SKIN +mat4 getObjectSkinnedTransform(); +uniform mat4 projection_matrix; +#endif + void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; @@ -58,11 +62,23 @@ void main() if (no_atmo == 1) { vertex_color = diffuse_color; + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); } else { +#ifdef HAS_SKIN + mat4 mat = getObjectSkinnedTransform(); + mat = modelview_matrix * mat; + + vec4 pos = mat * vert; + vec3 norm = normalize((mat*vec4(normal.xyz+vert.xyz,1.0)).xyz-pos.xyz); + + gl_Position = projection_matrix * pos; +#else vec4 pos = (modelview_matrix * vert); vec3 norm = normalize(normal_matrix * normal); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); +#endif calcAtmospherics(pos.xyz); |