Merge branch 'master' into blender2.8
This commit is contained in:
@@ -543,7 +543,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MemoryManager memory_manager;
|
MemoryManager memory_manager;
|
||||||
friend MemoryManager;
|
friend class MemoryManager;
|
||||||
|
|
||||||
struct tex_info_t {
|
struct tex_info_t {
|
||||||
uint buffer, padding;
|
uint buffer, padding;
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
|
|||||||
* mainly due to the mixed in MIS that we use. gives too many unneeded
|
* mainly due to the mixed in MIS that we use. gives too many unneeded
|
||||||
* shader evaluations, only need emission if we are going to terminate */
|
* shader evaluations, only need emission if we are going to terminate */
|
||||||
float probability =
|
float probability =
|
||||||
path_state_terminate_probability(kg,
|
path_state_continuation_probability(kg,
|
||||||
state,
|
state,
|
||||||
throughput*num_samples);
|
throughput*num_samples);
|
||||||
|
|
||||||
@@ -717,7 +717,7 @@ ccl_device_inline float kernel_path_integrate(KernelGlobals *kg,
|
|||||||
/* path termination. this is a strange place to put the termination, it's
|
/* path termination. this is a strange place to put the termination, it's
|
||||||
* mainly due to the mixed in MIS that we use. gives too many unneeded
|
* mainly due to the mixed in MIS that we use. gives too many unneeded
|
||||||
* shader evaluations, only need emission if we are going to terminate */
|
* shader evaluations, only need emission if we are going to terminate */
|
||||||
float probability = path_state_terminate_probability(kg, &state, throughput);
|
float probability = path_state_continuation_probability(kg, &state, throughput);
|
||||||
|
|
||||||
if(probability == 0.0f) {
|
if(probability == 0.0f) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ ccl_device float kernel_branched_path_integrate(KernelGlobals *kg,
|
|||||||
/* path termination. this is a strange place to put the termination, it's
|
/* path termination. this is a strange place to put the termination, it's
|
||||||
* mainly due to the mixed in MIS that we use. gives too many unneeded
|
* mainly due to the mixed in MIS that we use. gives too many unneeded
|
||||||
* shader evaluations, only need emission if we are going to terminate */
|
* shader evaluations, only need emission if we are going to terminate */
|
||||||
float probability = path_state_terminate_probability(kg, &state, throughput);
|
float probability = path_state_continuation_probability(kg, &state, throughput);
|
||||||
|
|
||||||
if(probability == 0.0f) {
|
if(probability == 0.0f) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ ccl_device_inline uint path_state_ray_visibility(KernelGlobals *kg, PathState *s
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
ccl_device_inline float path_state_terminate_probability(KernelGlobals *kg, ccl_addr_space PathState *state, const float3 throughput)
|
ccl_device_inline float path_state_continuation_probability(KernelGlobals *kg, ccl_addr_space PathState *state, const float3 throughput)
|
||||||
{
|
{
|
||||||
if(state->flag & PATH_RAY_TRANSPARENT) {
|
if(state->flag & PATH_RAY_TRANSPARENT) {
|
||||||
/* Transparent rays are treated separately with own max bounces. */
|
/* Transparent rays are treated separately with own max bounces. */
|
||||||
|
|||||||
@@ -224,19 +224,19 @@ ccl_device void kernel_holdout_emission_blurring_pathtermination_ao(
|
|||||||
* shader evaluations, only need emission if we are going to terminate.
|
* shader evaluations, only need emission if we are going to terminate.
|
||||||
*/
|
*/
|
||||||
#ifndef __BRANCHED_PATH__
|
#ifndef __BRANCHED_PATH__
|
||||||
float probability = path_state_terminate_probability(kg, state, throughput);
|
float probability = path_state_continuation_probability(kg, state, throughput);
|
||||||
#else
|
#else
|
||||||
float probability = 1.0f;
|
float probability = 1.0f;
|
||||||
|
|
||||||
if(!kernel_data.integrator.branched) {
|
if(!kernel_data.integrator.branched) {
|
||||||
probability = path_state_terminate_probability(kg, state, throughput);
|
probability = path_state_continuation_probability(kg, state, throughput);
|
||||||
}
|
}
|
||||||
else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT)) {
|
else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT)) {
|
||||||
int num_samples = kernel_split_state.branched_state[ray_index].num_samples;
|
int num_samples = kernel_split_state.branched_state[ray_index].num_samples;
|
||||||
probability = path_state_terminate_probability(kg, state, throughput*num_samples);
|
probability = path_state_continuation_probability(kg, state, throughput*num_samples);
|
||||||
}
|
}
|
||||||
else if(state->flag & PATH_RAY_TRANSPARENT) {
|
else if(state->flag & PATH_RAY_TRANSPARENT) {
|
||||||
probability = path_state_terminate_probability(kg, state, throughput);
|
probability = path_state_continuation_probability(kg, state, throughput);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1358,7 +1358,7 @@ static void gpu_render_lamp_update(Scene *scene, View3D *v3d,
|
|||||||
if (layers &&
|
if (layers &&
|
||||||
GPU_lamp_has_shadow_buffer(lamp) &&
|
GPU_lamp_has_shadow_buffer(lamp) &&
|
||||||
/* keep last, may do string lookup */
|
/* keep last, may do string lookup */
|
||||||
GPU_lamp_override_visible(lamp, srl, NULL))
|
GPU_lamp_visible(lamp, srl, NULL))
|
||||||
{
|
{
|
||||||
View3DShadow *shadow = MEM_callocN(sizeof(View3DShadow), "View3DShadow");
|
View3DShadow *shadow = MEM_callocN(sizeof(View3DShadow), "View3DShadow");
|
||||||
shadow->lamp = lamp;
|
shadow->lamp = lamp;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ GPULamp *GPU_lamp_from_blender(struct Scene *scene, struct Object *ob, struct Ob
|
|||||||
void GPU_lamp_free(struct Object *ob);
|
void GPU_lamp_free(struct Object *ob);
|
||||||
void GPU_lamp_engine_data_free(LampEngineData *led);
|
void GPU_lamp_engine_data_free(LampEngineData *led);
|
||||||
|
|
||||||
bool GPU_lamp_override_visible(GPULamp *lamp, struct SceneRenderLayer *srl, struct Material *ma);
|
bool GPU_lamp_visible(GPULamp *lamp, struct SceneRenderLayer *srl, struct Material *ma);
|
||||||
bool GPU_lamp_has_shadow_buffer(GPULamp *lamp);
|
bool GPU_lamp_has_shadow_buffer(GPULamp *lamp);
|
||||||
void GPU_lamp_update_buffer_mats(GPULamp *lamp);
|
void GPU_lamp_update_buffer_mats(GPULamp *lamp);
|
||||||
void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[4][4], int *winsize, float winmat[4][4]);
|
void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[4][4], int *winsize, float winmat[4][4]);
|
||||||
|
|||||||
@@ -52,9 +52,11 @@
|
|||||||
|
|
||||||
#include "gpu_lamp_private.h"
|
#include "gpu_lamp_private.h"
|
||||||
|
|
||||||
bool GPU_lamp_override_visible(GPULamp *lamp, SceneRenderLayer *srl, Material *ma)
|
bool GPU_lamp_visible(GPULamp *lamp, SceneRenderLayer *srl, Material *ma)
|
||||||
{
|
{
|
||||||
if (srl && srl->light_override)
|
if (lamp->hide)
|
||||||
|
return false;
|
||||||
|
else if (srl && srl->light_override)
|
||||||
return BKE_group_object_exists(srl->light_override, lamp->ob);
|
return BKE_group_object_exists(srl->light_override, lamp->ob);
|
||||||
else if (ma && ma->group)
|
else if (ma && ma->group)
|
||||||
return BKE_group_object_exists(ma->group, lamp->ob);
|
return BKE_group_object_exists(ma->group, lamp->ob);
|
||||||
|
|||||||
@@ -280,8 +280,8 @@ void GPU_material_bind(
|
|||||||
for (LinkData *nlink = material->lamps.first; nlink; nlink = nlink->next) {
|
for (LinkData *nlink = material->lamps.first; nlink; nlink = nlink->next) {
|
||||||
GPULamp *lamp = nlink->data;
|
GPULamp *lamp = nlink->data;
|
||||||
|
|
||||||
if (!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay)) &&
|
if ((lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay)) &&
|
||||||
GPU_lamp_override_visible(lamp, srl, material->ma))
|
GPU_lamp_visible(lamp, srl, material->ma))
|
||||||
{
|
{
|
||||||
lamp->dynenergy = lamp->energy;
|
lamp->dynenergy = lamp->energy;
|
||||||
copy_v3_v3(lamp->dyncol, lamp->col);
|
copy_v3_v3(lamp->dyncol, lamp->col);
|
||||||
|
|||||||
Reference in New Issue
Block a user