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
Sample Applications 421
void CSMai n ( u int 3 c : S V DispatchThreadID)
{
float3 location = spaceDelta . xyz( c . xyz + 0.5 f ) ;
float3 diff = location p osi ti on . xyz ;
float arg = dot( di ff , d if f )/ data . x ;
float magnitude = data . y exp ( arg ) ;
float4 vortexVelocity = float4(magnitude c r os s ( no rma l . xyz , d i f f ) , 0 . 0 f ) ;
ou tV el ocity [ c . xyz ] = in Ve loc it y [ c . xyz ] + vo rt exV el oci ty ;
}
// From InitializeSource . hlsl :
cbuffer External
{
float4 densityProducer ; //(x,y,z,)
float4 densityPData; // ( variance , amplitude , , )
float4 densityConsumer; //(x,y,z,)
float4 densityCData; // ( variance , amplitude ...
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