djo Posted August 10, 2015 Share Posted August 10, 2015 Hey Guys, I have a question regarding volume Vops. I am trying to do an operation on density of a volume using detail attributes as my parameter values for my operations. I can't for the life of me understand if it's possible to do so. Setting in a parameter node reading a detail attribute works fine doing Sop operations in a Vop Sop but doesn't do anything in a Volume Vop, it basically just reads the default value of the parameter node and just doesn't care if an attribute is already set using the same name. I have tried most attribute Types to no avail. I am testing this with a very basic setup. I created two volumes made from boxes and adding a detail attribute for the density multiplier called densityMultiplier. I am animating my densityMultiplier independently on each volume. However after adding a volumeVop and within it adding a parameter called densityMultiplier and multiying the volume density with this parameters doesn't work as intended. Basically what I trying to do is running an animated CVex operation and would like to use both the Volume Vop for preview so I can animate the values properly, while using the CVex in the shader for render time for high quality. I will have many multiple volumes all with different animations of parameters and do not wish to duplicate my shaders/volumeVop. If I can store the parameter animations in the detail attributes and read them straight away from the volumeVop/Cvex it would be amazing. But I can't seem to be able to :'( Am I doing something wrong ? does anyone have an Idea ? Is it even possible with VolumeVop/Cvex in Houdini like its possible in a Vex Sop context ? Thanks in advance for any help and insights. Cheers Quote Link to comment Share on other sites More sharing options...
djo Posted August 10, 2015 Author Share Posted August 10, 2015 Oops I posted it in the wrong section I had multiple tabs open Sorry about this, Could anyone bring this back under General Houdini Questions ? Quote Link to comment Share on other sites More sharing options...
anim Posted August 10, 2015 Share Posted August 10, 2015 use ImportDetailAttribute VOP or Get Attribute VOP Quote Link to comment Share on other sites More sharing options...
djo Posted August 10, 2015 Author Share Posted August 10, 2015 Hey anim, Thanks for the reply, but the problem here is that I need to specify a geometry path. I could set the default to be op:`opfullpath(opinputpath("./",0))` for the volume VOP but how would this translate when used as a shader ? Quote Link to comment Share on other sites More sharing options...
djo Posted August 10, 2015 Author Share Posted August 10, 2015 Also I forgot to mention I am on Houdini 13 so ImportDetailAttribute is not accessible to me Quote Link to comment Share on other sites More sharing options...
fathom Posted August 10, 2015 Share Posted August 10, 2015 use a material sop with an over-ride and push the detail value as an expression to your parm. Quote Link to comment Share on other sites More sharing options...
djo Posted August 11, 2015 Author Share Posted August 11, 2015 Hey Guys thanks for your ideas. So I installed an apprentice version of houdini 14 (to try ImportDetailAttribute) and build a simple scene explaining my problem. This works nicely at Sop level preview in the viewport. However for rendering I think I am using a wrong approach as cvex rebuilds the volumes fields from scratch overriding whatever geometry was there in the object where the cvex is attached in the first place. At render time there is no animation because my detail attribute "anim" doesn't exist when the cvex rebuild the volume fields. How would one approach this problem given that in this scene there might be just 3 cubes but I might have a lot of these that I might need to animate by hand ? I am trying to be resolution independent. I would like to zoom in pretty closely so I am not looking at saving out the preview volume and rendering them. Finally I am trying to use the same Cvex for both preview and render. Thanks for your help cvexDetailAttribute.hipnc Quote Link to comment Share on other sites More sharing options...
fathom Posted August 11, 2015 Share Posted August 11, 2015 (edited) i think you're somewhat sol here. the sop bounds also need to be created and they need to reference a specific geo (well they don't HAVE to, but they ought to). you might see if passing a parm to your cvex code can be done on the "command line". that is, setting your shader to be: /path/to/cvex/shader "myParm" [1.3] (i think that's the syntax, but i have no idea if it'll pick up) at least you can reference your cvex over and over and put the sop-specific stuff in a single place with channel references to grab your bounds (and hopefully your parms). edit: also, looking at your setup, you aren't actually using your detail attributes -- your render node strips them when it makes the single bounds for your cvex. also keep in mind detail attributes are unique for a single geometry -- you can't merge 3 sops with unique detail attribtutes and hope to keep all of them. you'll just get 1 (likely the first). Edited August 11, 2015 by fathom Quote Link to comment Share on other sites More sharing options...
djo Posted August 11, 2015 Author Share Posted August 11, 2015 Interesting, Indeed rushing into building a test case on multiple objects to post here I didn't stop and think that a detail attribute is one per object. Maybe I would then have tried to store the attributes on placeholder primitives I guess and change this topic to Reading Primitive Attribute in a Volume Vop/Cvex Or perhaps try storing an array in a detail attribute, as Houdini 14 is suppose to be able to that, I never tried this yet though. However I was initially trying to get it to work with detail on a single object hence a volume sop per volume in my preview geometry. I did however previously tried a rendering a single volume with a detail attribute to try and control some things but I just didn't manage to get it to work. Also I Never knew that the path we put in was an actual command line I'll investigate this, it might be convoluted though when passing a lot of data. Cheers Quote Link to comment Share on other sites More sharing options...
fathom Posted August 11, 2015 Share Posted August 11, 2015 yeah, it's not a "commanline" per se, but in some cases, it's what is pushed directly to the ifd, so there's a possibility that you can hijack the ifd command. however, i've monkeyed with this a bit and it looks like the vex shader line doesn't parse in a nice way (it puts quotes around the whole thing and so it tries to find a shader with the extra bits which it can't find). what you really need is a volume stamp procedural -- something akin to the point replicate procedural, but instead generates volumes. then you could stuff all your data onto points in a single object and it would call the cvex script with the attribute values... Quote Link to comment Share on other sites More sharing options...
djo Posted August 11, 2015 Author Share Posted August 11, 2015 Hmm I see so not out of the box like that. The other thing I'm looking into is storing the data in the volume as a seperate Volume Primitive of just 1 giant voxel. Its a bit convoluted especially if I have several vector attributes, it will get quite messy, but I think it might just work for me. It's just that I would need to write out my animation of parameters inside a sequence of volumes which is not ideal. I'll need to see if its possible to automate the creation of volume primitives based on how many detail attributes there is on the volume object. Thanks for your help and insight fathom. Quote Link to comment Share on other sites More sharing options...
fathom Posted August 11, 2015 Share Posted August 11, 2015 (edited) you might also look at skipping the cvex volume stuff and pushing your density function to your shader. you might find you have access to more data at that point and i don't know you'd lose any potential functionality beyond maybe the sparse volume stuff handling... i'm thinking you'd instance full volume cubes and then query the incoming parms for info about the current point. not 100% sure it'd work, but i might be worth a shot. edit: point parms don't come thru as shader parms, but material over-rides should work which should be doable-per point pretty easily. Edited August 11, 2015 by fathom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.