Different textures for each side of Scenenode?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ppsychrite
Posts: 6
Joined: Tue Mar 21, 2017 12:05 am

Different textures for each side of Scenenode?

Post 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?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Different textures for each side of Scenenode?

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
ppsychrite
Posts: 6
Joined: Tue Mar 21, 2017 12:05 am

Re: Different textures for each side of Scenenode?

Post 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. :(
kornwaretm
Competition winner
Posts: 189
Joined: Tue Oct 16, 2007 3:53 am
Location: Indonesia
Contact:

Re: Different textures for each side of Scenenode?

Post 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.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Different textures for each side of Scenenode?

Post 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.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply