Skip to Content
GPU Pro 6
book

GPU Pro 6

by Wolfgang Engel
July 2015
Intermediate to advanced
586 pages
17h 21m
English
A K Peters/CRC Press
Content preview from GPU Pro 6
1. Hybrid Ray Tracing on a PowerVR GPU 361
vec3 CalcVirtualInRay ()
{
vec2 uv = rl_FrameCoord . xy/ rl_FrameSize . xy ;
vec3 left = mix( frustumRay [0] , frustumRay [1] , uv . y );
vec3 right = mix ( frustumRay [2] , frustumRay [3] , uv . y );
vec3 cameraRay = mix ( left , right , uv . x );
return cameraRay ;
}
void DoReflection ( vec4 normal , vec3 position , float reflectivity )
{
vec3 inRay = CalcVirtualInRay () ;
vec3 reflection = reflect( inRay , normal);
createRay () ;
rl_OutRay . direction = reflection ;
rl_OutRay . origin = position ;
emitRay () ;
}
Listing 1.7. Reflection in hybrid renderer.
Alpha blending causes many artifacts, as it bares little relation ...
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 5

GPU Pro 5

Wolfgang Engel
GPU Pro 7

GPU Pro 7

Wolfgang Engel
GPU PRO 3

GPU PRO 3

Wolfgang Engel

Publisher Resources

ISBN: 9781482264623