Board index FlightGear Development Effects and shaders

Bump mapping possible bug ?

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Bump mapping possible bug ?

Postby Harald » Sat Jun 18, 2016 10:50 am

I wanted to add bump mapping in the interior model shader since it is missing, but I first tried the regular bump mapping from Effects/model-combined-deferred (I also tried the non ALS version of the bumpmap shader bumpspec.eff).

The problem I see is that the rendering is incorrect in some situations that depend of the direction of the light or the orientation of the surface.

Here are two screen shot of an aircraft panel, you need to look at the bottom of the gauge and compare it to the rest of the panel.
One screen shot is with some texture found on the net, in doubt I also took another texture that is supposed to work ie the tail-normal.png texture from the c172p. If you don't see it open the picture in full screen ; the bumps are going inside instead of going outside, or the other way.

Image
Image

Are my eyes tricking me or is there a real problem of light computation (or are the textures badly computed...or the tangent and binormal) ?

The panel is a one sided surface and the problem is visible on other objects too.

hj.
Harald
 
Posts: 179
Joined: Fri Mar 02, 2007 5:30 pm
Location: Strasbourg, France
Version: nightly
OS: Windows 10

Re: Bump mapping possible bug ?

Postby Thorsten » Sat Jun 18, 2016 12:25 pm

I'm sorry, I have no clue from your description what is going wrong.

If you believe a normal points the wrong way in code you added, why don't you try flipping it? It's kind of hard to judge whether you did the computation the right way without seeing the code. Are you sure things are in the coordinate system you believe them to be?
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Bump mapping possible bug ?

Postby Harald » Sun Jun 19, 2016 7:31 am

I think it's just my eyes...

the result is ok with another test texture.

Image

hj.
Harald
 
Posts: 179
Joined: Fri Mar 02, 2007 5:30 pm
Location: Strasbourg, France
Version: nightly
OS: Windows 10

Re: Bump mapping possible bug ?

Postby DFaber » Sun Jun 19, 2016 9:00 am

Harald wrote in Sun Jun 19, 2016 7:31 am:I think it's just my eyes...


Maybe not. When creating bumpmaps with Gimp, there is an option to flip x/y Axes. Setting this wrong may cause Bumpmap normals to be reversed on certain parts (not all). That depends on the UV Layout. Seeing the UV Layout of the panel may give a hint.

Greetings
Detlef Faber
FlightGear Development:
http://flightgear-de.net

my 3D-Art:
https://www.sol2500.net
DFaber
 
Posts: 709
Joined: Fri Dec 01, 2006 8:51 pm
Location: Aachen, Germany
Version: GIT
OS: Linux


Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 2 guests