Daniel Posted June 14, 2005 Share Posted June 14, 2005 I've written my first custom vex function using the HDK. Seems to be working fine, but the "cleanup" function doesn't seem to get called. I put a cerr<< statement in the init and cleanup func to test if they were called. the Init is called right away and the cleanup doesn't seem to be called (using the vex func in a surface shader for testing). Any ideas? I followed the example pretty much exactly. anyone get the cleanup to work properly? thnx daniel Quote Link to comment Share on other sites More sharing options...
Jason Posted June 14, 2005 Share Posted June 14, 2005 Hey Daniel, I've asked about the Cleanup function wrt to Mantra, and the answer I have got before is that SESI allows the OS to perform the cleanup in Mantra - because apparently it does it very fast. Unfortunately this can be rather awkward for custom VEX ops that might want to call it but you can force a clean to be called by inserting a command into the IFD after the ray_raytrace command to force a reset: ray_raytrace ray_reset -l -a ray_quit (I hope I got the ray_reset arguments correct, this is all from memory...) Quote Link to comment Share on other sites More sharing options...
Daniel Posted June 15, 2005 Author Share Posted June 15, 2005 Hey Daniel,I've asked about the Cleanup function wrt to Mantra, and the answer I have got before is that SESI allows the OS to perform the cleanup in Mantra - because apparently it does it very fast. Unfortunately this can be rather awkward for custom VEX ops that might want to call it but you can force a clean to be called by inserting a command into the IFD after the ray_raytrace command to force a reset: ray_raytrace ray_reset -l -a ray_quit (I hope I got the ray_reset arguments correct, this is all from memory...) 18763[/snapback] Hmm.. thanks for the response. I'll dig a bit further. I've built a vex function that uses the new sdf class.. I build the sdf and cache it in memory on the first lookup since build time is slow and geometry doesn't change during a rendered frame.. so looking up at each shading sample is quite fast once it's built and cached. This works fine in the shader context since in effect a cleanup happens when mantra finishes. My func is also accessable in the geometry context.. My sdf is cached on the first call, but there is no clear "end" of cook that I can find.. so I don't get a signal to free the cache. I assumed the cleanup would do this, but as I said it's not being called. I'm sure I can find some other ways to trigger a cache cleanup.. I'll keep looking around and send a question to SESI thnx d Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.