Extra Meshbuffers for different lighting?

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
L o
Posts: 44
Joined: Sun Mar 29, 2009 2:53 pm

Extra Meshbuffers for different lighting?

Post by L o »

Hi,

I am writing a level format loader. The same texture can have *different* lighting values on the two different faces.

Now does it mean that, for two such faces I will need two different MeshBuffers two? Or is there a possibility to put them into the same meshbuffer?

I am asking because my level format does have the same lighting values for equal textues. If now I would go ahead and make a MeshBuffer for *every face*, that would mean a lot of memory overhead, right?

I hope you get my question?

Greetings,
Lo
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Either you can see both meshbuffers at once, and both buffers must be part of the same Mesh, then you need the two copies. Or you just want to swap textures, or instantiate two nodes, where you can just use the same meshbuffer and change the texture when needed. It's not clear what you want to achieve.
L o
Posts: 44
Joined: Sun Mar 29, 2009 2:53 pm

Post by L o »

Thanks for your quick response. Yeah, I think you got me wrong.

Let's say we have three faces, all same texture:

face1 face2 face3
tex1 tex1 tex1
default brightness def. brightness special brightness value (!)

Now do I need one meshbuffer for face1 and face2 and another meshbuffer for face 3? Or is there a possibility to put all faces into the same meshbuffer?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Two ways here. Since you talk about faces, you'll probably put them into meshbuffers. If you just want to go via material settings you have to use multiple meshbuffers, one for each material setting. Another way is to use vertex colors to alter the brightness. This would work within one meshbuffer, you just have to alter vertex colors when changing the values.
Post Reply