YOUR ACCOUNT

Login or Register to post new topics or replies
jitspoe
Posts: 189
Filters: 27
I tried generating diffuse, specular, and normal maps and putting them in a game, but after scratching my head for a while trying to figure out why it looked so weird, I realized the normal maps were backwards. At first I was going to file this as a bug report, but then somebody informed me that DirectX normal maps are backwards, which I assume is what you're generating these normal maps for. In OpenGL, Y is up. In DirectX, Y is down (what were they thinking?). I inverted the bump map and thought that fixed it, but X ended up being backwards (which wasn't quite as obvious).

I personally think Y should be up by default. It just makes more sense, and I think is more widely used. OpenGL is available on almost every platform: Windows, Linux, MacOS, Unix, and even some consoles. It's also used in a number of professional 3d rendering applications, such as Maya. When Y is up, you can also just look at the normal map and it visually "looks right", since lighting usually comes from the top and you'll have green/cyan highlights there. When the green is on the bottom, it just looks inverted.

Anyway, enough with my opinions -- this definitely needs to be an option (or did I just overlook it?).
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Yes, probably it's my fault that we don't have this -- the devs told me about this but it seems that simply I forgot to add this to the plan. We'll add this as soon as possible.
  Details E-Mail
jitspoe
Posts: 189
Filters: 27
Much appreciated.
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
It looks like the flip you need can be achieved by simply inverting the G channel of the resulting normal map -- this can be easily done in Photoshop.

Also, we spent a hour today thinking about including this feature into the final release and encountered several problems, all non-technical. For example, if we add options to flip R and G channels of the resulting normal map, some of the generated normal maps will not visually correspond to the preset thumbnails of presets which were saved with 'Render Maps > Normal Map' turned on, and to the normal map on the website.
  Details E-Mail
jitspoe
Posts: 189
Filters: 27
True, but I'd rather have that than have to manually adjust the channels every time I render a texture, or worse yet, be stuck wondering why it looks so bad in-game because I wasn't aware the normals were backwards to begin with.
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Idea: we can show a balloon popup when the user turns the normal mapping on for the first time, and describe the backwards-normal issue and possible workarounds.
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
I'd second jitspoe's sentiment. Having an option that sets FF to default to either DirectX or OpenGL normal conventions would be preferable, IMHO. That way both DirectX and OpenGL application users can live happily everafter.

The balloon popup sounds like a very good idea for alerting users to this general issue (and the current default), but it shouldn't be an excuse for leaving them out there in the cold with having to fix this manually.
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Implementing these options is easy but it doesn't solve the visual mismatch problem (see my post above).
  Details E-Mail
jitspoe
Posts: 189
Filters: 27
The preview window looks like it only shows the complete render (is there a setting for that somewhere?), so the only visual mismatch would be with the website. I don't think anybody is going to be sitting there looking at the website saying, "Hey, this doesn't match," especially if you have a bubble help explaining the issue and the user had to manually change the setting.

Ahh, I see. You can save a preset with the normal map. That's simple enough to resolve -- just re-render the thumbnail. It seems to re-render thumbnails rather frequently anyway.
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
Vlad wrote:
Implementing these options is easy but it doesn't solve the visual mismatch problem (see my post above).


Now, I might be misinterpreting or missing something here, but isn't that visual mismatch really only a marginal cosmetical issue? As I read above, it would occur on pre-rendered normal map thumbnails and on library normal maps (since library renders default to DirectX convention, apparently). However, what counts for the user is getting the right output out of FF, reliably and without frustration.

Personally, I'd take the visual mismatch any day over having to manually fix my normals everytime. As a 3dsmax user, I'd like my normals mostly the DirectX way. When I work in modo though, I'd rather have them OpenGL'd. So, to me, a way to conveniently switch inside FF would definitely be the painless way.
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
jitspoe wrote:
just re-render the thumbnail. It seems to re-render thumbnails rather frequently anyway.


If I remember correctly, thumbnails for library filters are downloaded from the server, pre-rendered of course, and since the user can't change these factory presets, they are never re-rendered. So, that mismatch will remain...
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
Crapadilla wrote:
isn't that visual mismatch really only a marginal cosmetical issue?


Yep, this occurred to me as well when I was typing that post smile:)
I think a balloon and a set of options would be the best solution here.

Also, another remaining question is which options to include. The most obvious set would be OpenGL style (flipped green) and DirectX style (unmodified green). However, 3DS Max uses the following set of options for the normal map:

[ ] Flip Red (X)
[x] Flip Green (Y)
[ ] Swap Red and Green
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Quote
Vladimir Golovin wrote:
I think a balloon and a set of options would be the best solution here.


I concur.

Quote
Vladimir Golovin wrote:
However, 3DS Max uses the following set of options for the normal map: [...]


Well, I'll take your word for it, then. smile;) smile:D
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
jitspoe
Posts: 189
Filters: 27
If that's the case, it might be good to have a set of options, and then a set of presets. Something like,

X = (List) +Red|-Red|+Green|-Green|+Blue|-Blue
Y = (Same dropdown list)
Z = (Same dropdown list)

Then have a preset list, like:
OpenGL|DirectX|3DS|Custom

OpenGL would be:
X = +Red
Y = +Green
Z = +Blue

DirectX would be:
X = +Red
Y = -Green
Z = +Blue

And custom would let you set the values manually. You could also specify the axis by color -- I don't know which way is more straightforward:
Red = +X|-X|+Y|-Y|+Z|-Z
Green = +X|-X|+Y|-Y|+Z|-Z
Blue = +X|-X|+Y|-Y|+Z|-Z

OpenGL:
Red = +X
Green = +Y
Blue = +Z

DirectX:
Red = +X
Green = -Y
Blue = +Z

I guess the second way probably makes more sense, since you don't really have a +/- on colors.
  Details E-Mail
Eric Chadwick
Eric Chadwick
Posts: 24
Filters: 2
Sorry to dredge up an old thread, but I ran into this issue today.

The shaders in our real-time 3D software expect the red normals to point left, and green to point down. But FF only allows me to control the green channel, not the red.

Not a huge problem, I can easily invert my red in Photoshop. I'd just like to second the request to have toggles for the normalmap directions in the FF options.

Thanks!
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Eric, there's a related option in Tools > Options > Rendering > Normal Map Generation -- does it work for you?
  Details E-Mail
Eric Chadwick
Eric Chadwick
Posts: 24
Filters: 2
The option only inverts Y, but I also need to invert X. FF assumes X is pointing to the right, but our shaders assume the opposite.
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,715 Registered Users
+5 new in 7 days!

153,538 Posts
+7 new in 7 days!

15,348 Topics
+72 new in year!

Create an Account

Online Users Last minute:

12 unregistered users.