Inverting normals bricks MDL halp
![Oso3D](https://farnsworth-prod.uc.r.appspot.com/forums/uploads/userpics/964/nKUSSXH2JM34Y.jpg)
So I have a weird problem with my free Normal shader.
All it does is use the Normal brick, strips out the Y component, and uses that as a mask. That's cool.
Eeeexcept it seems to get... weird about Normal map. It treats the overall geometry right, and then seems to invert the effect of the normal map. If I set Normal Map to negative, great, the mask looks right but now it's clinging to the tops of... holes. Which is, again, not what I want.
I can fix the problem if I set X or Z scale to negative. So it seems that the Normal map is being 'understood' as the inverse of how it appears.
I tried accessing the Y component of the Normal map, but that ended up looking wacky and broken.
Anyone know of a coderly way of effectively flipping the scale like that, or otherwise inverting/rotating/??? the normal?
I tried multiplying the components of the normal by 1 or -1, but the only result that was noticeable was multiplying Y by -1, which simply flipped the whole mess upside down.
(First image is the effect of Snow Cover, which ... wuuut? Second is same thing but X scale is set to 100%. It looks right, but it's suuuuper inelegant to ask people to do that to all their stuff, and it'd be a big problem for figures and posing)
![](https://farnsworth-prod.uc.r.appspot.com/forums/uploads/thumbnails/FileUpload/ad/aaef7783eef127121080720a7268ad.png)
![](https://farnsworth-prod.uc.r.appspot.com/forums/uploads/thumbnails/FileUpload/ad/aaef7783eef127121080720a7268ad.png)
![](https://farnsworth-prod.uc.r.appspot.com/forums/uploads/thumbnails/FileUpload/27/5e9c255eb409c35054fdea040e5a35.png)
![](https://farnsworth-prod.uc.r.appspot.com/forums/uploads/thumbnails/FileUpload/27/5e9c255eb409c35054fdea040e5a35.png)
Comments
Here's a Normal -> Base color example. If you look at it... all the 'bumps' seem reversed from what you'd expect. Doing something similar in 3DL does not do this, the layout of bump normals looks like you'd expect.
??? The heck?
Hmm. Maybe if you posted a picture of the shader tree (and/or the MDL code) we might be able to figure it out a little easier. Bump/Normal maps distort the surface normals to achieve their effect, so you might have to re-work how the bump map gets applied (i.e., have the bump map take its normal from the output of your calculations, rather than from the original surface geometry.....)
Well, the MDL is easy to produce the above;
Bricks/Functions/MDL/state/Normal
Connect it to Base Color in 'PBR Metallicity Base'. Put in a Normal map. And there you go.
If I 'invert' the object along one axis (like X scale = -100%), I get the normal values I expect and it still looks right.
Hrm.