Home Technical Talk

time variable in cgfx?

polycounter lvl 11
Offline / Send Message
wenglish polycounter lvl 11
hello, I am wondering if there is a builtin variable for time in nvidia cgfx. unity has a builtin variable _Time, is there something comparable for normal cgfx for use in 3d packages?

Replies

  • wenglish
    Options
    Offline / Send Message
    wenglish polycounter lvl 11
    I figured it out, it is actually really easy. you just create a variable with the semantic :TIME eg
    float flogicsAwesomeTimer : TIME <string UIWidget = "None"; > ;
    

    one gotcha is that (at least in XSI) the changes appear only when you click play on the animation timeline. anyway, hope that helps someone.

    ps i learned about this by looking a the "mrWiggle" shader that ships with XSI (and i think its in maya as well) it uses time to drive vertex deformations and is pretty interesting. so if anybody is ever looking for this in the future thats a resource you can use
  • radiancef0rge
    Options
    Offline / Send Message
    radiancef0rge ngon master
    Yeah, in pretty much all DCC time is based on the FPS of the timeline. Im positive this is true in Maya at least.

    If you want it to just play without the timeline you could try to query the milliseconds of the system clock. I don't know how to do that in XSI but I have done it in Maya and fed that into ShaderFX.
  • wenglish
    Options
    Offline / Send Message
    wenglish polycounter lvl 11
    that sounds interesting. using the timeline isnt a big deal, although i am curious aboout getting it to use the system clock. how'd you do it in maya?
Sign In or Register to comment.