Babylon.js: Add support for Secondary Normal Map / Detail Normal Map

Created on 25 Feb 2019  路  6Comments  路  Source: BabylonJS/Babylon.js

Feature request as requested in the forum discussion.

  • Link to forum discussion about the feature
  • Feature description
    Add support for a secondary normal map with possibly different scaling which gets blended with the main normal map.
    This is a feature in popular game engines such as Unity or Unreal.

Quote from the Unity documentation

Secondary Maps (or Detail maps) allow you to overlay a second set of textures on top of the main textures listed above. You can apply a second Albedo colour map, and a second Normal map. Typically, these would be mapped on a much smaller scale repeated many times across the object鈥檚 surface, compared with the main Albedo and Detail maps.

The reason for this is to allow the material to have sharp detail when viewed up close, while also having a normal level of detail when viewed from further away, without having to use a single extremely high texture map to achieve both goals.

Typical uses for detail textures would be: - Adding skin detail, such as pores and hairs, to a character鈥檚 skin - Adding tiny cracks and lichen growth to a brick wall - adding small scratches and scuffs to a large metal container

As mentioned by PatrickRyan in the forum discussion this might be a feature for 4.1.
Thank you for looking into it.

enhancement help wanted in progress rendering engine

All 6 comments

I finally came up with a method to do it!
https://github.com/GreyWorks/Babylonjs-tests/tree/custom-pbr-material

I also made a post in the original thread about it
https://forum.babylonjs.com/t/secondary-maps-detail-maps-detail-normal-possible/1449/9

Sadly I don't have the time to fully flesh it out and make a pull request out of it.

Well we should be able to do it for 4.2 :) (or 4.1 if we have time cc @sebavan)

This sounds interesting, is anyone on it from @GreyWorks example?

I still work with the code mentioned above.
We use it for a project at work with other extensions but basically it is still the same thing. But we know the constraints of the project so the lack of completeness is not that problematic.
Sadly I don't have the time to dig deep enough to make the rest reasonably consistent.

but it's "working" right? I am about to do a deployment of this one and start rooting around if you don't feel like I am stepping on your toes.

I have a client who needs this kind of behavior and even if I do a custom deploy with it, Ill be happy to of saved the time.

Sure thing! Feel free to do so.
It works fine within the constraints mentioned on the forum post.
It would be really great if more people could use it 馃槂

Was this page helpful?
0 / 5 - 0 ratings