Cycles:
* Move some hair width related code into a dedicated branch. * Don't calculate time/lens RNG when Motion Blur or Depth of Field are disabled
This commit is contained in:
@@ -119,8 +119,6 @@ __device_inline void bvh_node_intersect(KernelGlobals *kg,
|
|||||||
bool *closestChild1, int *nodeAddr0, int *nodeAddr1,
|
bool *closestChild1, int *nodeAddr0, int *nodeAddr1,
|
||||||
float3 P, float3 idir, float t, uint visibility, int nodeAddr, float difl, float extmax)
|
float3 P, float3 idir, float t, uint visibility, int nodeAddr, float difl, float extmax)
|
||||||
{
|
{
|
||||||
float hdiff = 1.0f + difl;
|
|
||||||
float ldiff = 1.0f - difl;
|
|
||||||
#else
|
#else
|
||||||
__device_inline void bvh_node_intersect(KernelGlobals *kg,
|
__device_inline void bvh_node_intersect(KernelGlobals *kg,
|
||||||
bool *traverseChild0, bool *traverseChild1,
|
bool *traverseChild0, bool *traverseChild1,
|
||||||
@@ -157,6 +155,8 @@ __device_inline void bvh_node_intersect(KernelGlobals *kg,
|
|||||||
|
|
||||||
#ifdef __HAIR__
|
#ifdef __HAIR__
|
||||||
if(difl != 0.0f) {
|
if(difl != 0.0f) {
|
||||||
|
float hdiff = 1.0f + difl;
|
||||||
|
float ldiff = 1.0f - difl;
|
||||||
if(__float_as_int(cnodes.z) & PATH_RAY_CURVE) {
|
if(__float_as_int(cnodes.z) & PATH_RAY_CURVE) {
|
||||||
c0min = max(ldiff * c0min, c0min - extmax);
|
c0min = max(ldiff * c0min, c0min - extmax);
|
||||||
c0max = min(hdiff * c0max, c0max + extmax);
|
c0max = min(hdiff * c0max, c0max + extmax);
|
||||||
|
@@ -1116,13 +1116,16 @@ __device void kernel_path_trace(KernelGlobals *kg,
|
|||||||
/* sample camera ray */
|
/* sample camera ray */
|
||||||
Ray ray;
|
Ray ray;
|
||||||
|
|
||||||
float lens_u = path_rng(kg, &rng, sample, PRNG_LENS_U);
|
float lens_u = 0.0f, lens_v = 0.0f;
|
||||||
float lens_v = path_rng(kg, &rng, sample, PRNG_LENS_V);
|
|
||||||
|
|
||||||
#ifdef __CAMERA_MOTION__
|
|
||||||
float time = path_rng(kg, &rng, sample, PRNG_TIME);
|
|
||||||
#else
|
|
||||||
float time = 0.0f;
|
float time = 0.0f;
|
||||||
|
|
||||||
|
if(kernel_data.cam.aperturesize > 0.0f) {
|
||||||
|
lens_u = path_rng(kg, &rng, sample, PRNG_LENS_U);
|
||||||
|
lens_v = path_rng(kg, &rng, sample, PRNG_LENS_V);
|
||||||
|
}
|
||||||
|
#ifdef __CAMERA_MOTION__
|
||||||
|
if(kernel_data.cam.shuttertime != -1.0f)
|
||||||
|
time = path_rng(kg, &rng, sample, PRNG_TIME);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
camera_sample(kg, x, y, filter_u, filter_v, lens_u, lens_v, time, &ray);
|
camera_sample(kg, x, y, filter_u, filter_v, lens_u, lens_v, time, &ray);
|
||||||
|
Reference in New Issue
Block a user