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?
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?
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.
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.
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.
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.
Replies
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?
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.
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.
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.
bad luck for now, but thanks for your input.