Different Texture on each side of geometry

Is it possible to assign a diferent texture to each side of a box/sphere/whatever?

All things are possible…



…but if you mean in a way that doesn’t involve writing your own shader or generating your own geometry, then “no”.

How exciting 8)



but I think ill wait with glsl and shaders until I speak more fluid Java :roll:

Well, those were two different approaches. You could technically use a custom shader to put different textures on each side of the box with one material.



The more conventional approach is to build your box out of separate quads, each with the appropriate material .

Wouldn’t that triple the amount of vertices?



Shaders look like something pretty interesting to learn anyway and what I want seems like a pretty simple thing to start with at the time I find the courage to start learning

Each face has four vertexes… whether they are in one mesh or six. Because each face has different normals the vertexes are not shared between faces anyway.



There are good reasons to make as big of a mesh as you can but it’s rarely about sharing vertexes… and the choice between box or separate quads isn’t really the discriminator. When you want to start batching meshes for efficiency, you do it by material and not by logical shape… usually.

1 Like

I did not know that vertices weren’t shared, interesting. So as an efficient solution to my problem it doesn’t matter what method I use or is integrating side-texture support in the shader still more efficient in the end?

No… you will probably run into other problems that way. I only mentioned it because it is technically possible. :slight_smile:

1 Like

Alright, well thank you so much for your help :smiley: