Hi everyone,
i'm currently trying to figure out how i can export a Blender scene (let's say a ground mesh and a tree mesh) and load it into irrlicht.
What works for me is having a single mesh (ground and tree joined in Blender), one UV map, a color texture and a lightmap texture together with irrlicht's EMT_LIGHTMAP material type. But this would required a really large texture for a forest scene.
So how can i use multiple textures per mesh, e.g. a texture for the tree's trunk and a different for the leafs? And how do i handle multiple meshes, not joined in Blender.
Additionally, if i use multiple UV maps in Blender (one for the color texture, a different for the lightmap) with two materials, the textures are not applied correctly to the mesh in irrlicht.
Can anyone point me to a tutorial about irrlicht's material, texture, UV map concepts? I think i simply don't get the whole material and texture handling with respect to meshes, mesh buffers, scene nodes and so on.
Ideally i would like to model a forest in Blender, use different textures / UV maps for the meshes and a combined texture / UV map for the lightmap. But i don't know if this is even possible.
Thanks
Andreas
Blender UV maps, textures and irrlicht materials
Re: Blender UV maps, textures and irrlicht materials
Maybe this glossary helps a little to understand the Irrlicht concepts: http://irrlicht3d.org/wiki/index.php?n= ... ommonTerms
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Blender UV maps, textures and irrlicht materials
Hi CuteAlien,
thanks for your reply. The documentation helped a lot.
But two things i still don't get:
Best regards
Andreas
thanks for your reply. The documentation helped a lot.
But two things i still don't get:
Does this mean i can combine materials for one mesh? E.g. use EMT_TRANSPARENT_ALPHA and EMT_LIGHTMAP_ADD in the same mesh?Meshbuffer A meshbuffer does contain the geometric data [...] and exactly one material.
How do i configure a lightmap for all static objects in the scene? And what is the preferred way of generating the lightmap? Is this possible in Blender?Lightmap An additional texture which is put over all static (not moving) objects in a scene.
Best regards
Andreas
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Blender UV maps, textures and irrlicht materials
Yes, you can use more than one material per object (i.e. mesh) by breaking up the mesh into several mesh buffers.
Re: Blender UV maps, textures and irrlicht materials
Ok, not my speciality, so maybe someone else knows more about lightmaps. But we used it once in Maya and I think the artist did some "baking" of the lights. And I think Blender also has this baking stuff where you can save the light-calculations as texture.
For combining lightmaps with other textures we used some workaround described here: http://sourceforge.net/p/irrext/code/91 ... oader/LMO/
There might be better solutions.
For combining lightmaps with other textures we used some workaround described here: http://sourceforge.net/p/irrext/code/91 ... oader/LMO/
There might be better solutions.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Blender UV maps, textures and irrlicht materials
Hi,
i guess it's time for me to read more about mesh buffers and lightmap usage in irrlicht and experiment a bit...
Thanks for your help!
Andreas
i guess it's time for me to read more about mesh buffers and lightmap usage in irrlicht and experiment a bit...
Thanks for your help!
Andreas
Re: Blender UV maps, textures and irrlicht materials
Hi again,
so i tested and learned some more about mesh buffers, UV maps and lightmap baking. But there is still something i hope someone can help me with.
My problem is similar to the discussion in this thread: http://irrlicht.sourceforge.net/forum/v ... ap#p277233
Sadly there is no solution documented or at least i don't see it.
What i did:
- I created B3D model with two mesh buffers ("ground" and "tree"). Each mesh buffer has a separate color texture and UV map in Blender.
- In order to bake a lightmap i combine the mesh buffers in Blender, created a second UV map and baked the lightmap into a new texture.
So now i have:
- My model: "test.b3d" with a single mesh buffer
- Two color textures: "ground.png" and "tree.png"
- A lightmap texture: "lightmap.png"
Now using the EMT_LIGHTMAP Material in irrlicht, the first texture is used as color texture (where i have two!) and the second texture is used as lightmap (OK).
Is it possible to use all three textures in Irrlicht without using a custom mesh loader light CuteAlien suggested? I would like to keep the tool chain as simple as possible if irrlicht supports that.
Thanks
Andreas
so i tested and learned some more about mesh buffers, UV maps and lightmap baking. But there is still something i hope someone can help me with.
My problem is similar to the discussion in this thread: http://irrlicht.sourceforge.net/forum/v ... ap#p277233
Sadly there is no solution documented or at least i don't see it.
What i did:
- I created B3D model with two mesh buffers ("ground" and "tree"). Each mesh buffer has a separate color texture and UV map in Blender.
- In order to bake a lightmap i combine the mesh buffers in Blender, created a second UV map and baked the lightmap into a new texture.
So now i have:
- My model: "test.b3d" with a single mesh buffer
- Two color textures: "ground.png" and "tree.png"
- A lightmap texture: "lightmap.png"
Now using the EMT_LIGHTMAP Material in irrlicht, the first texture is used as color texture (where i have two!) and the second texture is used as lightmap (OK).
Is it possible to use all three textures in Irrlicht without using a custom mesh loader light CuteAlien suggested? I would like to keep the tool chain as simple as possible if irrlicht supports that.
Thanks
Andreas
Re: Blender UV maps, textures and irrlicht materials
I think i found the solution! Simply seperate the object into different mesh buffers again after lightmap generation. So each mesh buffer has two UV maps, one for the color texture and one for the generated lightmap texture. Then in irrlicht set the material of each mesh buffer to EMT_LIGHTMAP and assign the color texture to the first texture layer of the mesh buffer and the lightmap to the second texture layer.
Re: Blender UV maps, textures and irrlicht materials
Yeah, sounds better than my solution :-)
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm