Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-02-28 20:44:54 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-02-28 20:44:54 +0400
commit4a903395194aef1cfe97e4d50d73320a72280cf3 (patch)
tree056c15cc54f0d0446aef69c9b7f299023c01a69f /intern/cycles/kernel/kernel_light.h
parent0052cbed0dadafce44f818d3d2016254c3d914d0 (diff)
Cycles: support for camera rendering an environment map with equirectangular
environment map, by enabling the Panorama option in the camera. http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Camera#Panorama The focal length or sensor settings are not used, the UI can be tweaked still to communicate this, also panorama should probably become a proper camera type like perspective or ortho.
Diffstat (limited to 'intern/cycles/kernel/kernel_light.h')
-rw-r--r--intern/cycles/kernel/kernel_light.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index aa125180a94..42260577069 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -120,13 +120,9 @@ __device float3 background_light_sample(KernelGlobals *kg, float randu, float ra
float du = (randu - cdf_u.y) / (cdf_next_u.y - cdf_u.y);
float u = (index_u + du) / res;
- /* spherical coordinates */
- float theta = v * M_PI_F;
- float phi = u * M_PI_F * 2.0f;
-
/* compute pdf */
float denom = cdf_last_u.x * cdf_last_v.x;
- float sin_theta = sinf(theta);
+ float sin_theta = sinf(M_PI_F * v);
if(sin_theta == 0.0f || denom == 0.0f)
*pdf = 0.0f;
@@ -136,7 +132,7 @@ __device float3 background_light_sample(KernelGlobals *kg, float randu, float ra
*pdf *= kernel_data.integrator.pdf_lights;
/* compute direction */
- return spherical_to_direction(theta, phi);
+ return -equirectangular_to_direction(u, v);
}
__device float background_light_pdf(KernelGlobals *kg, float3 direction)