Page 1 of 1

Different textures for each side of Scenenode?

Posted: Sun Mar 26, 2017 1:41 pm
by ppsychrite
I'm currently using a custom scenenode right now and wondering if it's possible to set a texture for each side (some sort of rectangle).
Now I know that it would be to UV Map it but the thing is I want each side to be a custom image file (ex: Side 1: "Brickwall.png", Side 2: "WoodlogWall.png" and so on)
Is this possible?

Re: Different textures for each side of Scenenode?

Posted: Sun Mar 26, 2017 4:09 pm
by CuteAlien
Probably not - at least not easy (or fast). It might be possible with shaders.
Easiest solution is probably to have different polygons for the different sides (shouldn't cause any z-buffer problems as one side is always clipped). And then assign different materials to those polygons so you have 2 meshbuffers for them.

Re: Different textures for each side of Scenenode?

Posted: Sun Mar 26, 2017 8:37 pm
by ppsychrite
CuteAlien wrote:Probably not - at least not easy (or fast). It might be possible with shaders.
Easiest solution is probably to have different polygons for the different sides (shouldn't cause any z-buffer problems as one side is always clipped). And then assign different materials to those polygons so you have 2 meshbuffers for them.
Oh I see. :(

Re: Different textures for each side of Scenenode?

Posted: Mon Mar 27, 2017 3:47 am
by kornwaretm
if the custom scene node is not a must, you can comfortably use mesh files such as .b3d, .x, .obj exported from your favorite 3d modeling software. they have multiple materials. it means, different textures for each materials, or even further, different material settings and shaders. the hard work is already done.

Re: Different textures for each side of Scenenode?

Posted: Tue Mar 28, 2017 9:16 am
by Mel
You can if you provide a mesh with a meshbuffer for each side:
pro: you can use all the textures and mapping coordinates you want
con: you will issue a draw call for each of them.