Nodes/ComfyUI-PBRFusion4/Normal Map Flip Y (DirectX/OpenGL)
ComfyUI Node

Normal Map Flip Y (DirectX/OpenGL)

Your bumps are upside down

By Night1099·Created 7 months ago·Updated 4 months ago· 19
Normal Map Flip Y (DirectX/OpenGL)
  • normal_map
  • normal_map

Every 3D artist has hit this one eventually: the normal map looks perfect in the texture viewer, you plug it into the engine, and suddenly your bumps are dents. Normal Map Flip Y (DirectX/OpenGL) (AIXPOLY_NormalMapFlipY) is the two-second fix for that, packaged as a node.

A normal map encodes surface orientation, and that orientation is defined relative to a coordinate convention. DirectX-style normal maps put Y pointing down; OpenGL-style put it up. The same texture interpreted under the wrong convention renders inverted - raised details look sunken, and it's one of those bugs that's completely obvious in the render and completely invisible in the map. Converters, bakers, and engines each pick a convention, and when two of them disagree, you need a flip.

How it works

The green channel of a normal map encodes the Y axis. Flipping the convention is just inverting it: the node computes 1.0 - green across the image, which turns an OpenGL map into DirectX and back. That's the entire mechanism - one channel, one operation, nothing else touched. It's the same transform any proper normal-map converter applies, just inline in your graph so you never have to leave ComfyUI to fix it.

Why you'd pair it with this pack

This node exists because the pack's generator makes you choose. The PBRFusion4 Simple Depth & Normal Generator has an opengl_normal boolean - false (the default) outputs DirectX format, true outputs OpenGL. If you've already generated with one setting and your target pipeline expects the other, you have two options: regenerate with the flipped boolean, or drop a Flip Y node on the wire. The node is also handy when you're mixing normal maps from different sources (baked maps, Substance, other depth tools) that don't agree on convention.

Inputs and outputs

Minimal, which is the appeal:

  • normal_map - any normal map image (the normal or normal_scharr output of the generator works perfectly).

The single output is normal_map - the flipped version, same dimensions, same everything except the green channel. Wire it straight into a Save Image or directly to whatever consumes the map downstream.

Install

Part of the ComfyUI-PBRFusion4 pack. Search "ComfyUI-PBRFusion4" in ComfyUI Manager and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Night1099/COMFYUI-PBRFusion4

Then restart ComfyUI. It's pure channel math - no model download, no GPU load, runs in a blink.

Gotchas

  • It doesn't tell you which convention you have. If you're not sure whether your map is DirectX or OpenGL, flip it and look - one of the two will be right. When a bump suddenly reads as a dent, this node is your answer.
  • Don't flip a tangent-space map blindly expecting a fix. The green-channel invert is correct for the OpenGL/DirectX difference; it won't fix a map that's simply wrong or misbaked.
  • As with the rest of the pack, if the node doesn't show up, the pack's opencv-python-headless dependency is missing - install the pack's requirements and restart.
CategoryPBRFUSION4/Utils

Inputs (1)

NameTypeDefaultDescription
normal_mapIMAGE

Outputs (1)

NameTypeDescription
normal_mapIMAGE