Home Technical Talk

[ShaderFX + Maya] ShadowMap node doesn't work (and other questions)

Vii
Vii
polycounter lvl 6
Offline / Send Message
Vii polycounter lvl 6
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

  • Vii
    Options
    Offline / Send Message
    Vii polycounter lvl 6
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Did you have a look at the Traditional Game Surface shader how it uses shadows? That's how I usually do it when I decide to use shadows.

    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.
  • kodde
  • Vii
    Options
    Offline / Send Message
    Vii polycounter lvl 6
    kodde said:
    Did you have a look at the Traditional Game Surface shader how it uses shadows? That's how I usually do it when I decide to use shadows.

    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.

    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. //
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    So you get shadows working with the default Traditional Game Surface shader? But not when trying it to build it yourself?

    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.
  • Vii
    Options
    Offline / Send Message
    Vii polycounter lvl 6
    I found where the problem is!

    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


  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    Strange...

    What are you working on by the way? Some kind of soft shadows? :)
  • Vii
    Options
    Offline / Send Message
    Vii polycounter lvl 6
    kodde said:
    Strange...

    What are you working on by the way? Some kind of soft shadows? :)
     Turns out I don't have to disconnect the node! I just renamed it and it worked, I appended a '1' and all was OK. Guess there is a name clash.

    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.
Sign In or Register to comment.