Author Topic: normal map  (Read 4256 times)

2017-09-11, 17:46:17

walterfog

  • Active Users
  • **
  • Posts: 88
    • View Profile
Hello at all,

as Nikola ask me, i open this thread about normal map. After made some test, I finally reach the result that for me the shader Corona normal don't work in the right way. I speak about the last daily beta built available on OSX system.
I here attach the JPG result and also the C4d r19 project with the 3 sphere and the 3 different corona materials, with the 3 options i choose to test:
1 - normal in bump channel
2 - normal in corona normal shader
3 - normal in corona normal shader, but using a level, with the inverted normal and the color 127 127 255 to regulate the intensity of the normal

The only that work fine is the 3 sphere, with the third material, that is the same way work fine till the A6.1 alpha version. the 2 sphere work fine but the normal is inverted... the 3 sphere, don't work in my opinion... the result is totally wrong.
Let me know what you thinks
thanks
walter

2017-09-11, 20:28:59
Reply #1

Eddoron

  • Active Users
  • **
  • Posts: 545
  • Achieved Pedestrian
    • View Profile
I tried your scene.
First of all, when using normal maps, always use the normal shader or it takes it as a bump/height map and only considers luminance.
The normal map's channels seem to be inverted. I'm no expert on marble but in my opinion, the cracks should go inwards, not outwards.
The red color in the normal map should be projected from the right but is coming from the left. Seems as if it was made for a game engine.(or at least generated with those setups)

