Does anybody have a DirectX viewport shader (.fx mat) that allows you to pick the UV channel of the normal map?
I'm working on an object with different mapping channels for the diffuse and normal, and neither Ben Cloward or Xoliul's shaders provide for that.
Replies
http://icy-bee.co.uk/multi-channel-nrm-shader.rar
Basically it take 3 target spots (lights) and expects a diffuse/spec as well as a normal. Hopefully after I have spend some more time I will add other options like opacity and gloss maps but for now I will catch some zeds.
Hey, Surfa. I'm looking through the shader here and it looks like there's some provision for flipping the Y direction, but it's not completely set up. Do you mind if I mess with this some?
EDIT: Okay, I have a selectable green channel flip working for the normal map - it's an ugly, ugly hack with a snippet of code I copied out of one of Ben Cloward's shaders, but it works. Surfa, shoot me a PM and I'll send you the flippable version.
EDIT 2: EDIT HARDER: I take that back. It looks like I'm managing to swap two tangents somewhere instead of just flipping green. On further inspection this chunk of code looks like it was supposed to check for Y-up orientation (to differentiate between Max, Maya, etc), and it's swapping two different things instead of inverting just Y. Needs more work...
Btw if you are wondering about flipping the green channel you just access the y value of the normalmap and negate it.
Thanks Surfa, this is perfect! I had trouble decyphering exactly which variable was the normal map's Y channel. I think what I was doing was transposing x and y somehow.
Yes please. Also yeah if possible add a lightmap with a channel selection as well.
Man, I haven't done much code since high school... I wish I had a HLSL function reference.