Skip to Content
GPU Pro 5
book

GPU Pro 5

by Wolfgang Engel
May 2014
Intermediate to advanced
522 pages
16h 1m
English
A K Peters/CRC Press
Content preview from GPU Pro 5
184 II Lighting and Shading
float2 texcoords = input . tex . xy ;
// Unpack c l i p pos i tion from texcoords and depth .
float depth = depthBuffer . SampleLevel ( pointSampler ,
texcoords ,0.0f );
float4 currClip = unpackClipPos ( texcoords , depth );
// Unpack into previous homogenous coordinates :
// inverse(view projection) previous (view projection ) .
float4 prevHomogenous = mul ( currClip ,
invViewProjPrevViewProjMatrix);
// Unpack homogenous coordinate into clip space coordinate.
float4 prevClip = float4 ( prevHomogenous . xyz /
prevHomogenous . w ,1.0f );
// Unpack into screen coordinate [1, 1] into [0 , 1] range and
// flip the y coordinate.
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

GPU Pro 4

GPU Pro 4

Wolfgang Engel
GPU Pro 7

GPU Pro 7

Wolfgang Engel
GPU Pro 6

GPU Pro 6

Wolfgang Engel
GPU PRO 3

GPU PRO 3

Wolfgang Engel

Publisher Resources

ISBN: 9781482208641