Jump to content

Ray marching Volume Shader don't work!


Jun

Recommended Posts

Hi.

I'm setting up ray marching volume shader in VOP for learning.

But it's don't work...

It is Referenced to Advanced Renderman's chap.15.

http://penguin.ewu.e...adowedclouds.sl

This VOP is so complication.

I don't know why.

Thanks for any help!

I was trying to figure out that node and there a bunch of screwed up things in it. I'll have to redo all my undoing to figure out what exactly it was, but the last thing I noticed is you don't have a condition on your while statement, so I don't know what is driving that.

Bytw, it's helpful to color your nodes when you work all grey nodes hurt my eye and don't give me any help to understand what is happening,

some sesi standards

yellow for parameters

purple for globals

blacks for defaults, and constants

green for export parameters

and pick a color for subnets, if, for each, or while statements currently I like red, but this helps to verify where you got stuff hidden away.

Also don't create so many subnets for your self, you spend alot more time diving into nodes when it should be something quick to get in and out of especially when their isn;t much in there, illuminace loops, ifs, for each, and etc. are understandable.

I'm also not sure which version of houdini you created this in. I used 11 and there were broken thing like your light so I'm guessing 10, but if you created this earlier you could have potentially broke something via that way, as a heads up I had rebuild alot of my own stuff when I made the switch.

Are the values set to an expected out come? there are a couple of variables here causing a lot of stuff to happen. I don't know more than the link you set up, but maybe your values are off.

Your light also doesn't have deep shadows on either, so their could be a catch there with your volumetric. A pointed spot light is a lot better focused for your shadow caching too than a universal point.

Hope, that helps, I got to get back to my crap before I dive back into that again.

-Ben

Link to comment
Share on other sites

I was trying to figure out that node and there a bunch of screwed up things in it. I'll have to redo all my undoing to figure out what exactly it was, but the last thing I noticed is you don't have a condition on your while statement, so I don't know what is driving that.

Bytw, it's helpful to color your nodes when you work all grey nodes hurt my eye and don't give me any help to understand what is happening,

some sesi standards

yellow for parameters

purple for globals

blacks for defaults, and constants

green for export parameters

and pick a color for subnets, if, for each, or while statements currently I like red, but this helps to verify where you got stuff hidden away.

Also don't create so many subnets for your self, you spend alot more time diving into nodes when it should be something quick to get in and out of especially when their isn;t much in there, illuminace loops, ifs, for each, and etc. are understandable.

I'm also not sure which version of houdini you created this in. I used 11 and there were broken thing like your light so I'm guessing 10, but if you created this earlier you could have potentially broke something via that way, as a heads up I had rebuild alot of my own stuff when I made the switch.

Are the values set to an expected out come? there are a couple of variables here causing a lot of stuff to happen. I don't know more than the link you set up, but maybe your values are off.

Your light also doesn't have deep shadows on either, so their could be a catch there with your volumetric. A pointed spot light is a lot better focused for your shadow caching too than a universal point.

Hope, that helps, I got to get back to my crap before I dive back into that again.

-Ben

Ben

Thanks for reply.

Perhaps I could understand.

I do not understand much English.

I tryed coloring node by SESI's standard.

And added While Loop condition.

Is this approach correct?

I could not optimize subnets.

It's required to declare the function. What I try to OTL?

First,I want to know why didn't work Ray Sphere function.

http://www.larrygritz.com/arman/shaders/raysphere.h

http://forums.odforce.net/uploads/monthly_10_2010/post-1287-128732224659_thumb.jpg

I'm sorry to have little understanding.

RayMarchingVolume_fix01.hip

post-1287-128732224659_thumb.jpg

Link to comment
Share on other sites

So I didn't get your shader to render, but here are my steps I took to get further along to see why it didn't work. I couldn't figure out why the ray sphere function worked either. Code ain't my specialty, but this is helping me learn, too. I decided to break down what works, and it's bare essentials and what you do not have in your shader. Mantra is finicky sometimes in what it needs, you may want to try this code straight up in render-man to make sure nothing has changed since the book has been published.

In order to test the scene with a volumetric option I followed the help document.

http://www.sidefx.com/docs/houdini11.0/rendering/volumetricrendering

I needed to add an isosurface to the sphere in your scene, and adjust a few parameters on it. I also added a new spot light, as I am working in h11 with depth shadow maps on, with the transparent shadow map box corrected, so I get Deep Shadows 3-D shadow maps. I added a basic smoke material to get it to render. Now back to your render while I look at the basic smoke and yours side by side.

I extracted your primary subnet to realign the stuff so I could better understand it.

Your Ka and Kd are not connected to anything...

I colored your nulls a light green so I could realize what is not doing info.

I added a collect node and that really helped... it didn't render black anymore, it was bright white and in my face

When I extract the If-then block in the basic surface shader I got the same color, not sure what I broke exactly, but when I remove it cleanly it still works fine.

To pair down the basic surface to what you really need I unsubneted more and then got ride of the lighting model for bsdf functionality

mmb on you shader gives a vex call error; min = min ( stepsize ); ... no clue what this means ss = min represents the null

When I disconnect the min functions between the stepsize parameter and the ss null it goes black

The min function should only show the lowest value of the inputs, since there is only one input I don't know whay you need this function for it to work... could be more from my lack of knowledge than a real problem, but due to the error before I would look into this.

Undoing the opacity, and alpha on the basic surface, undefines the shape alot,

The is shadow ray doc: This operator returns 1 if the shader is being evaluated for shadow rays. It returns 0 if the shader is being evaluated for pixel color.

I got ride of the bottom option of the is shadow ray function, because I do have shadows.

I can remove the diffuse color(whiter color, I get an OGL error for this), but I still need to premult the shadow to define it's shape

I can't change anything within the illuminance loops, or else I loose something important, to my render. A very good node to read up on; http://www.sidefx.com/docs/houdini11.0/nodes/vop/illuminance

I can remove Illumination Angle, the Y_axis, and the global P

I can't remove the desnity parameter because apparently that is a global call(no clue where from though), when putting in a constant that should have derived from the mult it gives me an interesting shape.... sad it won't let me upload it, just put a constant with a value of 500 into the max. It worth the funny picture. If you solely remove the complement, or exponent it creates this shape too.

I couldn't remove any more components with out altering the desired basic result, which I'm uploading.

My conclussion is that with out the illuminance loop to create shadows, and a better alpha and opacity values to define shape this shader won't work in mantra as it comes out of the book. You can try to use an inline vop after converting the code to vex to see if that works. Hopefully some one smarter can figure out why it didn't work. Good Luck!

Link to comment
Share on other sites

I haven't looked at any of the files, but just in case, I thought I'd point out that ever since volume primitives were first introduced in Houdini/Mantra (back in H9?), there's been no need to do your own ray marching -- a shader for a volume primitive is just a surface shader which computes Of in proportion to dPdz (equivalent to computing opacity for a single step in an old-style ray-marching shader). IOW, Mantra does the stepping for you. Have a look at the SimpleSmoke material for an example of how to compute a single illuminated density step.

...that's assuming that you're using Mantra, of course; if you're using PRMan or some other renderer, then disregard what I just said.

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