In some of my products, i want to allow a switch from vertical and horizontal texture animation.
This is a pbr material, and i'm using a base color texture (gradients, patterns) and an identical texture as the emissive map texture. The effect is highly customizable via the on touch dialog, and i'd like to keep this flexibility.
side note:
This is not a new issue, but as i am improving my products, i would like to have this solved. So far, in similar cases, i was forced using a non pbr material for these cases, but i can't no more, because my newer script allows the animated part to also become a static texture with pbr attributes.
the issue:
So, to allow switching from an horizontal to vertical animation, i am setting the rotation parameter for PRIM_GLTF_BASE_COLOR and PRIM_GLTF_EMISSIVE to 0 or PI/2, then i trigger then animation.
Once i set PI/2, and as soon as the texture animates, then the rotation is mixed up (meaning the base color would be rotated as i wish, not the emissive map).
If i apply PI/2 (90°) only to the base color, then that's the emissive map that is rotated .. while the base color is not.
So the result is, no matter which combinations i tried, i can't make the base color map and the emissive map to actually animate with the same texture orientation (which is necessary for the effect).
side note: I have more success with the normal map orientation which i also use in some similar products.
I can provide some test item inworld if you wish and show you.
Thank you for reading :)
EDIT:
I may have found a workaround for now:
1) I only apply the rotation to the base color (not the emissive map), in all cases.
2) If the "brightness" value that controls the emissive color is 0, then it's fine (the emissive color is set to a zero vector)
3) if the "brightness" value is superior to 0, then i set the base color to a zero vector.
4) if the "speed" is set to zero, then i have to set the emissive map to PI/2
so it seems, when a texture is animated, it reads the rotation based on the base color rotation value for the emissive map. problem being, it does NOT apply this same rotation value to the actual base color texture (that's why i have to hide it, because in this case it shows both textures with a different rotation, and it doesn't look nice).