My3d and dynamic lighting...
My3d and dynamic lighting...
Hello,
Ran into a little problem with the My3d lightmapping... It cannot be effected by dynamic lights at all...
I tried setting the material type to EMT_LIGHTMAP_LIGHTING, and setting EMF_LIGHTING to true. No luck!
After a forum search, I found a patch that apparently gets BSP dynamic lighting to work, however, it didn't work with My3d.
Any ideas? Thanks
________
Suzuki Tl1000S
Ran into a little problem with the My3d lightmapping... It cannot be effected by dynamic lights at all...
I tried setting the material type to EMT_LIGHTMAP_LIGHTING, and setting EMF_LIGHTING to true. No luck!
After a forum search, I found a patch that apparently gets BSP dynamic lighting to work, however, it didn't work with My3d.
Any ideas? Thanks
________
Suzuki Tl1000S
Last edited by disanti on Sun Feb 27, 2011 11:12 pm, edited 1 time in total.
Zdimitor's sample project has some rotating dynamic lights affecting My3d meshes.
It was part of latest version full download on his site but I just checked it and it seems to be down. Let me compress it and I'll upload it for you after I get home.
Edit: site's up but it's a relatively big DL (16 mb):
http://my3dproject.nm.ru/
dl link:
http://my3dproject.nm.ru/downloading/My ... 6.full.zip
but the zipped app is only 3mb. Let me know if you need it and I'll upload it.
It was part of latest version full download on his site but I just checked it and it seems to be down. Let me compress it and I'll upload it for you after I get home.
Edit: site's up but it's a relatively big DL (16 mb):
http://my3dproject.nm.ru/
dl link:
http://my3dproject.nm.ru/downloading/My ... 6.full.zip
but the zipped app is only 3mb. Let me know if you need it and I'll upload it.
Wow, thats bigger than Irrlicht! I'll take a look.
Edit: Absolutely NO luck after looking through examples... what was the point of that?
Edit: Absolutely NO luck after looking through examples... what was the point of that?
Last edited by disanti on Sun Feb 27, 2011 11:12 pm, edited 1 time in total.
The problem is that there is absolutely no special code to get the dynamic lighting to work. In fact, the my3d object that did have dynamic lighting didn't have a lightmap.the point was to see how he used dynamic lights in his app and compare the code with yours.
Very big help:
Code: Select all
//---------------------------------------------------
// adds test scene (exported from 3dsmax5)
//---------------------------------------------------
mesh = smgr->getMesh("max5_test_dynamic_lighting/test_max5_text.my3d");
scene::IAnimatedMeshSceneNode* max5_text = smgr->addAnimatedMeshSceneNode(mesh);
max5_text->setDebugDataVisible(true);
MOTORCYCLE TIRES
Last edited by disanti on Sun Feb 27, 2011 11:12 pm, edited 1 time in total.
you're absolutely right!
I thought there was a
really weird. So I thought it was something to do in the material editor in the max 5 model (max5_test_dynamic_lighting folder) but the materials have got nothing in particular (besides the reflection layer in some of them).
I'll check it more calmly this afternoon. Now the curiosity bug bit me
I thought there was a
somewhere but there wasn't !!!!node->setMaterialFlag(video::EMF_LIGHTING, true);
really weird. So I thought it was something to do in the material editor in the max 5 model (max5_test_dynamic_lighting folder) but the materials have got nothing in particular (besides the reflection layer in some of them).
I'll check it more calmly this afternoon. Now the curiosity bug bit me
I just added:
And if I set the flag to "false" dynamic lights are turned off (duh! ), which only means dynamic lights are set on by default unless you set them to false.
mmmmmmmhhh... so far that... I'll keep on scratching my head
Code: Select all
mesh = smgr->getMesh("max5_test_dynamic_lighting/test_max5_text.my3d");
scene::IAnimatedMeshSceneNode* max5_text = smgr->addAnimatedMeshSceneNode(mesh);
max5_text->setDebugDataVisible(true);
max5_text->setMaterialFlag(video::EMF_LIGHTING, true);
mmmmmmmhhh... so far that... I'll keep on scratching my head
He said he tried that in his first post! I have used that flag and it does work but make sure you have set up a decent light/set of lights as it can be really subtle depending on the size of the mesh and the position of the lights etc.
An easy way to tell is just import an my3d mesh with a lightmap on some surfaces but not on others then add a light and use LIGHTMAP_LIGHTING -- you should see some shading on the parts without a lightmap (technically the mesh is all lightmapped it's just easier to see the effect on a non mapped part).
An easy way to tell is just import an my3d mesh with a lightmap on some surfaces but not on others then add a light and use LIGHTMAP_LIGHTING -- you should see some shading on the parts without a lightmap (technically the mesh is all lightmapped it's just easier to see the effect on a non mapped part).
yes,I know, I wanna only said, that's working pretty good without any extra code - for me it was ok at first time - It seems, I had luck
But that's right, sometimes it is nesessery to play a bit with light's radius/ distance/ etc..
EDIT: Lightmapping on My3d's is pretty important for me, so im tried couple of scenes and that's what im noticed :
Sometimes when EMT_LIGHTMAP_LIGHTING is added to the mesh, its getting very dark in Irrlicht.
You can resolve this problem by incrasing faces / polys of your mesh.
In 3DStudio, you can do it by applying modifiers like "Tessellate" or "Mesh Smooth" to the mesh.
But that's right, sometimes it is nesessery to play a bit with light's radius/ distance/ etc..
EDIT: Lightmapping on My3d's is pretty important for me, so im tried couple of scenes and that's what im noticed :
Sometimes when EMT_LIGHTMAP_LIGHTING is added to the mesh, its getting very dark in Irrlicht.
You can resolve this problem by incrasing faces / polys of your mesh.
In 3DStudio, you can do it by applying modifiers like "Tessellate" or "Mesh Smooth" to the mesh.
-
- Posts: 322
- Joined: Tue Aug 30, 2005 10:34 am
- Location: slovakia
I actualy did running dynamic lights on lightmaped my3d meshes, but it changed the light map very strangely (darkened it upand so on), I just used the flags like you disanti but only with the multyplyer of M4 I think, it was one of the very first things I did in irrlicht .... simply the results vere strange... I dodn't like the idea of lightmapped textures taking dynamic lights on them, it simply can't be done the way you want it
what is this thing...