Dynamically Layering Textures Onto a Model

Hi everyone, I have a need to add a texture, at run time, onto an already textured object. The use case is that I have a hexagon in my game that represents a “solar system” and when the game starts it does not belong to anyone. However, players can later conquer that solar system and I want to layer an texture on top of it that is mostly alpha but has the color of their race along the edge. Problem is that I can’t seem to layer the textures on top of eachother at run time in any obvious way.

If this is possible I’d really appreciate the help! Otherwise we will have to quadruple the size of all of our system textures by having a system of each color loaded when the application starts.

What you talk about is texture splatting and its done in the terrain material for example, what you imo need is simply painting on the texture, why “layer” them when you can just use one texture that looks as it should. At least for the examples you gave that sounds like the simpler solution. If you use the ImagePainter plugin from the plugins repo you can even paint other images into one texture.

Thanks normen, I’ll check out that tut and let you know if that suits my needs.

So I checked out the example, and experimented with the Terrain.j3md. I couldn’t find the source for the material definition (which folder is it in again?) so I just checked the doc, and saw that one texture represents R, the other G, the other B. I’m not sure if this was conceptual or the actual way it works, but what I did was alter the scale of the textures, set my main texture at texture3, and set my outline texture as texture 2 AND texture 3. This resulted in exactly what I wanted, but I’m not really sure what it’s doing :stuck_out_tongue:

If this seems like a horrible way of doing it, or if there would be bad side effects down the road, I’m all ears!