Sign in to follow this  
bandages

3D What are the advantages of creating normal maps the hard way?

Recommended Posts

bandages    104

I've built some simple normal maps out of meshes and a custom HLSL shader that writes their normals to the screen.  While I've only used this for creating tiling normal maps, where I control the orientation of the mesh used to generate normals, I don't see why I couldn't do this for a full-model normal map, placing the models in screen space based on their UV rather than world-space coords, writing the normals of the low-poly to one image, the high-poly to another, and the vector necessary to transform the normals of the first to the second onto a third image.  With the tiling normal maps I've made, I haven't seen any artifacts or weirdnesses.  All it takes is one or two models, a relatively simple shader, and a single frame of computer time.

But when I visit modelling sites, baking normals sounds like a major headache, involving the creation of a cage and a lengthy bake process.  It sounds like the modelling packages are using some kind of raycasting algorithm.

There must be a reason not to be doing things the way that I've been doing them.  Can anyone explain to me the problems with creating normal maps via shader?

Share this post


Link to post
Share on other sites
Jihodg    1148

I don't exactly understand the method you are using... but I am guessing is very constrained to your specific use case, like a plane as a low poly version on a more detailed displaced version of it in just one axis. In the general case, the low poly and high poly models don´t have the same topology, and thus, they don´t share the same uv space... in fact, many times the high poly version of a model isn´t even uv unwrapped.

Share this post


Link to post
Share on other sites
JTippetts    12970

I've done normal maps the way you describe, and it does have its uses. However, baking normal maps is a mapping process, mapping from high-detail geometry to low detail geometry. In the case of baking a tiling planar normal map, you are going from high-detail geometry arrayed on a plane, to a plane. It's a pretty easy mapping, 1 to 1 with the XY coordinates of a particular location on the plane. A given feature simply projects directly to the plane 'below' it. When baking an arbitrary mesh, however, then it's not so simple. In this case, you need to find the point on the high-detail poly mesh that most directly corresponds with a given point on the low-detail poly mesh. This involves projecting onto the surface of the high-poly, and this projection is NOT a simple projection onto a 2D plane. Once you advance to that level of complication, it's much easier to do the work in a 3D package. Not to say that it CAN'T be done in your own way, just that the math and logistics become a LOT more complex.

Share this post


Link to post
Share on other sites
bandages    104

Thanks for your responses, I think I understand better now.

 

It sounds like it should be acceptable-- it's nice to know that some awful artifact isn't going to jump out at me-- and the real issue is matching UV coords, matching corresponding points/spaces.  There are certainly situations where this is easy via UV correspondence, like if your high poly is just a subdivided low poly, it seems like it would be trivial; what I was doing with planes was trivial.  But I can see now how there are situations where it wouldn't be trivial.

Share this post


Link to post
Share on other sites
JTippetts    12970

Yes, if the high poly is made by subdividing the low poly then it's not too difficult to bake yourself. You can build a workflow that ensures that. Some tools, however, allow dynamic subdivision while sculpting (see something like Sculptris, or Blender's dynamic subdiv). This allows more mesh detail in areas that need it, but can break the relationship between the high poly and low poly. If your workflow includes this, then the math becomes more difficult.

 

Additionally, I feel like you overstate the difficulty in using a 3d tool to bake normal maps. Tutorial videos make it seem more difficult than it really is. Once you understand the process, it can be a very quick thing. The actual baking setup and bake can take mere minutes.

 

Even for tiling textures, I now prefer Blender rather than my own older hand-tooled processes: 

 

Having access to all the other tools of a general purpose 3d tool makes all the difference.

Share this post


Link to post
Share on other sites
bandages    104

Thanks, that's easy to believe, and useful to know.  I actually made my own shader to bake lighting/mats/etc to textures in-engine before I discovered that in reality, there was nearly no difficulty involved in Blender baking.  So I can imagine the same is true with normals too.  (But, it wasn't bad HLSL practice either, not a bad way to get more comfortable with the concepts, not something I regret doing.)  So much just seems to be about finding the time to learn it, when there's so much to be learned, and difficult to know beforehand what's going to be hard to learn and what's going to be easy.

Share this post


Link to post
Share on other sites
Hodgman    51335

You've implemented a baker ;)

You're using a 2D cage in texture space and require the artist to exactly map both meshes onto that cage.

Other methods change the workflow for the artist, such as not requiring UVs at all on the high poly 

Share this post


Link to post
Share on other sites

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  

  • Similar Content

    • By Armantium
      Lip-syncing and believable facial expressions.
      I have Maya licence for 3 years, but I haven't explored this aspect yet, as I've focused on mechanistic animations so far. I was wondering if there is a specialized software outside of Maya  that would make this very easy and quick. I would only need it for 3-5 characters, but I suppose I could use the exact same facial animation mechanism for all of them.
      If you are an experienced Maya user, I would appreciate your response even more. If the easy and quick solution already exists in Maya 2018, I would hate the expenditure of an additional specialized software(also, how time-consuming would it be if you have about 1000 words of dialog).
       
       
       
       
    • By khawk
      CRYENGINE has released their latest version with support for Vulkan, Substance integration, and more. Learn more from their announcement and check out the highlights below.
      Substance Integration
      CRYENGINE uses Substance internally in their workflow and have released a direct integration.
       
      Vulkan API
      A beta version of the Vulkan renderer to accompany the DX12 implementation. Vulkan is a cross-platform 3D graphics and compute API that enables developers to have high-performance real-time 3D graphics applications with balanced CPU/GPU usage. 

       
      Entity Components
      CRYENGINE has addressed a longstanding issue with game code managing entities within the level. The Entity Component System adds a modular and intuitive method to construct games.
      And More
      View the full release details at the CRYENGINE announcement here.

      View full story
    • By khawk
      CRYENGINE has released their latest version with support for Vulkan, Substance integration, and more. Learn more from their announcement and check out the highlights below.
      Substance Integration
      CRYENGINE uses Substance internally in their workflow and have released a direct integration.
       
      Vulkan API
      A beta version of the Vulkan renderer to accompany the DX12 implementation. Vulkan is a cross-platform 3D graphics and compute API that enables developers to have high-performance real-time 3D graphics applications with balanced CPU/GPU usage. 

       
      Entity Components
      CRYENGINE has addressed a longstanding issue with game code managing entities within the level. The Entity Component System adds a modular and intuitive method to construct games.
      And More
      View the full release details at the CRYENGINE announcement here.
    • By ilovegames
      You are a US Army soldier, and one day an unknown enemy attacked your base. Now your task is to survive and protect the base. There are a lot of weapons in your arsenal. Survive this nightmare at any cost. 
      Download https://falcoware.com/Defender.php
       



    • By ilovegames
      Hold out as long as possible in the "Arena of Death." Only your skill and the correct tactics of combat will help you survive in the Arena. Nine types of weapons are at your disposal, but remember that cartridges are limited and they need to be spent wisely. You must prioritize the position and the type of weapons in order to achieve victory.   Awaiting you:   - 9 types of weapons - Dynamic gameplay - Different types of opponents, with their own characteristics and weaknesses - Increasing complexity   Download https://falcoware.com/DeadArena.php


  • Popular Now