Jump to content
MENOZ

cache shader

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×