Skip to Content
GPGPU Programming for Games and Science
book

GPGPU Programming for Games and Science

by David H. Eberly
August 2014
Intermediate to advanced
469 pages
16h 30m
English
A K Peters/CRC Press
Content preview from GPGPU Programming for Games and Science
426 GPGPU Programming for Games and Science
Texture3D<float> poisson ;
RWTexture3D<float> outPoisson ;
[ numthreads (NUM
X THREADS , NUM Y THREADS , NUM Z THREADS ) ]
void CSMai n ( u int 3 c : S V
DispatchThreadID)
{
uint3 dim;
d i v e r g e nc e . G et Di m en s io n s ( dim . x , dim . y , dim . z ) ;
int x=int(c.x);
int y=int(c.y);
int z=int(c.z);
int xm = max ( x 1, 0 ) ;
int xp = min ( x +1, dim .x 1);
int ym = max ( y 1, 0 ) ;
int yp = min ( y +1, dim .y 1);
int zm = max ( z 1, 0 ) ;
int zp = min ( z +1, dim . z 1);
// Sa mple t h e d iv e r g e n ce a t ( x , y , z ) .
float div = divergence [ int3(x, y , z )];
// Sample Poisson values at (x ,y)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Graphics Gems V (IBM Version)

Graphics Gems V (IBM Version)

Alan W. Paeth
GPU Pro 6

GPU Pro 6

Wolfgang Engel

Publisher Resources

ISBN: 9781466595354