Jump to content

Reading Detail attribute in a Volume VOP/CVEX


djo

Recommended Posts

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

 

 

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by fathom
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by fathom
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...