Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Pages: [1] 2 3

Author Topic: Normal Maps  (Read 6223 times)

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Normal Maps
« on: January 27, 2016, 01:16:33 am »

Build 1213 of Anim8or now supports Normal Maps.

Attached is a sample project.
« Last Edit: January 27, 2016, 04:46:27 pm by Steve »
Logged

neirao

  • Sr. Member
  • ****
  • Posts: 570
  • Neirao
    • View Profile
Re: Normal Maps
« Reply #1 on: January 27, 2016, 06:20:24 am »

thanks for this new version Steve! :)
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 901
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Normal Maps
« Reply #2 on: January 27, 2016, 08:29:27 am »

NICE
Logged

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: Normal Maps
« Reply #3 on: January 27, 2016, 11:49:02 am »

Had a try or two with normal map but anim8or crashes.
update...that was with a subdivided sphere with spherical uv mapping.
it worked ok with a basic mesh,i then subdivided the sphere afterwards and anim8or didn't crash.
update 2 seems ok now...but it did crash the first two times...will play some more.
update 3 perplexing :o just crashed again using a simple rectangular object.
anyone else getting this?
« Last Edit: January 27, 2016, 12:16:26 pm by captaindrewi »
Logged
!

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Normal Maps
« Reply #4 on: January 27, 2016, 12:16:59 pm »

Hey Steve, glad it's finally in there! Normal maps load fine for me. I do have a suggestion, and that is to allow more options to specify for the normal maps. It'd be nice if there could be a button next to the normal map load button, that points to a dialog like this:


The current issue is that Anim8or only supports Object Space normal maps. Tangent Space is best suited for models with repeated or changed UVs (such as most game models). If the object was, say, mirrored, the normals would look flipped in Object Space, such as in the video below (rendered in Anim8or). In fact, I'd say that Tangent Space should be the default mode in Anim8or (more reading here).


If Tangent Space was supported, it'd look correct (like in the image below)


Also, since not all models and normal maps will be created from the same source, their handedness might be different than Anim8or's default. Red might be flipped (X-) or actually represent Y+, not X+. I'm guessing Anim8or is X+, Y+, Z+. Some programs like 3ds Max is X+, Y-, Z+ or a different variation. Hence why the Swizzle option in the dialog box would be spectacular, since the user can adjust it based on their incoming files.

Couldn't get attachments to work, so click here to download the .an8 file used in the examples above.
« Last Edit: January 27, 2016, 12:26:08 pm by Raxx »
Logged

neirao

  • Sr. Member
  • ****
  • Posts: 570
  • Neirao
    • View Profile
Re: Normal Maps
« Reply #5 on: January 27, 2016, 05:17:42 pm »

Steve,
Normal Maps, work very well
but, only for test i create a new texture, a Bump Map texture
based in your normal map "EC_Stone_Wall_Normal.jpg"(see attachments)
but when i try render(raytrace mode and "antialias" ) the blocks with (normal map+another block with bump map)

"sometimes" the render stop, and not ends... is a bug?
(demo in attachments)

thanks
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Normal Maps
« Reply #6 on: January 27, 2016, 06:09:19 pm »

Something that seems to be a bug: Ambient intensity changes to the scene's global lighting setup doesn't affect normal map objects.

Also, Anim8or seems to crash *a lot* when in the scene editor at seemingly random times.
Logged

neirao

  • Sr. Member
  • ****
  • Posts: 570
  • Neirao
    • View Profile
Re: Normal Maps
« Reply #7 on: January 27, 2016, 06:21:25 pm »

yes, PS: i try the render only in "object mode" not in scenes.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: Normal Maps
« Reply #8 on: January 27, 2016, 06:22:21 pm »

Raxx: I thought Anim8or is using tangent space maps.  They are transformed by the normal/bi-normal/tangent matrix before they are used.  Object space normal maps are used as-is.  I'll check my math and see if I'm doing something else wrong.

neirao and Raxx: I'll look into the crashes.  If you have an example that reproduces a crash fairly reliably please post it.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: Normal Maps
« Reply #9 on: January 27, 2016, 06:59:34 pm »

Here's another Anim8or project that uses a Z-brush normal map that I got here: Tanget space tutorial  Anim8or shows the proper bumping "in" and "out" that the map indicates.  What am I missing?

Play the scene to see things rotate.
« Last Edit: January 27, 2016, 07:00:13 pm by Steve »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Normal Maps
« Reply #10 on: January 27, 2016, 07:34:50 pm »

Hey Steve, it could be correct afterall, except for the case shown in the sample I uploaded earlier. I assumed it was object-space because of that and some tests I made using other models found online gave weird results when they had textures with repeated UVs. I guess it's just the repeated UVs that's wrong?

Whatever it is, would still be useful to have those extra options.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: Normal Maps
« Reply #11 on: January 27, 2016, 07:47:34 pm »

Yes, I agree that options to support multiple types of normal maps is good.

Note: I've found a major issue when the normal map texture weight is less that 100% in the scanline renderer, and a very minor one in the GLSL code (but it's small so that you'd probably not notice it).
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1448
    • View Profile
Re: Normal Maps
« Reply #12 on: January 27, 2016, 08:58:02 pm »

I found a good example to compare what's shown in Anim8or vs what it should look like. The reference is located here: https://sketchfab.com/models/fd449cfec6a04659a840f5ffe3da9e63

Sketchfab:


Marmoset Toolbag:


Anim8or:


There are apparently a few visual disparities. One is that in some areas (like in the shoulder), it's washed out. It's certainly not as crisp in any areas as in the top two images. The other thing is that it seems that face normals are blending/influencing the normal map. There are polygonal creases and shading. Aren't they supposed to be completely overridden by the normal maps?

Dog an8 file and textures
« Last Edit: January 27, 2016, 08:59:40 pm by Raxx »
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
    • View Profile
Re: Normal Maps
« Reply #13 on: January 28, 2016, 12:31:09 am »

The normal map is rotated by a 3x3 matrix consisting of the normal, bi-normal and tangent vectors to align it to the orientation of the face. Theoretically these three vectors form an ortho-normal matrix.

Anim8or computes a binormal for each vertex based on it's normal and du/dv directions of the texture coordinates.  Then the normals and binormals are interpreted across the triangle.  Each pixel then computes the tangent = normal X bi-normal. These should be interpreted smoothly across the surface.

If these three vectors aren't more or less orthogonal, or if they aren't smoothly interpreted across the edges between adjacent faces, then the whole thing falls apart.  My guess is that Anim8or isn't computing a good set of binormals.

So I'm looking into it.  I downloaded the model in the link to work with.

On another note: does anyone have a good example of something that crashes or loops?
Logged

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: Normal Maps
« Reply #14 on: January 28, 2016, 02:06:46 am »

i can recreate a crash pretty consistently load a sphere ....load a diffuse and a normal map ....every thing ok here if i render.....pause there a moment........Now go back and reload the same maps again.....anim8or goes white screen and crashes for me at this stage even before i hit the render button, sometimes after i hit render[scanline]
slightly different results depending on what maps i use.
but it happens with just a basic sphere mesh,the EC normal map you supplied and any diffuse texture.

« Last Edit: January 28, 2016, 02:15:37 am by captaindrewi »
Logged
!
Pages: [1] 2 3