Sign in to follow this  

Normal Map for a Sphere

This topic is 2589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey there
I have a problem or/and not enough know-how with normalmapping
until now I used them only for walls and planes where everything worked well.
But no I tried to use them also for full 3d object, because I had a lot of problems
I started with a simple shere.

shader code is standard:
-transferring light,eye dirs in vertex shader to tangential space
-normals from map in fragment shader

The normalmap I generated in maya:
- low mesh with face normals
- high mesh with averaged vertex normals
- transfer map -> to generate normal map

Sadly I have now a problem at the edges of the triangles. Is there something I can do better or anyone knows this effect ???

thanks a lot...

simple shere using the normal map


the used normal map

Share this post


Link to post
Share on other sites
Well if you could treat spheres as a distinct sort of renderable geometry, you'd be better off
Generating the normals in a shader. Either interpolating between vertex normals,
Or computing the normals in a fragment shader according to the center of the sphere.
Do you need the normal map for anything in particular?

Share this post


Link to post
Share on other sites
the sphere is only to simplify the problem, I get the same with e.g. the teapot.
later I would like to have a lot of different objects with normal maps in my scene.

[Edited by - mede on November 10, 2010 4:56:53 PM]

Share this post


Link to post
Share on other sites
I think the problem comes from that your low res mesh has per-face normals. This causes sharp discontinues in your normal map since it's stored in tangent space and this creates discontinuities in tangent space. When the normal is bilinear filtered it sometimes reaches across the discontinuity and gives you bogus normals.

You should average the normals/binormals/tangents etc. on your low res mesh to avoid this.

You will still have artifacts along seams in in your UVs though for more complex objects so you will also probably need to use a tool to add extra border space to your texture and bleed out the color into it to make sure it filters correctly. I think maya may have a tool to do this.

Share this post


Link to post
Share on other sites
I think your normal map is just fine. Are you using
MIP mapping for your normal map? If so, please
disable it. The way you generate your normal map
making it not suitable for MIP mapping.

Share this post


Link to post
Share on other sites
Quote:
Original post by LucasM
You should average the normals/binormals/tangents etc. on your low res mesh to avoid this.
this.


this was exactly the problem...

things I changed now:
- use indexed triangle strip to have ONE averaged tangent, binormal, and normal vector for a vertex

- also use averaged normals for the low model in maya... the normal map now is different

space between uv seams is also a good hint. THX

for completeness here the new normal map which works fine:

Share this post


Link to post
Share on other sites

This topic is 2589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this