import density into VOPCVEX

   3043   5   2
User Avatar
Member
41 posts
Joined: Jan. 2007
Offline
Hey all -

I'm working with a volume VOPCVEX shader, and I'm trying to import the density of my volume. With my current implementation, I can easily access the global variable “P” and then output density. However, if I create a parameter “density” it is empty, and even when I use “Volume Sample from File” and point to my density volume, the value is empty.

I can always do this in a Volume VOP, but I like how the VOPCVEX implementation makes the final render independent of the resolution of the volume in SOPs. Is what I'm doing possible?

Thanks.
-Mike
User Avatar
Member
339 posts
Joined: Aug. 2007
Offline
In the case of the Volume Sample make sure you are transforming P into object space before the lookup. If you post a hip it'll be much easier to debug.
Jesse Erickson
Fx Animator
WDAS
User Avatar
Member
41 posts
Joined: Jan. 2007
Offline
I'm not sure how to go about that, but in this situation my object is at the origin, so i would assume that object space is the same as global space.

Here's my example, with a Volume VOP linking to a SHOP VOPCVEX. Please let me know if you can see something obvious going on here.

Thanks!

Attachments:
vopcvex-density.hipnc (702.0 KB)

User Avatar
Member
8570 posts
Joined: July 2007
Offline
to refer to scene geometry in your CVEX shader you need to use

op:`opfullpath(“../../volume1”)`
instead of just
“../../volume1”

or of course
opobj/proceduralVolume/volume1
will work as well
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
41 posts
Joined: Jan. 2007
Offline
Awesome! I always get confused with that op: stuff.

However, it's still not rendering. I can see the density in the viewport, and all of my changes there fine. However, in the render view I get an empty image.

If you connect the “density” output in the VOPCVEX node to the tree above the volume sample (one based around global position and noise) it renders fine, but if you connect the output to my volume sample (with nothing else inbetween) it renders empty.

I'm not sure what's going on here.

-Mike
User Avatar
Member
41 posts
Joined: Jan. 2007
Offline
I seem to have solved my own problem, more or less, and it basically relates to a misunderstanding about VOPCVEX

1) In VOPCVEX, you can read a volume from a file, but you can't read it in directly from sops. This is why I was seeing results in the viewport but not in the render. If I stick a file node after my volume, output it to BGEO and then link to that, I'll see the correct results in the render.

2) However, when working with a volume imported there's not much benefit. With the global variable P you can increase detail through samples, however the volume being read in has a limited amount of information, so there's no off-loading details onto the render stage.

So it seems, for my use, a Volume VOP is the better way to go about it.

Thanks for your help!

Further reading:
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=110601 [sidefx.com]
  • Quick Links