I'm trying to make a card game (like Magic Arena, Hearthstone, Legends of Runeterra) and I'm not sure how to properly use the textures.
When a card is played, it lands on the table as a small flat piece. First I tried making these pieces using the various Sprite3D nodes (image, border, name, etc) stacked on top of a MeshInstance3D. This worked very well, or almost... The problem is that when I place this piece in the game scene it doesn't interact with light and shadow. It looks like that object doesn't belong in that scene.
So I tried to create a texture that is already the combination of all image layers (in a single .png file). This gave a much better final result. The Object interacts with light and shadows and it looks like that piece is really on the table. But here comes the problem: In this game I'm trying to develop, the color of the borders can change to indicate something to the player. Some effect can make the card change its type, or its name, etc... That's why I needed to be able to change the parts that make up the texture dynamically.
These are the layers that make up the piece:
Here's the MeshInstance3D with the texture of a single .png image with all parts combined:
And this is a close up of the scene. You can see that the middle piece (which is made up of several Sprite3D nodes) doesn't interact with the light and shadows of the scene like the other pieces do.
My question is: is there any way to dynamically apply multiple images to create a texture? Maybe with a shader (which I don't understand anything yet).
My question is: is there any way to dynamically apply multiple images to create a texture? Maybe with a shader (which I don't understand anything yet). Maybe what I'm doing isn't even the right thing. I don't have experience with game development yet.
Sorry for the long post. Thank you for any help 🙂