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 6208 times)

Steve

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

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: 1447
    • View Profile
Re: Normal Maps
« Reply #16 on: January 28, 2016, 07: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, 08: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, 10:01:07 am by $imon »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Normal Maps
« Reply #18 on: January 28, 2016, 10: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: 123
    • View Profile
Re: Normal Maps
« Reply #19 on: January 28, 2016, 11:56:48 pm »

New toys, thanks Steve.
Logged

Steve

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

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: 1447
    • View Profile
Re: Normal Maps
« Reply #21 on: January 29, 2016, 07: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: 1532
    • View Profile
Re: Normal Maps
« Reply #22 on: January 30, 2016, 01:49:41 am »

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: 1447
    • View Profile
Re: Normal Maps
« Reply #23 on: January 30, 2016, 10: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, 10:36:51 am by Raxx »
Logged

Raxx

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

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: 1532
    • View Profile
Re: Normal Maps
« Reply #25 on: February 02, 2016, 04:41:41 am »

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 02, 2016, 04:48:08 am by Steve »
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 901
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Normal Maps
« Reply #26 on: February 02, 2016, 08: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 11, 2016, 03:53:04 am »

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

cooldude234

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

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: 1532
    • View Profile
Re: Normal Maps
« Reply #29 on: February 11, 2016, 02:33:34 pm »

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