Parallax Mapping with dynamic Shadows

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
magisterrivus
Posts: 33
Joined: Sat Aug 05, 2006 9:46 pm

Parallax Mapping with dynamic Shadows

Post 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
under construction
magisterrivus
Posts: 33
Joined: Sat Aug 05, 2006 9:46 pm

Post 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 :)
under construction
magisterrivus
Posts: 33
Joined: Sat Aug 05, 2006 9:46 pm

Post 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.


:?:
under construction
magisterrivus
Posts: 33
Joined: Sat Aug 05, 2006 9:46 pm

Post 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:
under construction
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post 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.
Image
magisterrivus
Posts: 33
Joined: Sat Aug 05, 2006 9:46 pm

Post 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*
under construction
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post 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.
Image
Falcon
Posts: 36
Joined: Sun Jan 13, 2008 9:24 pm
Location: Z_California

Post by Falcon »

Is there a file format that supports the Tangent Mesh data needed for Paralax mapping?
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Falcon
Posts: 36
Joined: Sun Jan 13, 2008 9:24 pm
Location: Z_California

Post 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?
-< Dante >
< Industry Senior QA Tester>
< IT Project Manager>
< Independent Programmer>-
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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).
mjoselli
Posts: 6
Joined: Fri Mar 14, 2008 8:57 pm

Post by mjoselli »

Is there a file format that supports the Tangent Mesh data needed for Paralax mapping in the 1.4 sdk?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, you have to create it manually. Follow example 11 in order to convert the mesh and textures as needed.
Post Reply