Created
October 31, 2012 01:22
-
-
Save awreece/3984245 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RT_PROGRAM void env_camera() | |
{ | |
size_t2 screen = output_buffer.size(); | |
float2 d = make_float2(launch_index) / | |
make_float2(screen) * | |
make_float2(2.0f * M_PIf , M_PIf) + | |
make_float2(M_PIf, 0); | |
float3 angle = make_float3( cos(d.x) * sin(d.y), | |
-cos(d.y), | |
sin(d.x) * sin(d.y)); | |
float3 ray_origin = eye; | |
float3 ray_direction = normalize(angle.x*normalize(U) + | |
angle.y*normalize(V) + | |
angle.z*normalize(W)); | |
optix::Ray ray(ray_origin, ray_direction, radiance_ray_type, scene_epsilon); | |
PerRayData_radiance prd; | |
prd.importance = 1.f; | |
prd.depth = 0; | |
rtTrace(top_object, ray, prd); | |
output_buffer[launch_index] = make_color( prd.result ); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment