TouchDesigner | Email | Level of Detail

LOD

Original Email – Tue, Jul 7, 2015 at 10:27 PM

Hi Mathew, I’m a 3D artist trying to learn touch designer and your videos have made a huge difference for me (I’ve been at it for a while), you also even helped me on the forums recently figure out how to control rotation of my instances along a curve. (if you’d like to see the finished version of that project by the way you may here:

What I desperately want to learn how to do now is build an LOD system based on distance to the camera that would change the material and replace the geo with a polyplane textured to look like the full res geometry or along those lines. In general i’m having a lot of issues figuring out exactly how to optimize my scene, even after extensively cleaning and rebuilding some of my networks I only noticed minuscule performance changes. I would greatly appreciate any advice you may have on this subject? Thank you so much for your wonderful website!


Reply – Thu, Jul 9, 2015 at 12:10 AM

I’m glad all of the tutorials have been useful – I certainly enjoy making them.

Optimization is one of the hardest parts of working with touch, and I certainly feel your frustration in trying to get a system up and running that’s rendering high quality visuals at a respectable frame rate.

If you haven’t had a chance yet, I highly recommend reading through the Optimizing for Geometry for Rendering article on the wiki. I frequently return to that piece of documentation when I’m stuck.

Also look at:

The better your understanding of how Touch is rendering, the easier it becomes to think about how you optimize and reorganize your scenes. A general rule of thumb that’s important to keep in mind is also the importance of translating objects at the Geo level, rather than performing transformations or changes to SOPs (sorry if this is something you’re already thinking about). Geos are computed on the GPU, while SOPs are computed on the CPU – this is something that will make or break you. The less you’re actively cooking your SOPs the better your performance will be (in general). This also makes it extremely important to understand instancing (and I’d include texture instancing in here as well). Without seeing any of your scenes, it’s hard to tell you where your bottlenecks are, so these are mostly my best guesses.

When possible, use CHOPs for your animation and control. DATs and Python are excellent additions to TouchDesigner, but in general CHOP math is much faster – calling and interpreting your scripts is slower (generally, though not always) than the hard coded operations performed CHOPs.

Don’t forget that the performance you see in the network viewer is always slower than when you’re in perform mode. It’s hard to know exactly how well you’re performing, unless you add a performance monitor to your output window so you can watch your frame count while you’re not rendering your programming environment.

Remember that Touch is a pull based system, not a push system. Only the computation needed for rendering the scene is run – this, however, can get you into trouble if you’re using complex sets of composites and crossing elements. In general, I try to always use select operators when possible, rather than ins and outs. It’s also a good idea to think about deck systems (AB crossing) when possible.

Finally, your question about LOD systems. I haven’t done much with this, so I’m doing a bit of guessing here. In the attached TOE file there are two different examples – project1 and project2. In both projects, make the Container’s viewer active, and click on the geometry and then on empty space.

Project 1 takes the tack of adjusting the level of detail for the selected geometry in relation to the distance from the camera. In general, I don’t know that this is a good approach. SOPs are the most expensive operators, and my best guess is that this approach wouldn’t necessary scale. I don’ t know that for sure, but that’s my hunch.

Project 2 takes the approach of subbing in a high resolution image for a piece of geometry based on camera distance. This would take some futzing, and would get complicated the more complex your scene is… but without knowing what direction you’re headed exactly – this is my best guess at how you might think about it.

Hope this pushes you in the right direction… or at least in a direction.

Keep up the good work – your video looks awesome.

Cheers,
M

Download the example from GitHub – LODinitialIdeas