Jump to content

Question for "shader writing in Image3d tutorial"


puma.snyder

Recommended Posts

Hi

what do I have to set in the image3d output driver parameters tab in order to get this shader from the "shader writing in Image3d - part 2" tutorial to work properly? Do I have to set any "render as" although I already specified geometry in the shader? When leaving at the defaults the rendered volume does not match the geometry. Here is the shader.

Any Ideas?

image3d voxellize_backhit( string geofile = ""; vector test_vec = {0,1,0} )

{

float pu, pv;

int prim_number;

vector curP = P;

vector nml=0;

density=0;

prim_number=intersect( geofile, curP, test_vec*1000, curP, pu, pv );

if( prim_number > -1 )

{

nml = normalize(prim_normal(geofile,prim_number,pu,pv));

if( dot( normalize(test_vec), nml ) >= 0.0 )

density = 1;

}

}

Thanks in advance

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