Home Technical Talk

Simple Normal Map Question

polycounter lvl 14
Offline / Send Message
Noth polycounter lvl 14
Is there a general rule of thumb for light direction in the green and red channels? I've seen all sorts of different directions, but generally light from above in the green channel and light coming from the right going to the left side, in the red channel. Yes/no? Does it matter? Seems for consistency's sake, it should matter?

Thanks!

Replies

  • pior
    Options
    Online / Send Message
    pior grand marshal polycounter
    left/right is pretty much always the same. Up/down is only a matter of preference, some call one "OpenGL" and the other "DirectX" but that's really an awful way to call them in my opinion since it is not self descriptive. Personally I stick to "light coming from the top" ("Green-up", "Y-up") unless forced otherwise by an engine. And everyone who disagrees is a dope.

    :D

    All that aside ... it's trivial to invert when needed. I'd stay stick with Y-up for display purposes, it's just more readable.
  • Noth
    Options
    Offline / Send Message
    Noth polycounter lvl 14
    Hey Pior, thanks for the reply. Just to clarify, by left/right do you mean coming from the left and going right? I've been doing Green-up and Red from right to left.

    I agree, it's trivial to switch, but I like the idea of consistency among a local team, so I'm just seeing if there's consensus among the global community first. 

    Thanks again!
    Cheers
  • pior
    Options
    Online / Send Message
    pior grand marshal polycounter
    I've personally never, ever seen anything else than red coming from the right.
  • Maximum-Dev
    Options
    Offline / Send Message
    Like Pior mentioned Red always comes from right.
    Green should be top down for Cryengine, but vice versa for UE4, some programs like substance painter let you switch between OpenGL and DirectX and there's really no rule of thumb at all.
    I don't know the reason behind these differences but as an artist this seems really stupid to me. Same goes for Spec/Gloss and Metal/Rough. Things could've been way more consistent than they are.
  • Noth
    Options
    Offline / Send Message
    Noth polycounter lvl 14
    Hey guys, thanks for clearing that up for me on the Red channel direction. 100% now. Cheers buds!
  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    FYI It's to do with the direction that DX vs GL renders. GL renders from the bottom left -1,-1 to top right 1,1. DX renders from top left -1,-1 to bottom right 1,1.

    The result is the same horizontal scan, but inverted vertical scan. Hence why the green channel in a DX map points down, hence why Allegorithmic name their normal texture outputs as Gl vs Dx.

    Edit: Also worth mentioning that at the end of the day it's arbitrary, developers can always flip their buffers etc. so labelling the difference Gl vs Dx only really explains the history, it's not a great descriptor.
  • Noth
    Options
    Offline / Send Message
    Noth polycounter lvl 14
    @Axi5 - That's great man! Really informative, that's what I was looking for. Root level stuff my friend. Knowing the history never hurts.Thanks! :DDD
Sign In or Register to comment.