Page 1 of 1

Parallax Mapping with dynamic Shadows

Posted: Thu Aug 17, 2006 7:53 am
by magisterrivus
Hi all there.

After unsuccessfully trying to solve this problem, i was advised to post it in the Bug reports forum.

Here's the link to the original thread

http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=85853

Bye

Posted: Thu Aug 17, 2006 8:35 pm
by magisterrivus
Hello,

could somebody be so kind and test if this program shows the same bug (render artifacts) on his/her machine? I want to be sure it's not a driver issue (I recently had problem with driver updates, so i only do that if it is reaaally important...as it is for Irrlicht 8))

http://www.megaupload.com/de/?d=P9P13LN9

Everything is compiled, you only have to put the most recent (1.1) Irrlicht.dll into the folder where the ge.exe is located. Btw, it's compiled under VS2005, hopefully there are no errors because of missing runtime libraries (read about that somewhere on the forum :? )

Thanks in advance

PS:
If somebody can't download from megaupload, i'll up it again at a server of your choice :)

Posted: Fri Aug 18, 2006 10:35 pm
by magisterrivus
I just used the code from Tutorial 11, and added a ShadowVolumeSceneNode to the room, et voila, the same artifacts occur.
When adding the ShadowVolumeSceneNode only to the earthmodel, everything is fine.

Btw, a friend tried my program, and these artifacts are also visible on his machine, so it's not a driver issue. In OpenGL these artifacts are even more visible.


:?:

Posted: Sun Aug 20, 2006 3:33 pm
by magisterrivus
Strange enough nobody seems to have this problems (no answers), i found out that when using the 3ds format instead of obj i get the following error:

Error: Parallax map renderer only supports vertices of type EVT_TANGENTS

Whatever, i accept that problem to be never solved :cry:

Posted: Mon Aug 21, 2006 1:29 pm
by Spintz
That last post is not a problem, about the "Parallax map renderer only supporting vertices of type EVT_TANGENTS"

This is because Parallax Mapping requires Tangent and Binormal information for each vertex. You need to load your model, and the use the smgr->meshManipulator->createMeshWithTangents function. Then create a mesh node using the returned mesh from above function and setting that nodes material to EMT_PARALLAX_MAP_* .

I still don't know about your other problem, I use a different parallax mapping technique with my own custom shader.

Posted: Mon Aug 21, 2006 3:02 pm
by magisterrivus
Hi Spintz *honored*,

i didn't changed my code. Well, ok, i changed the fileextension in my sourcecode (obj to 3ds).
I don't think this should raise a problem in Irrlicht :).


I read in the beginners forum, that someone else has this problem too.
I assume it has something to do with the new version, also i didn't tried it with the 1.0 engine.

Whatever, thanks for your reply *wink*

Posted: Mon Aug 21, 2006 3:54 pm
by Spintz
as far as I know, .obj and .3ds do not load up with tangents and binormals. So you need to create them, and use a mesh with that format. Becuase the shader looks for 3 texture coords from a mesh for parallax mapping. The first is the actual texture coord( float2 ), the 2nd is the tangent( float3 ) and the 3rd is the binormal( float3 ). If you're mesh is not supplying these values to the shader, it can't work.

Posted: Mon Feb 25, 2008 1:33 am
by Falcon
Is there a file format that supports the Tangent Mesh data needed for Paralax mapping?

Posted: Mon Feb 25, 2008 8:57 am
by hybrid
Yes, I fixed obj yesterday. Was easier than I thought. So with either bump or map_bump you get the necessary meshbuffer type and a proper normal map. Oh, btw, I use parallax_solid as the type, maybe we should make this configurable via some attribute to choose from normal map and parallax map. You can also change this manually, of course.

Posted: Tue Feb 26, 2008 7:40 am
by Falcon
Ah yes, so you did! I hadn't looked at your code changes close enough. That solved another problem for me as well, which is a pleasant surprise. Thanks again!

Since I am trying to use Parallax, it is good as default for me, but as your first impression, it might be good as an optional parameter to the getMesh() function?

Posted: Tue Feb 26, 2008 8:22 am
by hybrid
No, it won't be a parameter, because too many options might arise with mesh loaders. There's an attribute based mechanism which passes parameters to the device (or scene manager?) and the loaders can access them there. It's not widely used right now, but we might enhance its usage in the future.
BTW: I also fixed the 3ds stuff (seems that the intensity percentage is there and I only met some other problems last time, or some very old 3ds files). The loader now also generates the tangents such that parallax maps are also supported for 3ds (although the non-smoothed faces will make this a little unpleasant).

Posted: Tue Mar 25, 2008 10:36 pm
by mjoselli
Is there a file format that supports the Tangent Mesh data needed for Paralax mapping in the 1.4 sdk?

Posted: Wed Mar 26, 2008 12:05 am
by hybrid
No, you have to create it manually. Follow example 11 in order to convert the mesh and textures as needed.