---
title: "Treasure Optimizations"
canonical: "https://rmanwiki-27.pixar.com/space/RU/657227977/Treasure%20Optimizations"
format: markdown
---
### Interactivity Optimizations

It’s incredibly important to get these 200+ million coins to render in a quick and optimized fashion and more importantly, parsing the scene efficiently is crucial for interactivity. Using instancing to achieve this really helped keep deadlines on track, as the first pixel went from 2 hours to only 5 minutes, making a huge difference to a humble single node render machine.


Houdini was a great tool to use to scatter a large quantity of gold coins and treasure. I started with a simple for-each loop to vary shapes of gold coins, cups, swords, helmets, etc. By utilizing height-field scatter trickery, I managed to create an underlying terrain geometry, which also had the same gold shader applied to it … welcome to CGI, where it’s all about faking things!

![various_treasure_geoSetup.png](media://febd999d-0fea-4aab-9b7f-3a3a190cb44d)


At this point, my instinct was to export a single USD file, which has a surprisingly (dare I say, satisfyingly) slim footprint on disk. Unfortunately, this workflow turned out too good to be true, as this independently loaded each piece of treasure … times 150 million.

This unexpected result led me to ask some experts if there was an optimization step I missed along the way.Nemanja Stavric (a dear friend and colleague) gave me the idea of combining them instead, so that we’re instancing larger clumps of treasure instead of individual pieces.

This solution helped me reduce first pixel times, at the expense of slightly higher memory usage.

![scattered_packed_andExported.png](media://6433e2b2-1fc9-498c-811f-28fa85b22540)

---