Page 1 of 1

SMeshBufferLightMap - How to use?

Posted: Wed May 20, 2009 8:23 pm
by L o
Hi,

Irrlicht says, SMeshBufferLightMap is a "Simple implementation of the IMeshBuffer interface with S3DVertex2TCoords vertices.".

Now my file reader shall load lightmaps additional to my textures. Until Now, I used SMeshBuffer. Shall I store the textures in SMeshBufferLightMap, too, now?

Or is the SMeshBufferLightMap only for Lightmap stuff?

I always thought it has two vertex coords because one would be for textures and one for lightmaps. I am asking because the CIrrMeshFileLoader uses THREE kinds of buffers at the same time:

Code: Select all

SMeshBuffer* sbuffer1 = 0;
SMeshBufferLightMap* sbuffer2 = 0;
SMeshBufferTangents* sbuffer3 = 0;
Greets,
Lo

Posted: Wed May 20, 2009 8:55 pm
by hybrid
The buffer pointers are only all there because you can meet every meshbuffer type in a .irrmesh file. You should only use the 2TCoords style if you have 2 coord values per vertex. Otherwise you'd waste memory for nothing. You can have all types of meshbuffers in one mesh.

Posted: Wed May 20, 2009 9:19 pm
by L o
So the only type of MeshBuffer I need is SMeshBufferLightMap, and the first vertex is for the texture and the second one for the lightmap?

Posted: Wed May 20, 2009 11:32 pm
by hybrid
Please do us a favor and look up the definition/documentation of the S3D* structures. Think about this question when reading things that are named "texture coord" or similar...