Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Pages: 1 [2] 3

Author Topic: Normal Maps  (Read 67918 times)

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Normal Maps
« Reply #15 on: January 27, 2016, 10:37:16 pm »

Raxx: there are two problems that I've found in the bulldog model's normals:

1. The model imports into Anim8or with some creases because the solid angle between some adjacent faces is greater that 45 degrees. Changing the Smooth Angle in the mesh properties dialog to a higher number fixes this.

2. Anim8or computes binormals with rather different directions on adjacent faces. Then it smooths them across between adjacent faces for a consistent transform space.  The results can interpolate poorly.  I'm looking into a fix for this.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Normal Maps
« Reply #16 on: January 28, 2016, 02:15:37 am »

Hey Steve, in the render of it I posted earlier, I had already set it to 180. I've tested it in Blender and Unity3D and it works great in both of them. Oddly, in 3ds Max the UV seams stood out badly and I couldn't figure out how to fix it. I attribute it to my lack of expertise in that software :P

Hopefully fixing #2 will do the trick!
Logged

$imon

  • Sr. Member
  • ****
  • Posts: 540
    • View Profile
Re: Normal Maps
« Reply #17 on: January 28, 2016, 03:52:09 am »

Wow, nice new feature, Steve! It's a great step for Anim8or. My viewport was messing up because of the GLSL shader issues with my (Nvidia) graphics card, but it's looking promising!

Raxx, I tried out your model in 3d Studio Max and I think you have answered your own question already earlier. Try checking 'flip green' in the normal map.
« Last Edit: January 28, 2016, 05:01:07 am by $imon »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Normal Maps
« Reply #18 on: January 28, 2016, 05:01:01 am »

$imon, already tried it and just about every option, no dice. I know 3ds Max is -Y on green, but changing it didn't affect the seams. It's probably something else I missed. I'm not too concerned since I don't have any intention of learning the program right now.
Logged

Hypure

  • Full Member
  • ***
  • Posts: 124
    • View Profile
Re: Normal Maps
« Reply #19 on: January 28, 2016, 06:56:48 pm »

New toys, thanks Steve.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Normal Maps
« Reply #20 on: January 28, 2016, 09:16:15 pm »

Raxx: I'm making progress.  There was a bug in the way that I computed binormals but when I averaged and normalized them for rendering it worked mostly OK. Here's some images of the normals, and the binormals before and after.

But there's still a problem: The texture map coordinates aren't continuous - there are huge differences in the ST values for the same point in adjacent triangles. You can see the transition from reddish to greenish in the new binormals. This causes the remaining hard edges. I think I can fix it by comparing adjacent faces' binormals and if they are going in opposite directions flip one of them, sort of like I do for normals in the "Fix Normals" command.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Normal Maps
« Reply #21 on: January 29, 2016, 02:14:39 am »

No wonder it was a mess! From the little I researched about it, it seems one way people resolve this is by splitting/detaching the vertices where the UV seams are located. This way both sides will have their own correct set of values to read from.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Normal Maps
« Reply #22 on: January 29, 2016, 08:49:41 pm »

Further investigation shows that the normal map texture, after mapping to the model, has discontinuities where these seams appear.  See the first two images below.  I've also posted an image with the specular weight exaggerated to highlight Anim8or'x curent results.

I'm at a loss to know how it eliminates the edges.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Normal Maps
« Reply #23 on: January 30, 2016, 05:36:28 am »

Looks like you've nearly fixed it! Are you making sure to load it in linear space and not srgb/gamma space?

The texture itself does have discontinuities, as you've said. You can see the seams in the other programs if you look close enough. I can't say if it's the same level as what you've currently got though, just looking at the image. Having matcap turned on in Sketchfab shows not as much seam issue as in your bottom picture. Perhaps it's related to the texture filtering or UV handling? Are mipmaps getting in the way?
« Last Edit: January 30, 2016, 05:36:51 am by Raxx »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Normal Maps
« Reply #24 on: February 01, 2016, 08:34:49 pm »

It is a bit weird. I created a plane, split it into various divisions and unwrapped it so that there would be UV seams all over it, then baked random details onto it. It's a fairly perfect texture with no visible seams on the texture itself. However, with the normal map applied, the seams are there blended and so it iterates flipping the normals around. In the attachments, you can see what I'm talking about. Is there no way to internally split the vertices at the seams so that the binormals are calculated correctly per-vertex rather than blended?

Also, a bug I keep forgetting to report: When adding a normal map to an existing material, the entire material gets shades darker until it's saved and reloaded. Also, if you click in Anim8or while it's loading a texture or the file itself in the beginning, it crashes (win 10). Would be nice if this was prevented.

Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Normal Maps
« Reply #25 on: February 01, 2016, 11:41:41 pm »

I see the issue.  It looks like I need to add diacontiguous binormals where UV's are discontinuous.  I'll look into it. That might also help with the original creases in your previous example with that shiny, nasty-looking dog :).

Here's the texCoord0 view. As you can see, it's discontinuous on the boundaries.  The binormals should be the same.
« Last Edit: February 01, 2016, 11:48:08 pm by Steve »
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Normal Maps
« Reply #26 on: February 02, 2016, 03:32:53 am »

That might also help with the original creases in your previous example with that shiny, nasty-looking dog :).
Don't judge it! It's been through a lot. It got stuck in an oil spill and we had to wash it with brand name soap!
:P


(jk I think its good that dawn helps when those horrible things happen)
Logged
¼

Smirkyguy

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Normal Maps
« Reply #27 on: February 10, 2016, 10:53:04 pm »

Is the workspace going to render normals or will this just be a final renders thing
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Normal Maps
« Reply #28 on: February 10, 2016, 11:03:26 pm »

I don't see why it wouldn't or shouldn't, I mean if you are already running opengl 2.0 (with glsl) then why not... right?
Logged
¼

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Normal Maps
« Reply #29 on: February 11, 2016, 09:33:34 am »

All normal map functionality will be in final renders, including the crease change (if it works as I think it will :) )
Logged
Pages: 1 [2] 3