PDA

View Full Version : node shader for volume



alenskas
04-16-2014, 12:02 PM
anyone know how to hook up a node tree that can render volume of an object ?
it must be possible to calculate the volume/space/thickness inside an air-tight model and render this as a volume
with a distance to outside falloff option . i would also like to plug in textures to break it up.
basically im looking for a new volume shader to get away from the problems of hypervoxels and only being able to apply them to points.

i would really like to be able to use this as a shader applied to hypervoxel blobs.

dpont , are you reading :D

or maybe this is already doable and im just not seeing it ! DOH !

Ztreem
04-16-2014, 03:33 PM
You could use surface thickness gradient to do this but I don't know if you can do it with hupervoxels, works with normal geometry.

prometheus
04-16-2014, 03:35 PM
Nope, not with hypervoxels, get modo which can use any geometry for volumetric effects, or try houdini.
Another option is to buy the volumedic plugin for lightwave ..it can do that.

would be sweet if hypervoxels could access raycast function in nodes and project that as some sort calculation of the volume, but I dont think that is possible.

you could check my "heart of hypervoxels thread" it expands a little on the basic shape from voxels, but merely giving thickness and shape to flat images or gradients or procedurals, not entirely 3d volumes, with it you
can possibly create flattened layers sort of, as cloud planes rather than a spherical shape etc...and also add maps to use for the density etc.

http://forums.newtek.com/showthread.php?141094-Heart-of-hypervoxels-expanding-on-hypervoxel-shapes

Thereīs another option, it is to get the demo of.. or buy turbulenceFD and simply fast sim one frame with object fill, and the object will have created a filled voxel volume, you can save out to cache then reload to any scene you want.


http://forums.newtek.com/attachment.php?attachmentid=105309&d=1340820510
Michael

Ztreem
04-16-2014, 04:07 PM
here's a test with surface thickness, it's not a true volume and you can get funky effects with overlapping volumes.
121481
121482

spherical
04-17-2014, 04:59 AM
Do you think the density of surface thickness could be modified by a procedural? Complex node trees are still in my future but I'm plodding along that path.

Ztreem
04-17-2014, 08:30 AM
Do you think the density of surface thickness could be modified by a procedural? Complex node trees are still in my future but I'm plodding along that path.

That's kind of what I do with the turbulence texture as you see of the screenshots,t he model is a perfect donut and the render looks nothing like that. Or did you have something else in mind?

XswampyX
04-20-2014, 08:37 AM
Anything is possible with nodes! :D

http://i465.photobucket.com/albums/rr16/xXswampyXx/Volume_Nodes_Small_zpsc97a4d00.jpg (http://s465.photobucket.com/user/xXswampyXx/media/Volume_Nodes_Small_zpsc97a4d00.jpg.html)

Get your spot info with location of your surface spot, and the direction of the ray to camera.
Trace along the camera ray and get the thickness of the object in this direction.
Divide this distance by 8 and take 8 samples of your texture along this ray. (You could use more than 8, but I had to have a compound node for each sample, and I got bored.)
Add them all together and divide by the number of samples ( 8 ).
And there you go.

A couple of problems.

