Hi, I’m currently rendering a plane with a 2d image as a sprite, using a custom shader that offsets the uv’s for the texture based on the frame I’m trying to render.
vec2 atlasUv = (vUv * uvScale) + vUvOffset;
vAtlasUv = vec2(atlasUv.x, atlasUv.y);
vec4 inputColor = sRGBToLinear(texture2D(
colorMap,
vAtlasUv
));
I’m successfully able to set the UV for the texture, and the alphaMap, by using some of the shader chunks that set the corresponding uniforms/variables. I’ve confirmed that the alphaMap is accurate as well, by setting the successfully outlines the visible portion of the texture.
// This updates the UV's for the alphamap
vAlphaMapUv = vAtlasUv;
// I've tested that this works -
vec4 inputColor = sRGBToLinear(texture2D(
atlasMap,
vAtlasUv
));
The shadow that is being cast onto other objects still seems wrong, though. The weird thing is, it seems to be casting a shadow in the shape of the bottom left frame, no matter which frame I try to show.
How does the shadow’s shape get calculated? Is there a way to modify the UV’s to match that of e.g, the alphamap?