Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, ozgur, AbrahamR, wdlmaster), 849 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
NormalMap - 2D or 3D #58747
11/11/05 12:27
11/11/05 12:27
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Its been a while since I have been here, what with one thing and another...

My question(s) are based around normalmap's, and from the perspective of generating these for use within GS. To my understanding there are two types of Normalmap, which I call 2D and 3D although im sure this is not an accurate description.

Let me clarify a little. When you process a texture with a tool like Nvidia's Normal map plugin for adobe, you produce a 2D normal map. When you texture bake a normal map from a 3D object you create a true 3D normal map. It's usually easy to see the difference of these two types of map, 2D's are pink and blue and 3D maps tend to be yellow, green, pink, blue and everything in between.

For a better description please check out the tutorials I have posted on my clan site if you would like more information:

2D Normal Map
3D Normal Map

For the last few years I have been working with a AAA game engine developing expansions and other modifications, working very closely with the developers. Now during some testing with their engine I encountered a number of problems with normal maps and I wondered if anyone had some experience of these issues with GS and really just to explore the topic a little further.

So I noticed that with a 2D normal map, you will get display inacuracies, namely with the normal mapping having the opposite effect on the reverse of a model. i.e if the front of the model is raised, it's rear using the same normal map seems to be inverted. Now maybe I am applying this incorrectly and hopefully someone here will put me right. However I suspect I am correct in this matter as these 2D normal maps are just that, they are missing the 3rd axis and this is why the results are inconsistant and at best, poor looking.

So the obvious next step is to produce a 3D normal map, in my case, baked through 3D Studio Max's texture baking system, producing far better results. For example the human model I am baking at the moment is embedding much of the 18,000 polygon model into the 2000 poly one.

However in this other engine, i noticed some issues with 3D normal maps, when being rotated or moved, their shadows seemed to stay with the object, instead of re-adjusting. In other words a rotating barrel's self shadow rotated with it. Now im 90% confident this is simply bcz that particular engine's shader system was, flawed.

So I would be interested to know how GS handles these 3D normal maps.

I have taken the liberty of including a simple normal map in both 2D and 3D versions to wrap around a simple cylinder:


2D Normal Map


3D Normal Map

I have also added a small vid clip of these normals in action in the 'other' engine for reference. However in this clip the objects are not also rotating, so the shadowing is accurate here. Additionally I have added a link to another video of a fully normal mapped room, that is 1 model with a 1024x1024 diffuse and normal map.


Applied 2D & 3D Normal Maps
3D Normal Mapped Room Model

In short I was not happy with the way the other engine handled the new shaders and so I'm considering returning to GS. Your feedback would be very useful. Thanks in advance.


The Art of Conversation is dead : Discuss
Re: NormalMap - 2D or 3D [Re: indiGLOW] #58748
11/11/05 13:07
11/11/05 13:07
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
The first map above is not just a 2d normal map. It looks like a tangent space normal map and the second looks like an object space normal map. It really depends which one your shader supports. You can also create tangent space normal maps with 3d programs. The baking plugin from ATI (which is included with a wrapper module in Lightwave or Blender) allows to switch between tangent and object space normals.

So I would check that first.

Edit: Don't blame the engine for the shader or the wrong made normal map. That is just a very small part of the engine at all. It is just eye candy stuff that can be easily fixed. And the video with the room looks fine.

Last edited by Frank_G; 11/11/05 13:12.

Models, Textures and Games from Dexsoft
Re: NormalMap - 2D or 3D [Re: Machinery_Frank] #58749
11/11/05 15:10
11/11/05 15:10
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Yes, it's all about tangent vs. world space.. world space normal maps are on;ly useful if the object will never move or be oriented differently from how the normal map was rendered. Essentially you will never want to use world space normal maps except in very rare cases...additionally, you may need to change how the shader works to use them properly.

Tangent space normal maps are much more flexible, and all games that i know of that use normal maps use mainly tangent space maps.

All normal maps encode 3d data, so that's not a good way to look at it.


Sphere Engine--the premier A6 graphics plugin.
Re: NormalMap - 2D or 3D [Re: Matt_Aufderheide] #58750
11/11/05 15:27
11/11/05 15:27
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
So using world based normal mapping for rooms, or for other non-dynamic objects but to use tangent based maps for other objects. But what about this problem of the normal map being convex on the reverse side of an object?

