PDA

View Full Version : Volume Rendering in Renderman


nycsamurai
03-19-2010, 02:39 AM
I have a set of densities and coordinates. Using that I want to form a cloud of these density values. So far I've created a point cloud and converted it to a brick map. I'm ray marching through this brick map and sampling densities along the ray. Problem is, the result is very blocky. Is there another way to do it so it looks more smoother? Adjusting radius size when sampling in the brickmap doesn't do much.

http://johnlukasiewicz.com/renderman/nebula_render1.png

Here is the point cloud from which this data is generated from.

http://johnlukasiewicz.com/renderman/point_cloud.png

Gravedigger
04-21-2010, 09:39 PM
not sure if brickmaps are the best way to do this. if you've access to RPS15 you can read closest points in a pointcloud. like this you could do an interpolation and get smooth results. if you don't have RPS15 you'd have to write your own algorithm to find the closest points

how are you reading the brickmaps at the moment? i think you're result is simply wrong

grs
Patrik

nycsamurai
04-22-2010, 03:36 AM
I'm raymarching through the volume. This is what the shader looks like. Even with 10000 steps, and a tiny filterradius it looks like crap. If I limit the values (with something like if(density > 0.11 && density < 0.22)) you get the render below. It seems like a typical raymarch. I'm subtracting opacity based on the density value but it seems to do the trick.


volume bkcloud(point position = point(0, 0, 5); float num_steps = 10000;
string filename = ""; color cloud_color = 1;)
{
float len = length(I);
float step_size = len/num_steps;
point In = normalize(I);
point p_cur = P - I;
Oi = 0;
normal N0 = 0;
float depth = 2;
float density = 0;
p_cur = p_cur - (depth * In);

//get initial opacity
// texture3d(filename, p_cur, N0, "nebuladensity", density);
// Oi = density;
Oi = 0;

//march down incident ray
while(len > 0)
{
texture3d(filename, p_cur, N0, "nebuladensity", density,
"filterradius", 0.0001);
//if(density > 0.11 && density < 0.22)
Oi += (1 - Oi) * step_size * density;
Ci += (1 - Oi) * step_size * cloud_color * density;

p_cur += step_size * normalize(I);
len -= step_size;
}

}



http://johnlukasiewicz.com/renderman/nebula_render.png

CGTalk Moderation
04-22-2010, 03:36 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.