status of blender 2.44 lightmapping
status of blender 2.44 lightmapping
First off, does anyone know if it is possible to export a lightmapped scene in blender and have it load directly into irrlicht (via a format such as .x, .3ds, etc...)?
I can get the lightmaps generated in blender by roughly following this tutorial
http://www.continuousphysics.com/lightm ... orial.html
But the problems comes when exporting. I can't figure out how to export both uv layouts. It only exports the one that is selected under the mesh panel. So i guess this is more of a blender question, but any pointers would be appreciated.
Thanks
I can get the lightmaps generated in blender by roughly following this tutorial
http://www.continuousphysics.com/lightm ... orial.html
But the problems comes when exporting. I can't figure out how to export both uv layouts. It only exports the one that is selected under the mesh panel. So i guess this is more of a blender question, but any pointers would be appreciated.
Thanks
you see, blender isnt only modeling program. its a game engine. i dont rly know this, but i gues that blender can not export lightmapped meshes. you will have to do it yourself with an external tool.
EDIT:
Or maybe im wrong. check this
EDIT:
Or maybe im wrong. check this
Bledner has now multiple UV, bake and all needed. Only thing is the scirpt exporting that. I doubt b3d plugin at svn is able to export that, as was made before those features came...but probably will in a future.
Right now, I dunno if collada would do, either...
Right now, I dunno if collada would do, either...
Finally making games again!
http://www.konekogames.com
http://www.konekogames.com
I've just added the method which we used to get lightmaps from Maya to Irrlicht to my irrlichtpage. Maybe this will also work for Blender (it should): http://www.michaelzeilfelder.de/irrlicht.htm#Lightmaps
Basically the trick we are using is to merge two files in the obj format and modify the obj loader somewhat so it will create a lightmap material for those files.
Basically the trick we are using is to merge two files in the obj format and modify the obj loader somewhat so it will create a lightmap material for those files.
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
yay, that was my suggestion to Murphy, when he did the mim and oct tools...
Indeed, is a nice idea, and more flexible than ppl think...As also doesnt tie to any tool, anything that can bake lighting -heck, or even 3d painting of shadows, if you'r a good painter -
Kudos for doing that.
Anyway, was looking at 2.44 blender. It's starting to kick some... heck, the video features page is amazing..
whatever, gotta look in depth some more internal changes, which are as intersting.
To the point: maybe if the original poster is in a lot of hurries, can also use collada or fbx (dunno if we have fbx loader: I think is better et collada than fbx, by far)
but didnt know about the obj made universal, huge kudos there...Indeed, go that route if u can...
Indeed, is a nice idea, and more flexible than ppl think...As also doesnt tie to any tool, anything that can bake lighting -heck, or even 3d painting of shadows, if you'r a good painter -
Kudos for doing that.
Anyway, was looking at 2.44 blender. It's starting to kick some... heck, the video features page is amazing..
whatever, gotta look in depth some more internal changes, which are as intersting.
To the point: maybe if the original poster is in a lot of hurries, can also use collada or fbx (dunno if we have fbx loader: I think is better et collada than fbx, by far)
but didnt know about the obj made universal, huge kudos there...Indeed, go that route if u can...
Finally making games again!
http://www.konekogames.com
http://www.konekogames.com
Ah, yes - that was where i got the idea from ;-)vermeer wrote:yay, that was my suggestion to Murphy, when he did the mim and oct tools...
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
The B3D exporter doesn't do multiple coordinates as far as I know. I've been searching the modules in Blender and as far as I can tell I don't think you can even access more than one UV layer with the current Python API.
I'm hoping I'm wrong, and if I am I'd like to see how to do it.
I'm hoping I'm wrong, and if I am I'd like to see how to do it.
Those who call the faithful 'sheep' do not realize that they themselves are sheep. We follow one shepherd, they follow another.
blender should probably soon have it...as allways, pitty is we don't know exactly when.Should come logically, as many formats, like collada, other game formats, etc, will rquire it.
but if you are in a hurry...you can use that idea sugested above: just using OBJ export, export the model twice:
-one obj model with standard texture and the UVs needed for that tetxuring.
-One other obj model with the needed lightmap UVs, and the bitmap file (tga, png...) result of a Blender "bake".
You will need an special loader/format (like Murphy's Mim stuff) or irrlicht code/tool of whatever the sort , to put that into multiuv mesh, lightmapped , ingame.
This method has its advantages,(flexibility in post editing, etc) while probably a b3d file with multiple UVs direct from blender, would be easiest for the artist. Or not. The obj2mim was pretty easy to use, only thing I had to care was...using same copy of OBJ for both, and just only modify the UV mappings and material/texture asignment in blender.
The obj way I did tests of it using obj2mim's murpphy tool,and using mim loader, as mim supported 2 uv channels and that multimaterial structure.
but if you are in a hurry...you can use that idea sugested above: just using OBJ export, export the model twice:
-one obj model with standard texture and the UVs needed for that tetxuring.
-One other obj model with the needed lightmap UVs, and the bitmap file (tga, png...) result of a Blender "bake".
You will need an special loader/format (like Murphy's Mim stuff) or irrlicht code/tool of whatever the sort , to put that into multiuv mesh, lightmapped , ingame.
This method has its advantages,(flexibility in post editing, etc) while probably a b3d file with multiple UVs direct from blender, would be easiest for the artist. Or not. The obj2mim was pretty easy to use, only thing I had to care was...using same copy of OBJ for both, and just only modify the UV mappings and material/texture asignment in blender.
The obj way I did tests of it using obj2mim's murpphy tool,and using mim loader, as mim supported 2 uv channels and that multimaterial structure.
Finally making games again!
http://www.konekogames.com
http://www.konekogames.com
DOn't you just export the mesh and the baked lightmap, and then set the mech's material to a lightmap, and apply the textures. I'm not sure how to program that, but in irredit, you just set the material to a lightmap, and then apply the textures in the first texture slot, then put the lightmap texture into the second texture slot.
probably you mean irredit or your code, allows you to export obj with certain uvs and the baked lightmap as texture, export obj with othe ruvs but standard texture asigned, build the whole final thing in irredit or by code..
you wish to have different UVs for lightmaps, is no good to use same ones than with textures.... So need the two meshes, or, once it's evolved in Blender api -I dunno- and the plugin for blender is completed for that too, when that momet comes, you could export a b3d file which already would be multimaterial, multi UV level, which you save and pass it with its textures and lightmap bitmaps, to the engine b3d loader....
you wish to have different UVs for lightmaps, is no good to use same ones than with textures.... So need the two meshes, or, once it's evolved in Blender api -I dunno- and the plugin for blender is completed for that too, when that momet comes, you could export a b3d file which already would be multimaterial, multi UV level, which you save and pass it with its textures and lightmap bitmaps, to the engine b3d loader....
Finally making games again!
http://www.konekogames.com
http://www.konekogames.com
In the time since I last posted in this thread I have discovered that there is a new Blender release with an updated Python API.
It is now possible to access UVLayers from within the code. For example (rough outline, as I don't have access to the error notices to correct me):
It's untested, since I don't have a copy of Blender here to run it on and I don't fully remember what I typed in a script I'm working on, but that should print out the UV coordinates of layers one and two.
Of course, someone with knowledge of the file formats Irrlicht supports will have to implement this, because I only know the obj file spec and have a vague understanding of the X file format.
It is now possible to access UVLayers from within the code. For example (rough outline, as I don't have access to the error notices to correct me):
Code: Select all
import bpy
sce = bpy.data.scenes.active
obj = sce.objects.active
mesh = bpy.data.meshes.new()
mesh.getFromObject(obj)
layers = mesh.getUVLayerNames()
for f in mesh.faces:
mesh.activeUVLayer = layers[0]
print f.uv
if len(layers) > 1:
mesh.activeUVLayer = layers[1]
print f.uv
Of course, someone with knowledge of the file formats Irrlicht supports will have to implement this, because I only know the obj file spec and have a vague understanding of the X file format.
Those who call the faithful 'sheep' do not realize that they themselves are sheep. We follow one shepherd, they follow another.
cool...
I am terribly sorry, I can't code.
But to me this would be great to try implementing in the Blender B3D exporter...
OBJ do not support 2 UV channels. X supports it in dx9 spec, if I am not wrong, by something called FVF or something, often not exported by 3d tools. While is really common that b3d exports in 3d tools have polished a lot the lightmapped scene export: uvs and textures asigned correctly. Go for b3d...
I am terribly sorry, I can't code.
But to me this would be great to try implementing in the Blender B3D exporter...
OBJ do not support 2 UV channels. X supports it in dx9 spec, if I am not wrong, by something called FVF or something, often not exported by 3d tools. While is really common that b3d exports in 3d tools have polished a lot the lightmapped scene export: uvs and textures asigned correctly. Go for b3d...
Finally making games again!
http://www.konekogames.com
http://www.konekogames.com