No shadows inside the volume, It only calculates the shadows from the normal of the geometry.
Changing the texture is a right PITA, 8 samples = 8 different textures. It's a pity we can't clone the compound nodes, and use them again. :(

A couple of good points.

It's fast.
Good shadows.
It's fast.
Being nodal you can change pretty much anything.
And it's fast!


http://youtu.be/c7p9dqgy6Og

prometheus
04-20-2014, 08:59 AM
Anything is possible with nodes! :D

http://i465.photobucket.com/albums/rr16/xXswampyXx/Volume_Nodes_Small_zpsc97a4d00.jpg (http://s465.photobucket.com/user/xXswampyXx/media/Volume_Nodes_Small_zpsc97a4d00.jpg.html)

Get your spot info with location of your surface spot, and the direction of the ray to camera.
Trace along the camera ray and get the thickness of the object in this direction.
Divide this distance by 8 and take 8 samples of your texture along this ray. (You could use more than 8, but I had to have a compound node for each sample, and I got bored.)
Add them all together and divide by the number of samples ( 8 ).
And there you go.

A couple of problems.

No shadows inside the volume, It only calculates the shadows from the normal of the geometry.
Changing the texture is a right PITA, 8 samples = 8 different textures. It's a pity we can't clone the compound nodes, and use them again. :(

A couple of good points.

It's fast.
Good shadows.
It's fast.
Being nodal you can change pretty much anything.
And it's fast!




yes..interesting, though I have never found it acceptable in terms of softness and quality to get that "volumetric look"

Michael

XswampyX
04-20-2014, 10:39 AM
yes..interesting, though I have never found it acceptable in terms of softness and quality to get that "volumetric look"

Michael

Strange?

It's not layers of geometry is done entirely through the surface nodes. You can make it as blurry as you like.

http://i465.photobucket.com/albums/rr16/xXswampyXx/Vol_Node2_zps513fc146.jpg (http://s465.photobucket.com/user/xXswampyXx/media/Vol_Node2_zps513fc146.jpg.html)

djwaterman
04-20-2014, 10:44 AM
Strange?

It's not layers of geometry is done entirely through the surface nodes. You can make it as blurry as you like.

http://i465.photobucket.com/albums/rr16/xXswampyXx/Vol_Node2_zps513fc146.jpg (http://s465.photobucket.com/user/xXswampyXx/media/Vol_Node2_zps513fc146.jpg.html)

Hey XSwampyX, can you just attach those screen grabs using the site upload so we can see them at proper size? I think I'm going to need some of these solutions for a project I'm working on, it's helpful to study the nodes network and I can't read them at the photobucket size.

XswampyX
04-20-2014, 10:55 AM
I think you are going to need a bigger screen. :D

121543

And inside the compound node....

121544

prometheus
04-20-2014, 04:12 PM
Thanks for your learning setups of nodes, itīs valuable resorce indeed if you might need this someday, canīt tell though from the images...still to small, I would encourage you again to post somewhere else...or just in bigger format.

Anyway..as far as I can tell..it still donīt look good, not sure here..hard to tell as I said, and I understood that it isnīt geometry, even if it is procedural textures and surfaces..it doesnīt look smooth enough, canīt tell why really, maybe not the inside of the textures, but at the edges of the object that "holds" the fake volume texture, apart from that it is the actual lighting that maybe also lacks to get that volumetric feel.

Michael

prometheus
04-20-2014, 05:45 PM
the modo style of volumetric item...
http://community.thefoundry.co.uk/discussion/topic.aspx?f=32&t=83400&page=0#752754

spherical
04-20-2014, 09:56 PM
Anything is possible with nodes! :D

Get your spot info with location of your surface spot, and the direction of the ray to camera.
Trace along the camera ray and get the thickness of the object in this direction.
Divide this distance by 8 and take 8 samples of your texture along this ray. (You could use more than 8, but I had to have a compound node for each sample, and I got bored.)
Add them all together and divide by the number of samples ( 8 ).
And there you go.

And right there my head exploded... Of course, it was well on its way when I saw the node tree.

This looks really promising. Scene?

XswampyX
04-21-2014, 04:30 AM
And right there my head exploded... Of course, it was well on its way when I saw the node tree.

This looks really promising. Scene?

Boom! :D

I'll post some thing up here some time, but I just want to see if I can take it a bit further. Some shading etc....

Cheers!

spherical
04-21-2014, 10:36 AM
Cool. Thanks! I know I'm gonna get to a point one day of "thinking in nodes". Your solutions are really out there.

XswampyX
04-21-2014, 11:34 AM
Thanks Spherical, They are great to just fiddle around with.

Here's something to play with in the meantime. It came to me when I was trying to raytrace the shadows. Don't select your sample depth, use a random number instead. Doh!
You will need POMs nodes for the random node. Here :- https://www.lightwave3d.com/assets/plugins/entry/pomsnodes/

http://i465.photobucket.com/albums/rr16/xXswampyXx/Vox_Box_zps92b7cbf0.jpg (http://s465.photobucket.com/user/xXswampyXx/media/Vox_Box_zps92b7cbf0.jpg.html)

If anyone can think of a way of tracing the texture to the light.... I'm all ears....

50one
04-23-2014, 03:02 AM
Thanks Spherical, They are great to just fiddle around with.

Here's something to play with in the meantime. It came to me when I was trying to raytrace the shadows. Don't select your sample depth, use a random number instead. Doh!
You will need POMs nodes for the random node. Here :- https://www.lightwave3d.com/assets/plugins/entry/pomsnodes/

http://i465.photobucket.com/albums/rr16/xXswampyXx/Vox_Box_zps92b7cbf0.jpg (http://s465.photobucket.com/user/xXswampyXx/media/Vox_Box_zps92b7cbf0.jpg.html)

If anyone can think of a way of tracing the texture to the light.... I'm all ears....


Just logged-in to tell you that you're awesome and I want to have your babies.

S

XswampyX
04-23-2014, 11:09 AM
Well thanks 50one, Just a thank you will do, but I appreciate the sentiment! :D