Hi,
I have a few questions.
I have read tutorial about parallax mapping and I know how to do this but it's only describe problem when loading mesh from .3ds in code. I have made scene in IrrEdit (few models from .3ds). And I'm loading it in my code by LoadScene("file.irr") . But mesh in scene have no information about tangent. So what now? I have an idea to iterate all node in scene, generate new mesh with tangents (like in tutorial), delete in scene the old one and add the new. But this is stupid. Is there a better way to do this?
Second thing is that, that if I place a light near mesh with parallax mapping everything is ok, but if there is no lights the mesh have no texture. I want no lights, and want to display mesh properly with parallax.
And last thing. When I set in IrrEdit parallax (in material) mesh is black. Why? If IrrEdit don't support parallax why not display it simply with first texture? When I place some objects in my scene and set parallax, all is black and I don't recognize them, is there a way to display them correctly?
I use Irrlicht 1.5 and IrrEdit 1.5
Custom loading scene
per pixel lighting example -->
I used this with a .3ds file I made in Blender and it worked fine.
not sure about your second question, i always have lighting in my scenes. Isn't that the point?
Code: Select all
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(
roomMesh->getMesh(0));
not sure about your second question, i always have lighting in my scenes. Isn't that the point?
-
- Posts: 11
- Joined: Sat May 23, 2009 11:39 am
- Location: Poland
Well that's not an answer I want.
I use LoadScene to load .irr file. After that ,all models are loaded to scene manager. So to correct parallax I must get each node, unload, create with tangents, and load again. And that is very stupid.
I don't want lights. If I load simple solid mesh everything is ok, I see it. But when I load mesh with parallax i can't see unless I place any light.
I use LoadScene to load .irr file. After that ,all models are loaded to scene manager. So to correct parallax I must get each node, unload, create with tangents, and load again. And that is very stupid.
I don't want lights. If I load simple solid mesh everything is ok, I see it. But when I load mesh with parallax i can't see unless I place any light.
-
- Posts: 11
- Joined: Sat May 23, 2009 11:39 am
- Location: Poland
Ok, here is more information to my second question.
I have one mesh with parallax mapping in my scene and one light.
It doesn't matter if I set node->setMaterialFlag(video::EMF_LIGHTING, false) or node->setMaterialFlag(video::EMF_LIGHTING, true) it always display mesh correctly. But if I do not add light to my scene, mesh is not displayed. And it doesn't matter too what I set in material flag.
How can it be?
My first and third problems are still open
I have one mesh with parallax mapping in my scene and one light.
It doesn't matter if I set node->setMaterialFlag(video::EMF_LIGHTING, false) or node->setMaterialFlag(video::EMF_LIGHTING, true) it always display mesh correctly. But if I do not add light to my scene, mesh is not displayed. And it doesn't matter too what I set in material flag.
How can it be?
My first and third problems are still open
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
You want per-pixel light without lights? Just learn what this technique means. You can use .irrmesh format to support tangent information in the mesh, otherwise you have to set the node's name to some special value, search for that node and convert the mesh manually. 3ds files also support parallax mapping automatically, just set the materials properly.
-
- Posts: 11
- Joined: Sat May 23, 2009 11:39 am
- Location: Poland