Hi,
Few questions.
1. Using Maya 2016. I can't seem to get the ShadowMap node to work in any regard, anything I plug the 'light gain' value into turns flat orange. I believe multiplying this by the final color output should essentially darken areas where shadows would be, correct?
2. If not, how do you 'take' the shadows Maya is generating so that they can be multiplied into the emissive?
3. Finally, is there a way to allow the user to define X amounts of texture inputs? I want them to be able to select the amount of texture nodes that will be blended.
Replies
As for having a dynamic amount of texture inputs I posted a thread asking about this earlier. Sadly I don't think there's any solution. I didn't get any replies, but I'm doubtful. I did try a For Loop and couldn't get it to work with textures at all.
http://polycount.com/discussion/162571/shaderfx-trying-to-use-texture-maps-with-a-for-loop-possible
I did actually, and I tried to merge stuff together and.. it would never work. The result is always a flat orange color which is ALWAYS the result with the ShadowMap node. It works for them, however even if I rebuilt it EXACTLY, it will never work for me period. Nothing is different, the shadowmap node breaks everything if I use it myself.
I think it's bugged but that doesn't make sense why it works for them and not me. This is just frustrating, I need to know why I can't use the one node that does what I'm trying to do.
Edit: Noticed these errors spamming my script editor:
// Warning: Line 154.119 : Redeclaration of variable "$shaderfxCmdprimvariableName" shadows previous declaration at line 151. Previous value will be overwritten by explicit initializer. //
Most of the times when I've tried it I've just copied the relevant shader group inside the Traditional Game Surface shader and used it in my own shader project. Has worked fine.
Speaking of the orange color. Did you switch to DX11 viewport?
There are a few other cases I have stumbled upon which always seems to throw that orange error color. Such as using the float4 output of a lerp into the float4 input of your pixel shader. Even though you have full control and know that the lerp output shouldn't be outputting anything iffy.
If I remove these nodes from the equation it works and all my problems are solved!
However these nodes are only ever a problem when I'm either grabbing a 'shadow map' node from the sidebar or duplicating someone else's shader network.
Note that I work in Z-Up in Maya so I've removed the flip UV.y
What are you working on by the way? Some kind of soft shadows?
I'm making a system for doing hand-drawn animation style in 3D and using anime as a basis. This shader is one small piece of it. However it means the shadows need to work in emissive instead of diffuse as there's no shading (unless desired, but not usually).
All working now
Edit: Argh, the shadows are all jagged. No idea why. Fixing later I guess.