It just looks like the channels were swapped or inverted(doesn't look like a standard OpenGL normal map),
you can fix that easily in the normal shader's menu.

Here's what I changed:

I left 3. as it was for comparison. That's the look you wanted.

For 2. I inverted Red and Green. The result is the same as 3. (A bit hard to see with that light setup)

As for 1. I used the normal shader again and just inverted the green. Red wasn't necessary to be changed anymore. Dents go inwards.

(Latest Daily build)

2017-09-12, 09:10:13
Reply #2

walterfog

  • Active Users
  • **
  • Posts: 88
    • View Profile
I tried your scene.
First of all, when using normal maps, always use the normal shader or it takes it as a bump/height map and only considers luminance.
The normal map's channels seem to be inverted. I'm no expert on marble but in my opinion, the cracks should go inwards, not outwards.
The red color in the normal map should be projected from the right but is coming from the left. Seems as if it was made for a game engine.(or at least generated with those setups)

It just looks like the channels were swapped or inverted(doesn't look like a standard OpenGL normal map),
you can fix that easily in the normal shader's menu.

Here's what I changed:

I left 3. as it was for comparison. That's the look you wanted.

For 2. I inverted Red and Green. The result is the same as 3. (A bit hard to see with that light setup)

As for 1. I used the normal shader again and just inverted the green. Red wasn't necessary to be changed anymore. Dents go inwards.

(Latest Daily build)


Thanks for your reply but maybe you don't understand the whole problem. The normal map i posted have the name " marble " but don't be fooled by the name... I could use this normal where I want.. he don't be necessary use for marble this is only a technical try no matter where are going the cracks.. we agree that the 1 test, normal in bump channel don't work.. ok!!
After this, the results i " want " is the number 3 cause it is the right way that this normal map have to work.. i've taked this normal from a objects collection made for another render engine.. it is a collection made by bentaji.com for maxwell render... so I only try to convert the maxwell material in to a corona material... bringing map and set a corona material... in maxwell render ( not only even vray ) the normal work in the same right way, in corona not... so we could suppose that the problem stay inside corona normal shader and not in the map. In fact the 2 case i show ( normal in corona normal shader ) demonstrate what you are saying.. corona shader we don't know why, invert the color and the result is what we see: the result it is inverted.
We can't imagine to  have to modify and invert the color of all the normal map we got... the are hundred and hundred, and then the consequence will be that the normal will work with corona but not with the other engine... so in my opinion, the problem stay inside corona, and we could expect that this will be fixed soon.
Could you post the scene of your result with the normal you modify???
« Last Edit: 2017-09-12, 09:49:25 by walterfog »

2017-09-12, 12:56:01
Reply #3

draekser

  • Active Users
  • **
  • Posts: 28
    • View Profile


just click on flip Y (green), it is not a long or hard process.

Corona normal map is OpenGL normal, no direct x Normal.

2017-09-12, 13:26:09
Reply #4

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 1676
    • View Profile
Yes, it would be reasonable to think that all normal maps are created equally and are "the same thing" - but unfortunately there are different types of them around, which is why there are the options to Flip Red and Flip Green, to accommodate the different kinds that are out there.

2017-09-12, 13:47:33
Reply #5

walterfog

  • Active Users
  • **
  • Posts: 88
    • View Profile


just click on flip Y (green), it is not a long or hard process.

Corona normal map is OpenGL normal, no direct x Normal.

I'm sorry but I made other test, with other normal map and using your method of swapping red or green or both... the result is similar but the corona normal shader don't work well for me, and the results is not equal to the one gives other engine.... the only way to obtain the exact result is using a leveled material as I posted in my scene, and not changing the normal color... OpenGL or direct X I expect that a map, work fine in any engine render...  that's my opinion...

2017-09-12, 14:47:24
Reply #6

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 1676
    • View Profile
It would be interesting to see the renders from the other engines, as the question you have relates to the final result (but we haven't seen the final results yet so not sure what we are comparing to, and what the differences are :) ). Could you share those renders, and the material set ups for them?

Thanks!
   Tom

2017-09-12, 15:04:45
Reply #7

draekser

  • Active Users
  • **
  • Posts: 28
    • View Profile
hmm, for you the good result it's the material with level ?

i tested with flip x AND flip Y, i get the same result   (sorry for my English, i'm a french user with limit skill)
« Last Edit: 2017-09-12, 15:08:33 by draekser »

2017-09-12, 15:12:54
Reply #8

TomG

  • Corona Team
  • Active Users
  • ****
  • Posts: 1676
    • View Profile
Yes for me flip red and green is giving the same result as the layered (with only a slight difference in intensity). It would be interesting to compare to the other render engine.

I rendered the same sphere twice, so it's in an identical position, and took out the red colour just to make it easier on the eyes. The first image is the "desired result" (that is, using the layered shader - though would be good to see the same render from the other engine for a better comparison), the second is flip red and flip green, no layer, adjusted normal strength to 325 (though there wasn't that much difference if I left the intensity the same - not that the intensity really matters, it's ensuring the direction of the surface is going the same way).


2017-09-12, 16:36:08
Reply #9

Eddoron

  • Active Users
  • **
  • Posts: 545
  • Achieved Pedestrian
    • View Profile
Quote
When loading a normal map in the texture picker, the options Flip X, Flip Y, and Wide specify how the normal map was created. The most common standard is ‘Flip Y’, so this is selected by default.

This is from the Maxwell Documentation(http://support.nextlimit.com/display/maxwell4/Surface+Properties under normal maps)

Maxwell has a different material system with its layers and it's known to produce good results but I highly doubt that the normal map would look very different. The only thing that could be wrong is the direction and/or strength of the bumps.

Also, could it be that the other engine uses a different image filter size making the map appear sharper, blurrier?
« Last Edit: 2017-09-12, 17:03:23 by Eddoron »

2017-09-13, 15:10:05
Reply #10

kmwhitt

  • Active Users
  • **
  • Posts: 95
    • View Profile
draekser above states:



just click on flip Y (green), it is not a long or hard process.

Corona normal map is OpenGL normal, no direct x Normal.

I find the opposite to be true.  DirectX normals work just fine in Corona (at least as exported from Substance Painter/Designer).  Would someone from the Corona team please confirm the proper format for normals?  Thanks Kevin

2017-09-13, 18:23:32
Reply #11

Eddoron

  • Active Users
  • **
  • Posts: 545
  • Achieved Pedestrian
    • View Profile
Sure they work. It just depends on the settings. SPainter has the option to export the files in dx or opengl format and if you choose the corona preset it'll make sure that the proper ones are exported.

2017-09-13, 18:32:03
Reply #12

kmwhitt

  • Active Users
  • **
  • Posts: 95
    • View Profile
I'm not using the Corona export settings from within Substance.  The normal maps I use are definitely formatted DirectX and they work as intended in the Corona normal shader without swapping or flipping any of the settings - which leads me to conclude Corona uses DirectX not OpenGL.  Would be good to hear from support on this.

2017-09-13, 20:01:59
Reply #13

Eddoron

  • Active Users
  • **
  • Posts: 545
  • Achieved Pedestrian
    • View Profile
Huh, you really might be right.

I tried it with one of my older models which does use a dx map.
Left to right:
1.No map 2. DX map(linear of course) in corona normal shader 3. Same as 2. but Y inverted.

In other engines(except for game engines) this map's Y has to be flipped.


This is now a bit confusing because I often had to invert dx maps in corona.
I'll see if I find my old sculpt and if so, then bake out a new OpenGL map. But in the meantime, it would be nice to hear from the support.


2017-09-13, 20:05:40
Reply #14

kmwhitt

  • Active Users
  • **
  • Posts: 95
    • View Profile
Attached are the normal images I used to test.  The only one giving proper results is DirectX.