Skip to content
Snippets Groups Projects
Commit 9a024172 authored by David Parks's avatar David Parks
Browse files

Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559

parents 36f37ebf 4478decb
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -43,26 +43,16 @@ const char* const GLTF_FILE_EXTENSION_TRANSFORM_ROTATION = "rotation"; ...@@ -43,26 +43,16 @@ const char* const GLTF_FILE_EXTENSION_TRANSFORM_ROTATION = "rotation";
// special UUID that indicates a null UUID in override data // special UUID that indicates a null UUID in override data
static const LLUUID GLTF_OVERRIDE_NULL_UUID = LLUUID("ffffffff-ffff-ffff-ffff-ffffffffffff"); static const LLUUID GLTF_OVERRIDE_NULL_UUID = LLUUID("ffffffff-ffff-ffff-ffff-ffffffffffff");
// https://github.com/KhronosGroup/glTF/tree/main/extensions/3.0/Khronos/KHR_texture_transform void LLGLTFMaterial::TextureTransform::getPacked(F32 (&packed)[8])
LLMatrix3 LLGLTFMaterial::TextureTransform::asMatrix() {
{ packed[0] = mScale.mV[VX];
LLMatrix3 scale; packed[1] = mScale.mV[VY];
scale.mMatrix[0][0] = mScale[0]; packed[2] = mRotation;
scale.mMatrix[1][1] = mScale[1]; // packed[3] = unused
packed[4] = mOffset.mV[VX];
LLMatrix3 rotation; packed[5] = mOffset.mV[VY];
const F32 cos_r = cos(mRotation); // packed[6] = unused
const F32 sin_r = sin(mRotation); // packed[7] = unused
rotation.mMatrix[0][0] = cos_r;
rotation.mMatrix[0][1] = -sin_r;
rotation.mMatrix[1][0] = sin_r;
rotation.mMatrix[1][1] = cos_r;
LLMatrix3 offset;
offset.mMatrix[2][0] = mOffset[0];
offset.mMatrix[2][1] = mOffset[1];
return offset * rotation * scale;
} }
bool LLGLTFMaterial::TextureTransform::operator==(const TextureTransform& other) const bool LLGLTFMaterial::TextureTransform::operator==(const TextureTransform& other) const
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "llrefcount.h" #include "llrefcount.h"
#include "llmemory.h" #include "llmemory.h"
#include "m3math.h"
#include "v4color.h" #include "v4color.h"
#include "v3color.h" #include "v3color.h"
#include "v2math.h" #include "v2math.h"
...@@ -60,7 +59,7 @@ class LLGLTFMaterial : public LLRefCount ...@@ -60,7 +59,7 @@ class LLGLTFMaterial : public LLRefCount
LLVector2 mScale = { 1.f, 1.f }; LLVector2 mScale = { 1.f, 1.f };
F32 mRotation = 0.f; F32 mRotation = 0.f;
LLMatrix3 asMatrix(); void getPacked(F32 (&packed)[8]);
bool operator==(const TextureTransform& other) const; bool operator==(const TextureTransform& other) const;
}; };
......
...@@ -1074,20 +1074,12 @@ void LLShaderMgr::initAttribsAndUniforms() ...@@ -1074,20 +1074,12 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("object_plane_s"); mReservedUniforms.push_back("object_plane_s");
mReservedUniforms.push_back("object_plane_t"); mReservedUniforms.push_back("object_plane_t");
mReservedUniforms.push_back("texture_base_color_scale"); // (GLTF) mReservedUniforms.push_back("texture_base_color_transform"); // (GLTF)
mReservedUniforms.push_back("texture_base_color_rotation"); // (GLTF) mReservedUniforms.push_back("texture_normal_transform"); // (GLTF)
mReservedUniforms.push_back("texture_base_color_offset"); // (GLTF) mReservedUniforms.push_back("texture_metallic_roughness_transform"); // (GLTF)
mReservedUniforms.push_back("texture_normal_scale"); // (GLTF) mReservedUniforms.push_back("texture_emissive_transform"); // (GLTF)
mReservedUniforms.push_back("texture_normal_rotation"); // (GLTF)
mReservedUniforms.push_back("texture_normal_offset"); // (GLTF) llassert(mReservedUniforms.size() == LLShaderMgr::TEXTURE_EMISSIVE_TRANSFORM+1);
mReservedUniforms.push_back("texture_metallic_roughness_scale"); // (GLTF)
mReservedUniforms.push_back("texture_metallic_roughness_rotation"); // (GLTF)
mReservedUniforms.push_back("texture_metallic_roughness_offset"); // (GLTF)
mReservedUniforms.push_back("texture_emissive_scale"); // (GLTF)
mReservedUniforms.push_back("texture_emissive_rotation"); // (GLTF)
mReservedUniforms.push_back("texture_emissive_offset"); // (GLTF)
llassert(mReservedUniforms.size() == LLShaderMgr::TEXTURE_EMISSIVE_OFFSET+1);
mReservedUniforms.push_back("viewport"); mReservedUniforms.push_back("viewport");
......
...@@ -53,18 +53,10 @@ class LLShaderMgr ...@@ -53,18 +53,10 @@ class LLShaderMgr
OBJECT_PLANE_S, // "object_plane_s" OBJECT_PLANE_S, // "object_plane_s"
OBJECT_PLANE_T, // "object_plane_t" OBJECT_PLANE_T, // "object_plane_t"
TEXTURE_BASE_COLOR_SCALE, // "texture_base_color_scale" (GLTF) TEXTURE_BASE_COLOR_TRANSFORM, // "texture_base_color_transform" (GLTF)
TEXTURE_BASE_COLOR_ROTATION, // "texture_base_color_rotation" (GLTF) TEXTURE_NORMAL_TRANSFORM, // "texture_normal_transform" (GLTF)
TEXTURE_BASE_COLOR_OFFSET, // "texture_base_color_offset" (GLTF) TEXTURE_METALLIC_ROUGHNESS_TRANSFORM, // "texture_metallic_roughness_transform" (GLTF)
TEXTURE_NORMAL_SCALE, // "texture_normal_scale" (GLTF) TEXTURE_EMISSIVE_TRANSFORM, // "texture_emissive_transform" (GLTF)
TEXTURE_NORMAL_ROTATION, // "texture_normal_rotation" (GLTF)
TEXTURE_NORMAL_OFFSET, // "texture_normal_offset" (GLTF)
TEXTURE_METALLIC_ROUGHNESS_SCALE, // "texture_metallic_roughness_scale" (GLTF)
TEXTURE_METALLIC_ROUGHNESS_ROTATION,// "texture_metallic_roughness_rotation" (GLTF)
TEXTURE_METALLIC_ROUGHNESS_OFFSET, // "texture_metallic_roughness_offset" (GLTF)
TEXTURE_EMISSIVE_SCALE, // "texture_emissive_scale" (GLTF)
TEXTURE_EMISSIVE_ROTATION, // "texture_emissive_rotation" (GLTF)
TEXTURE_EMISSIVE_OFFSET, // "texture_emissive_offset" (GLTF)
VIEWPORT, // "viewport" VIEWPORT, // "viewport"
LIGHT_POSITION, // "light_position" LIGHT_POSITION, // "light_position"
......
...@@ -44,18 +44,10 @@ uniform mat4 modelview_matrix; ...@@ -44,18 +44,10 @@ uniform mat4 modelview_matrix;
out vec3 vary_position; out vec3 vary_position;
uniform vec2 texture_base_color_scale; uniform vec4[2] texture_base_color_transform;
uniform float texture_base_color_rotation; uniform vec4[2] texture_normal_transform;
uniform vec2 texture_base_color_offset; uniform vec4[2] texture_metallic_roughness_transform;
uniform vec2 texture_normal_scale; uniform vec4[2] texture_emissive_transform;
uniform float texture_normal_rotation;
uniform vec2 texture_normal_offset;
uniform vec2 texture_metallic_roughness_scale;
uniform float texture_metallic_roughness_rotation;
uniform vec2 texture_metallic_roughness_offset;
uniform vec2 texture_emissive_scale;
uniform float texture_emissive_rotation;
uniform vec2 texture_emissive_offset;
out vec3 vary_fragcoord; out vec3 vary_fragcoord;
...@@ -78,7 +70,7 @@ out vec3 vary_tangent; ...@@ -78,7 +70,7 @@ out vec3 vary_tangent;
flat out float vary_sign; flat out float vary_sign;
out vec3 vary_normal; out vec3 vary_normal;
vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform); vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main() void main()
...@@ -97,10 +89,10 @@ void main() ...@@ -97,10 +89,10 @@ void main()
vary_fragcoord.xyz = vert.xyz + vec3(0,0,near_clip); vary_fragcoord.xyz = vert.xyz + vec3(0,0,near_clip);
base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0); base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
normal_texcoord = texture_transform(texcoord0, texture_normal_scale, texture_normal_rotation, texture_normal_offset, texture_matrix0); normal_texcoord = texture_transform(texcoord0, texture_normal_transform, texture_matrix0);
metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_scale, texture_metallic_roughness_rotation, texture_metallic_roughness_offset, texture_matrix0); metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_transform, texture_matrix0);
emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0); emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
#ifdef HAS_SKIN #ifdef HAS_SKIN
vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz; vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz;
...@@ -133,12 +125,8 @@ uniform mat4 modelview_matrix; ...@@ -133,12 +125,8 @@ uniform mat4 modelview_matrix;
out vec3 vary_position; out vec3 vary_position;
uniform vec2 texture_base_color_scale; uniform vec4[2] texture_base_color_transform;
uniform float texture_base_color_rotation; uniform vec4[2] texture_emissive_transform;
uniform vec2 texture_base_color_offset;
uniform vec2 texture_emissive_scale;
uniform float texture_emissive_rotation;
uniform vec2 texture_emissive_offset;
in vec3 position; in vec3 position;
in vec4 diffuse_color; in vec4 diffuse_color;
...@@ -149,7 +137,7 @@ out vec2 emissive_texcoord; ...@@ -149,7 +137,7 @@ out vec2 emissive_texcoord;
out vec4 vertex_color; out vec4 vertex_color;
vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform); vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main() void main()
...@@ -159,8 +147,8 @@ void main() ...@@ -159,8 +147,8 @@ void main()
gl_Position = vert; gl_Position = vert;
vary_position = vert.xyz; vary_position = vert.xyz;
base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0); base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0); emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
vertex_color = diffuse_color; vertex_color = diffuse_color;
} }
......
...@@ -34,12 +34,8 @@ uniform mat4 modelview_projection_matrix; ...@@ -34,12 +34,8 @@ uniform mat4 modelview_projection_matrix;
uniform mat4 texture_matrix0; uniform mat4 texture_matrix0;
uniform vec2 texture_base_color_scale; uniform vec4[2] texture_base_color_transform;
uniform float texture_base_color_rotation; uniform vec4[2] texture_emissive_transform;
uniform vec2 texture_base_color_offset;
uniform vec2 texture_emissive_scale;
uniform float texture_emissive_rotation;
uniform vec2 texture_emissive_offset;
in vec3 position; in vec3 position;
in vec4 emissive; in vec4 emissive;
...@@ -51,7 +47,7 @@ out vec2 emissive_texcoord; ...@@ -51,7 +47,7 @@ out vec2 emissive_texcoord;
out vec4 vertex_emissive; out vec4 vertex_emissive;
vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform); vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main() void main()
{ {
...@@ -68,8 +64,8 @@ void main() ...@@ -68,8 +64,8 @@ void main()
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
#endif #endif
base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0); base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0); emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
vertex_emissive = emissive; vertex_emissive = emissive;
} }
......
...@@ -38,18 +38,10 @@ uniform mat4 modelview_projection_matrix; ...@@ -38,18 +38,10 @@ uniform mat4 modelview_projection_matrix;
#endif #endif
uniform mat4 texture_matrix0; uniform mat4 texture_matrix0;
uniform vec2 texture_base_color_scale; uniform vec4[2] texture_base_color_transform;
uniform float texture_base_color_rotation; uniform vec4[2] texture_normal_transform;
uniform vec2 texture_base_color_offset; uniform vec4[2] texture_metallic_roughness_transform;
uniform vec2 texture_normal_scale; uniform vec4[2] texture_emissive_transform;
uniform float texture_normal_rotation;
uniform vec2 texture_normal_offset;
uniform vec2 texture_metallic_roughness_scale;
uniform float texture_metallic_roughness_rotation;
uniform vec2 texture_metallic_roughness_offset;
uniform vec2 texture_emissive_scale;
uniform float texture_emissive_rotation;
uniform vec2 texture_emissive_offset;
in vec3 position; in vec3 position;
in vec4 diffuse_color; in vec4 diffuse_color;
...@@ -68,7 +60,7 @@ out vec3 vary_tangent; ...@@ -68,7 +60,7 @@ out vec3 vary_tangent;
flat out float vary_sign; flat out float vary_sign;
out vec3 vary_normal; out vec3 vary_normal;
vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform); vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main() void main()
{ {
...@@ -86,10 +78,10 @@ void main() ...@@ -86,10 +78,10 @@ void main()
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
#endif #endif
base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0); base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
normal_texcoord = texture_transform(texcoord0, texture_normal_scale, texture_normal_rotation, texture_normal_offset, texture_matrix0); normal_texcoord = texture_transform(texcoord0, texture_normal_transform, texture_matrix0);
metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_scale, texture_metallic_roughness_rotation, texture_metallic_roughness_offset, texture_matrix0); metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_transform, texture_matrix0);
emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0); emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
#ifdef HAS_SKIN #ifdef HAS_SKIN
vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz; vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz;
...@@ -114,18 +106,10 @@ uniform mat4 modelview_projection_matrix; ...@@ -114,18 +106,10 @@ uniform mat4 modelview_projection_matrix;
uniform mat4 texture_matrix0; uniform mat4 texture_matrix0;
uniform vec2 texture_base_color_scale; uniform vec4[2] texture_base_color_transform;
uniform float texture_base_color_rotation; uniform vec4[2] texture_normal_transform;
uniform vec2 texture_base_color_offset; uniform vec4[2] texture_metallic_roughness_transform;
uniform vec2 texture_normal_scale; uniform vec4[2] texture_emissive_transform;
uniform float texture_normal_rotation;
uniform vec2 texture_normal_offset;
uniform vec2 texture_metallic_roughness_scale;
uniform float texture_metallic_roughness_rotation;
uniform vec2 texture_metallic_roughness_offset;
uniform vec2 texture_emissive_scale;
uniform float texture_emissive_rotation;
uniform vec2 texture_emissive_offset;
in vec3 position; in vec3 position;
in vec4 diffuse_color; in vec4 diffuse_color;
...@@ -136,15 +120,15 @@ out vec2 emissive_texcoord; ...@@ -136,15 +120,15 @@ out vec2 emissive_texcoord;
out vec4 vertex_color; out vec4 vertex_color;
vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform); vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main() void main()
{ {
//transform vertex //transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0); base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0); emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
vertex_color = diffuse_color; vertex_color = diffuse_color;
} }
......
...@@ -58,7 +58,7 @@ vec2 khr_texture_transform(vec2 texcoord, vec2 scale, float rotation, vec2 offse ...@@ -58,7 +58,7 @@ vec2 khr_texture_transform(vec2 texcoord, vec2 scale, float rotation, vec2 offse
// animations, available through LSL script functions such as // animations, available through LSL script functions such as
// LlSetTextureAnim. It assumes a right-handed UV coordinate system. // LlSetTextureAnim. It assumes a right-handed UV coordinate system.
// texcoord - The final texcoord to use for image sampling // texcoord - The final texcoord to use for image sampling
vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform) vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform)
{ {
vec2 texcoord = vertex_texcoord; vec2 texcoord = vertex_texcoord;
...@@ -67,7 +67,7 @@ vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf ...@@ -67,7 +67,7 @@ vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf
// Convert to left-handed coordinate system. The offset of 1 is necessary // Convert to left-handed coordinate system. The offset of 1 is necessary
// for rotations to be applied correctly. // for rotations to be applied correctly.
texcoord.y = 1.0 - texcoord.y; texcoord.y = 1.0 - texcoord.y;
texcoord = khr_texture_transform(texcoord, khr_gltf_scale, khr_gltf_rotation, khr_gltf_offset); texcoord = khr_texture_transform(texcoord, khr_gltf_transform[0].xy, khr_gltf_transform[0].z, khr_gltf_transform[1].xy);
// Convert back to right-handed coordinate system // Convert back to right-handed coordinate system
texcoord.y = 1.0 - texcoord.y; texcoord.y = 1.0 - texcoord.y;
......
...@@ -110,21 +110,21 @@ void LLFetchedGLTFMaterial::bind(LLViewerTexture* media_tex) ...@@ -110,21 +110,21 @@ void LLFetchedGLTFMaterial::bind(LLViewerTexture* media_tex)
shader->uniform1f(LLShaderMgr::METALLIC_FACTOR, mMetallicFactor); shader->uniform1f(LLShaderMgr::METALLIC_FACTOR, mMetallicFactor);
shader->uniform3fv(LLShaderMgr::EMISSIVE_COLOR, 1, mEmissiveColor.mV); shader->uniform3fv(LLShaderMgr::EMISSIVE_COLOR, 1, mEmissiveColor.mV);
shader->uniform2fv(LLShaderMgr::TEXTURE_BASE_COLOR_SCALE, 1, (F32*)mTextureTransform[GLTF_TEXTURE_INFO_BASE_COLOR].mScale.mV); F32 base_color_packed[8];
shader->uniform1f(LLShaderMgr::TEXTURE_BASE_COLOR_ROTATION, mTextureTransform[GLTF_TEXTURE_INFO_BASE_COLOR].mRotation); mTextureTransform[GLTF_TEXTURE_INFO_BASE_COLOR].getPacked(base_color_packed);
shader->uniform2fv(LLShaderMgr::TEXTURE_BASE_COLOR_OFFSET, 1, (F32*)mTextureTransform[GLTF_TEXTURE_INFO_BASE_COLOR].mOffset.mV); shader->uniform4fv(LLShaderMgr::TEXTURE_BASE_COLOR_TRANSFORM, 2, (F32*)base_color_packed);
shader->uniform2fv(LLShaderMgr::TEXTURE_NORMAL_SCALE, 1, (F32*)mTextureTransform[GLTF_TEXTURE_INFO_NORMAL].mScale.mV); F32 normal_packed[8];
shader->uniform1f(LLShaderMgr::TEXTURE_NORMAL_ROTATION, mTextureTransform[GLTF_TEXTURE_INFO_NORMAL].mRotation); mTextureTransform[GLTF_TEXTURE_INFO_NORMAL].getPacked(normal_packed);
shader->uniform2fv(LLShaderMgr::TEXTURE_NORMAL_OFFSET, 1, (F32*)mTextureTransform[GLTF_TEXTURE_INFO_NORMAL].mOffset.mV); shader->uniform4fv(LLShaderMgr::TEXTURE_NORMAL_TRANSFORM, 2, (F32*)normal_packed);
shader->uniform2fv(LLShaderMgr::TEXTURE_METALLIC_ROUGHNESS_SCALE, 1, (F32*)mTextureTransform[GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS].mScale.mV); F32 metallic_roughness_packed[8];
shader->uniform1f(LLShaderMgr::TEXTURE_METALLIC_ROUGHNESS_ROTATION, mTextureTransform[GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS].mRotation); mTextureTransform[GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS].getPacked(metallic_roughness_packed);
shader->uniform2fv(LLShaderMgr::TEXTURE_METALLIC_ROUGHNESS_OFFSET, 1, (F32*)mTextureTransform[GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS].mOffset.mV); shader->uniform4fv(LLShaderMgr::TEXTURE_METALLIC_ROUGHNESS_TRANSFORM, 2, (F32*)metallic_roughness_packed);
shader->uniform2fv(LLShaderMgr::TEXTURE_EMISSIVE_SCALE, 1, (F32*)mTextureTransform[GLTF_TEXTURE_INFO_EMISSIVE].mScale.mV); F32 emissive_packed[8];
shader->uniform1f(LLShaderMgr::TEXTURE_EMISSIVE_ROTATION, mTextureTransform[GLTF_TEXTURE_INFO_EMISSIVE].mRotation); mTextureTransform[GLTF_TEXTURE_INFO_EMISSIVE].getPacked(emissive_packed);
shader->uniform2fv(LLShaderMgr::TEXTURE_EMISSIVE_OFFSET, 1, (F32*)mTextureTransform[GLTF_TEXTURE_INFO_EMISSIVE].mOffset.mV); shader->uniform4fv(LLShaderMgr::TEXTURE_EMISSIVE_TRANSFORM, 2, (F32*)emissive_packed);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment