Graphics Reference
In-Depth Information
void gammaton_miss ()
{ // compute position of gammaton
float dt = g_IntegrationStepSize ;
float3 vold = ray . direction ￿ prd . speed ;
float3 pnew = ray . origin + dt ￿ vold ;
float3 vnew = vold + dt ￿ gravity ;
GammaHitShared & hitshared = HitShared_Out [ prd . ray_index ];
if ( leftDomain ( pnew )) { // if outside bounding box
SET_DEAD ( hitshared . flags );
return ;
}
// Floating particle moved over edge
if ( IS_FLOAT ( hitshared . flags ))
{
// float
vnew = make_float3 (0,0,0) ;
// let gammaton f a l l
SET_BOUNCE ( hitshared . flags );
// free f all
}
// gammaton s t i l l a l i v e a f t e r maximum depth
prd . ray_depth ++;
if ( prd . ray_depth > = MAX__GAMMATON__DEPTH )
{
HitOptix [ prd . ray_index ]. position = pnew ;
hitshared . velocity = vnew ;
SET_ALIVE ( hitshared . flags );
SET_MIDAIR ( hitshared . flags );
return ;
}
prd . speed = length ( vnew );
Ray ray ( pnew , normalize ( vnew ));
float maxDist = dt ￿ prd . speed ;
optixTraceGammaton ( ray , prd , maxDist );
// launch ray
}
Listing 3.4. OptiX/CUDA gammaton miss program.
the numerical offset as well as h . Floating particles can flow bottom up and
around overhangs (see Figure 3.8). If a bounce event occurs or no intersection is
found at an overhang, we let the gammaton fall down. On impact the resulting
velocity typically acts only tangentially, but to further speed up the distribution
of material, we allow the artist to alter the loss of energy of impacting particles.
To approximate friction, both bouncing and floating gammatons are slowed down
by a specific rate.
3.3.3 Material Transport
Our approach is based on the transport of materials by floating and bouncing
gammatons. Thus, we let gammatons that hit a surface issue material transfer,
for which both the material on the surface as well as the material carried by the
Search WWH ::




Custom Search