Applying the tangent map to a cube for example results (for me at least) with the map being inverted on opposite sides, and completly missing on other faces, when viewed in GS, or the 'other' engine for that matter. Is this a limitation of normal mapping?

As for my reasons for looking at switching back to GS as an engine, rest assured the problems with shaders are only a small part of the reasons. Originally I was approaching this for adding detail to static objects, it was only when I began moving them I noticed the 3D issue. Could the normal map shader not be addapted to cycle through the colours for orientation? I mean if Blue is east as the object rotates the hue does too, so tech you could offset the colour hue based on rotation...although this may be complete rubbish now i read what i have written


The Art of Conversation is dead : Discuss
Re: NormalMap - 2D or 3D [Re: indiGLOW] #58751
11/11/05 15:33
11/11/05 15:33
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
I havent had this trouble you talk about.. there are many things that can be wrong with a shader... sometimes there is an unavoidable seam if your model has mirrored UVs --though there isnt a good way to fix this for now...usually this isnt such a problem.

I dont ever reccomend using world space normal maps...bascailly you just need to experiment more and find better shaders


Sphere Engine--the premier A6 graphics plugin.
Re: NormalMap - 2D or 3D [Re: Matt_Aufderheide] #58752
11/11/05 15:47
11/11/05 15:47
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Well the results gained with world shaders on fixed objects, is considerably better than with tangent. Depth of detail can really bring the normal mapping to life. In fact I have seen little difference between the tangent normal mapping and standard bumpmapping... of course this may be bcz they are indeed the same thing

If you apply a tangent normal map to an object, illuminate one side and then take a look at the normalmap on the opposite side to the light. It is the opposite effect. I produced a simple object with a tangent based map and rotated it in GS. Close inspection i see the normal map on the reverse remains reversed and incorect as the object rotates.

Maybe you could point me at something that demonstrates this not to be the case... possibly the shader code I was using in my earlier GS experiments was incorrect or flawed itself, I was using one found somewhere on this site I believe...

I think that world based normals have their place, even if they are unsuited to dynamic objects, as the detail is considerably better and more realistic than any results I have had with a tangent based map.


The Art of Conversation is dead : Discuss
Re: NormalMap - 2D or 3D [Re: indiGLOW] #58753
11/11/05 16:15
11/11/05 16:15
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Did you ever think whether the shader supports tangent space at all? When you use an object space shader with a tangent space map it could look very strange and false. I did that once with a shader from ello.


Models, Textures and Games from Dexsoft
Re: NormalMap - 2D or 3D [Re: Machinery_Frank] #58754
11/11/05 16:53
11/11/05 16:53
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Well I have decided to do some tests, maybe you could point me at a good normal map shader?

I am baking a torso and head for testing and will upload screens as I go.


The Art of Conversation is dead : Discuss
Re: NormalMap - 2D or 3D [Re: indiGLOW] #58755
11/12/05 13:37
11/12/05 13:37
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Ok so after a little discussion here, I delved back into the fray. Realising that I had generated my tangent maps using a photoshop plugin and not through Studio Max in the way that I was creating the world maps...

Clearly my frustration with tangent maps, (2D normal maps ), was rooted in the way I was creating my maps and not the way the shader engine handles the map. So a little lesson in, 'why not to try and teach your grandma to suck eggs..', later and I am once again excited about the power of normal mapping.

Thanks for your help guys I have taken the liberty of rating you guys highly for your help, for what thats worth.

For a limited time I have uploaded a demonstration of these findings and the comparison between world and tangent normal mapping... although it seems as usual I am the last to learn anything here... ...it might prove useful to someone...


Tangent / World Normal Mapping


The Art of Conversation is dead : Discuss
Re: NormalMap - 2D or 3D [Re: indiGLOW] #58756
11/12/05 14:56
11/12/05 14:56
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
From the look of it, I can say your normal map has inverted Y values. This is THE MOST ANNOYING THING EVER with normal mapping.. !!!!

ok, sorry, this is one of my pet peeves..I will explain:

there are two 'standards' for normal maps, the ATI standard with 'inverted Y' and the Nvidia standrard non-inverted Y. In practice, this has nothing to do with how hardware works or Nvida vs ATI, but simply how you write your shader. The upshot of this is, it is a completely trivial thing that causes all sorts of confusion. Basically, most of the shaders you will find on this forum that use normal mapping use the NON-inverted Y method for normal maps. You can usually specify this in whatever program you use to make the normal map.


Sphere Engine--the premier A6 graphics plugin.
Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1