Jump to content

cache shader


MENOZ

Recommended Posts

Hello,

i see some shaders like principled shader and mantra surface comes with this sticky note inside.

 This network does not display VOP nodes because it is using cached VEX code from the HDA definition. Thus, it does not need VOPs to generate code. 

I was wondering how can I cache my  shaders to disk? 

what this implies exactly? the shader is read at rendertime from disk and this is just an interface to control its paramters, leaving the scene lighter. Can somebody give more details if I am missing something, and give me a better idea of how it works? are there other benefits?

thank you

Link to comment
Share on other sites

i think it only means that the shader has been published as an digital asset and therefore is locked to the user and VOPs are not displayed. but it doesn't mean it makes your scene lighter. it has to do all the math while rendering anyway. when you click "allow editing digital asset" from the dropdown menu displayed by clicking on that shader you will find out nodes are still there and you can make changes. so it's just a cosmetic thing I guess. anybody correct me if I'm wrong.

Link to comment
Share on other sites

  • 2 weeks later...

turns out when you create a digital asset from the material you can mark an option "save cached code".

I remember in older versions of houdini there was a way to load vex code from a file, I can't find how to do that. Nowdays with vops it doesn't makes a lot of sense this kind of workflow, but it would be interesting if it's still possible.

anyone?

Link to comment
Share on other sites

a few days ago I have coincidentally stumbled upon a docs page where I learned this: you can precompile (cache) your shader network by turning it into HDA. By doing that you loose an access to the "guts" of it (you only see promoted parameters), but Houdini doesn't have to compile the shader every time you want to render. on top of it, it works like instancing - the shader is only loaded once, regardless how many copies you want to render. in normal cases you don't care. but if you are dealing with very complex shaders that are possibly copied many times in the scene, you may benefit from precompiling.

and it also means that my original comment is not fully correct and you can theoretically make your scene lighter for rendering by precompiling the shader (very complex one).

read the full atricle here: https://www.sidefx.com/docs/houdini/shade/precompile

Edited by davpe
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...