Bake texture ROP - different resolution UDIMS

   1382   3   1
User Avatar
Member
385 posts
Joined: July 2018
Offline
I have a a scene i am baking lightmaps for, but for some assets i need the resolution of the bake to be higher or lower based on a primitive attribute. Also i need the name primitive attribute to appear on the final jpg file.

i have already put together a small test scene using tops but its too slow and a bit of a hacky setup. i am sure there must be a better way.

I also made a simple bake setup without PDG to compare the render time and even if i have only one wedge, setting the resolution to 256 for all UDIMS, so only one final workitem that gets sent to the bake texture rop, the cook time is 3 times slower than if i just did a simple bake texture without using PDG and just setting the bake texture resolution to 256. Which i find weird

Any ideas?

Attachments:
baketextures.hip (2.4 MB)

User Avatar
Staff
585 posts
Joined: May 2014
Online
Keep in mind that work items in the ROP Fetch TOP run out of process. The ROP cook occurs as part of a script run using a separate instance of Hython that loads the .hip, cooks the ROP and reports output files. Depending on your platform and environment it can take a few seconds to spawn that process, so if your ROP only takes a few seconds that a large percentage of time will be spent just starting the child process.

Additionally, in the file you attached the geometry import TOP isn't actually doing anything useful. It's writing a SOP's geometry to disk, however nothing in the scene is loading back that cache file. That means when the ROP Fetch work item cooks the bake texture ROP, it'll have to cook the target geometry again anyways. There should probably be a file cache or file SOP somewhere that's loading in `@pdg_input` in order for that to work properly.

Using the same .hip file, I added a file SOP to load in the cached geometry and configured the bake texture to use it, then cooked it with same ROP Fetch node. For a fair comparison, I also used the Render to Disk in Background button on the underlying ROP so that it cooks out of process in the same way as TOPs. The resulting cook times are basically the same:



Edited by tpetrick - Oct. 1, 2021 16:50:44

Attachments:
background.png (12.5 KB)
tops.png (83.7 KB)

User Avatar
Member
385 posts
Joined: July 2018
Offline
This is very helpful info, thank you! can you please upload the updated hip?
Also is this the best way to output different resolution UDIMS?
User Avatar
Member
385 posts
Joined: July 2018
Offline
Here is an updated file. i removed the geometry import since it wasn't doing anything. and added a material sop to visualize the results.
I haven't found a way to use the name attribute inside the bake texture rop output yet. no idea how to do that

Attachments:
baketextures.hip (2.4 MB)

  • Quick Links