Creating a fog shader in Vex

   3576   4   2
User Avatar
Member
289 posts
Joined: 7月 2005
Offline
Hi Everybody,

I'd really love to create a fog shader. Like you could do in Imagine on the Commodore Amiga . It would measure the length a ray had traveled when intersecting the surfaces of a shape. Depending on the order of front face back face you could determine whether a ray is inside or outside the object. The total length of the rays that penetrate the surface would then be used to determine the density.



So my question is. Is it possible to do an iterative process on a ray so that you can process each intersection of the surface the ray has traveled through. and bring those results together in one color? I have no clue on how I can resolve this in Houdini.

Cheers!!
A computer is almost human - except that it does not blame its mistakes on another computer.
User Avatar
Member
289 posts
Joined: 7月 2005
Offline
Color accumulation over depth explains probably better what I would like to achieve. Peter Claes has done something similar to create his jam character.
www.peterclaes.be [peterclaes.be]. Could anyone plz help me out.

Cheers
A computer is almost human - except that it does not blame its mistakes on another computer.
User Avatar
Member
789 posts
Joined: 4月 2020
Offline
Hello,

Would you really like to ray-march the volume, (for which the basic volume shaders are a good example) or do you just need to know the distance between the first and last intersection?

I would probably just create a volume representation of what you want to render, stick a simple smoke on there, and use that as a pass in compositing.

To get started there, you can have a look here:
http://www.sidefx.com/docs/houdini10.0/rendering/volumetricrendering [sidefx.com]

In other renderers I have also worked with a “depth” shader that would give you the distances between all odd and even hits added up. That is a very simple number you can use. We used that as a pass to color correct. I like the volume approach better though.

Hope that helps a bit

Cheers,
koen
User Avatar
Member
289 posts
Joined: 7月 2005
Offline
Hi Koen, thanks for the reply.

What I would like to do is create indeed a shader that adds the odds and the evens. But I have no idea how to solve this in vex. ops:
A computer is almost human - except that it does not blame its mistakes on another computer.
User Avatar
Member
789 posts
Joined: 4月 2020
Offline
For that you can look into the ray bounce vop:

http://www.sidefx.com/docs/houdini10.0/nodes/vop/raybounce [sidefx.com]

Koen
  • Quick Links