Home Technical Talk

animate .cgfx shader

polycounter lvl 14
Offline / Send Message
fade1 polycounter lvl 14
i tried to animate the uv coordiantes of a .cgfx shader, but i can't see anything in the maya viewport. does anybody know if this is a general problem of .cgfx or is there a way to display this in maya?

Replies

  • rebb
    Offline / Send Message
    rebb polycounter lvl 17
    Did you try wiggling the Camera around or push the Playback Button ?
  • fade1
    Offline / Send Message
    fade1 polycounter lvl 14
    of course i did hit play. ;)
    basically i just want to see basic uv animation, like uv offset or repeat in the realtime viewport. what works fine with normal texture nodes placed in i.e. lambert, maked no effect within a cfx shader. anybody tried this before?
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    Cgfx shaders probably don't display maya's animation on the vertex data. The cgfx plugin probably link the shader with the original mesh data.
    You can easily do the animation inside the cgfx. You just need to create a float parameter and look for the "time1" node (Show DAG objects, with a right clic in the outliner). You can then link the time node and the cgfx shader together into the connection editor. Out Time > YourCustomParameter and use that value as you want.
  • Brice Vandemoortele
  • fade1
    Offline / Send Message
    fade1 polycounter lvl 14
    thanks a lot brian.
    if i underatnd this right, i have to implement code in every cgfx shader i use for each animation i want to support?
    is there a way to use the maya uv placement node of the cgfx shader in hypershade to feed the cgfx shader with the animation data? we would need this to display our game shaders in realtime.
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    Probably yeah. But you can do texture animation on the vertex shader and use the same for every specific shader you write for maya. The problem here really is that the animation is just a scroll and that you only control its speed.
    If you want to animate with keyframes (you can animate parameters in maya), you'll need to export somehow that info to you game engine. It might be easier in the end to just do everything on the cpu side in your engine and feed the modified uv data to the shader.
    But if it's only about scrolling then it should be pretty easy to implement.
  • fade1
    Offline / Send Message
    fade1 polycounter lvl 14
    this is what we suspected. we really wanted all maya nodes to be animateable and viewable in realtime. as you decribed, the only way to get this is by coding everything in the cgfx shader. plus we need to add this feature to our game engine exporter.
    bad luck for now, but thanks for your input.
Sign In or Register to comment.