54 float u = (
x + 0.5f) /
width;
58 d_input_data[
x +
y *
width] = in;
79 list<DeviceTask> split_tasks;
80 main_task.
split(split_tasks, 1, 128 * 128);
90 float4 *d_output_data = d_output.
data();
134 SOCKET_INT(map_resolution,
"Map Resolution", 0);
169 if (samples_is_modified()) {
223 bool has_portal =
false, has_background =
false;
226 has_portal |= light->is_portal;
230 bool background_enabled =
false;
231 int background_resolution = 0;
233 if (has_background) {
239 const bool disable_mis = !(has_portal ||
shader->has_surface_spatial_varying);
240 VLOG_IF(1, disable_mis) <<
"Background MIS has been disabled.\n";
243 light->is_enabled = !disable_mis;
244 background_enabled = !disable_mis;
245 background_resolution = light->map_resolution;
260 Geometry *geom =
object->get_geometry();
277 foreach (
Node *
node, geom->get_used_shaders()) {
279 if (
shader->get_use_mis() &&
shader->has_surface_emission) {
291 progress.
set_status(
"Updating Lights",
"Computing distribution");
294 size_t num_lights = 0;
295 size_t num_portals = 0;
296 size_t num_background_lights = 0;
297 size_t num_triangles = 0;
299 bool background_mis =
false;
302 if (light->is_enabled) {
305 if (light->is_portal) {
319 Mesh *
mesh =
static_cast<Mesh *
>(
object->get_geometry());
321 for (
size_t i = 0; i < mesh_num_triangles; i++) {
322 int shader_index =
mesh->get_shader()[i];
324 static_cast<Shader *
>(
mesh->get_used_shaders()[shader_index]) :
333 size_t num_distribution = num_triangles + num_lights;
334 VLOG(1) <<
"Total " << num_distribution <<
" of light distribution primitives.";
338 float totarea = 0.0f;
353 Mesh *
mesh =
static_cast<Mesh *
>(
object->get_geometry());
377 for (
size_t i = 0; i < mesh_num_triangles; i++) {
378 int shader_index =
mesh->get_shader()[i];
380 static_cast<Shader *
>(
mesh->get_used_shaders()[shader_index]) :
384 distribution[offset].
totarea = totarea;
386 distribution[offset].
mesh_light.shader_flag = shader_flag;
387 distribution[offset].
mesh_light.object_id = object_id;
391 if (!
t.valid(&
mesh->get_verts()[0])) {
398 if (!transform_applied) {
411 float trianglearea = totarea;
414 float lightarea = (totarea > 0.0f) ? totarea / num_lights : 1.0f;
415 bool use_lamp_mis =
false;
419 if (!light->is_enabled)
422 distribution[offset].
totarea = totarea;
423 distribution[offset].
prim = ~light_index;
424 distribution[offset].
lamp.pad = 1.0f;
425 distribution[offset].
lamp.size = light->size;
426 totarea += lightarea;
429 use_lamp_mis |= (light->angle > 0.0f && light->use_mis);
432 use_lamp_mis |= (light->size > 0.0f && light->use_mis);
435 use_lamp_mis |= light->use_mis;
438 num_background_lights++;
439 background_mis |= light->use_mis;
447 distribution[num_distribution].
totarea = totarea;
448 distribution[num_distribution].
prim = 0.0f;
449 distribution[num_distribution].
lamp.pad = 0.0f;
450 distribution[num_distribution].
lamp.size = 0.0f;
452 if (totarea > 0.0f) {
453 for (
size_t i = 0; i < num_distribution; i++)
454 distribution[i].totarea /= totarea;
455 distribution[num_distribution].
totarea = 1.0f;
478 if (trianglearea > 0.0f) {
486 if (trianglearea > 0.0f)
499 if (num_background_lights < num_lights)
506 if (num_portals > 0) {
518 kbackground->
map_weight = background_mis ? 1.0f : 0.0f;
542 int cdf_width = res_x + 1;
544 for (
int i = start; i < end; i++) {
545 float sin_theta =
sinf(
M_PI_F * (i + 0.5f) / res_y);
546 float3 env_color = (*pixels)[i * res_x];
547 float ave_luminance =
average(env_color);
549 cond_cdf[i * cdf_width].
x = ave_luminance * sin_theta;
550 cond_cdf[i * cdf_width].
y = 0.0f;
552 for (
int j = 1; j < res_x; j++) {
553 env_color = (*pixels)[i * res_x + j];
554 ave_luminance =
average(env_color);
556 cond_cdf[i * cdf_width + j].
x = ave_luminance * sin_theta;
557 cond_cdf[i * cdf_width + j].
y = cond_cdf[i * cdf_width + j - 1].
y +
558 cond_cdf[i * cdf_width + j - 1].
x / res_x;
561 const float cdf_total = cond_cdf[i * cdf_width + res_x - 1].
y +
562 cond_cdf[i * cdf_width + res_x - 1].
x / res_x;
566 cond_cdf[i * cdf_width + res_x].
x = cdf_total;
568 if (cdf_total > 0.0f) {
569 const float cdf_total_inv = 1.0f / cdf_total;
570 for (
int j = 1; j < res_x; j++) {
571 cond_cdf[i * cdf_width + j].
y *= cdf_total_inv;
575 cond_cdf[i * cdf_width + res_x].
y = 1.0f;
590 background_light = light;
596 if (!background_light || !background_light->is_enabled) {
605 progress.
set_status(
"Updating Lights",
"Importance map");
613 if (
node->type == EnvironmentTextureNode::get_node_type()) {
618 environment_res.
x =
max(environment_res.
x, metadata.
width);
619 environment_res.
y =
max(environment_res.
y, metadata.
height);
622 if (
node->type == SkyTextureNode::get_node_type()) {
631 if ((vec_src->
type != TextureCoordinateNode::get_node_type()) ||
632 (vec_in->
link != vec_src->
output(
"Generated"))) {
633 environment_res.
x =
max(environment_res.
x, 4096);
634 environment_res.
y =
max(environment_res.
y, 2048);
640 float latitude = sky->get_sun_elevation();
650 sun_direction.
x, sun_direction.
y, sun_direction.
z, half_angle);
653 environment_res.
x =
max(environment_res.
x, 512);
654 environment_res.
y =
max(environment_res.
y, 256);
663 environment_res.
x =
max(environment_res.
x, 4096);
664 environment_res.
y =
max(environment_res.
y, 2048);
672 int2 res =
make_int2(background_light->map_resolution, background_light->map_resolution / 2);
675 res = environment_res;
676 if (res.
x > 0 && res.
y > 0) {
677 VLOG(2) <<
"Automatically set World MIS resolution to " << res.
x <<
" by " << res.
y <<
"\n";
681 if (res.
x == 0 || res.
y == 0) {
683 VLOG(2) <<
"Setting World MIS resolution to default\n";
695 int cdf_width = res.
x + 1;
702 const int rows_per_task =
divide_up(10240, res.
x);
704 [&](
const blocked_range<size_t> &
r) {
705 background_cdf(r.begin(), r.end(), res.x, res.y, &pixels, cond_cdf);
709 marg_cdf[0].
x = cond_cdf[res.
x].
x;
710 marg_cdf[0].
y = 0.0f;
712 for (
int i = 1; i < res.
y; i++) {
713 marg_cdf[i].
x = cond_cdf[i * cdf_width + res.
x].
x;
714 marg_cdf[i].
y = marg_cdf[i - 1].
y + marg_cdf[i - 1].
x / res.
y;
717 float cdf_total = marg_cdf[res.
y - 1].
y + marg_cdf[res.
y - 1].
x / res.
y;
718 marg_cdf[res.
y].
x = cdf_total;
720 if (cdf_total > 0.0f)
721 for (
int i = 1; i < res.
y; i++)
722 marg_cdf[i].
y /= cdf_total;
724 marg_cdf[res.
y].
y = 1.0f;
726 VLOG(2) <<
"Background MIS build time " <<
time_dt() - time_start <<
"\n";
739 if (light->is_enabled || light->is_portal) {
746 if (num_lights == 0) {
747 VLOG(1) <<
"No effective light, ignoring points update.";
754 if (!light->is_enabled) {
761 int max_bounces = light->max_bounces;
762 float random = (
float)light->random_id * (1.0f / (
float)0xFFFFFFFF);
764 if (!light->cast_shadow)
767 if (!light->use_diffuse) {
771 if (!light->use_glossy) {
775 if (!light->use_transmission) {
779 if (!light->use_scatter) {
784 klights[light_index].
type = light->light_type;
785 klights[light_index].
samples = light->samples;
786 klights[light_index].
strength[0] = light->strength.x;
787 klights[light_index].
strength[1] = light->strength.y;
788 klights[light_index].
strength[2] = light->strength.z;
793 float radius = light->size;
794 float invarea = (radius > 0.0f) ? 1.0f / (
M_PI_F * radius * radius) : 1.0f;
796 if (light->use_mis && radius > 0.0f)
799 klights[light_index].
co[0] = co.
x;
800 klights[light_index].
co[1] = co.
y;
801 klights[light_index].
co[2] = co.
z;
809 float angle = light->angle / 2.0f;
813 float invarea = (
area > 0.0f) ? 1.0f /
area : 1.0f;
818 if (light->use_mis &&
area > 0.0f)
821 klights[light_index].
co[0] = dir.
x;
822 klights[light_index].
co[1] = dir.
y;
823 klights[light_index].
co[2] = dir.
z;
853 float3 axisu = light->axisu * (light->sizeu * light->size);
854 float3 axisv = light->axisv * (light->sizev * light->size);
859 float invarea = (
area != 0.0f) ? 1.0f /
area : 1.0f;
864 const float min_spread_angle = 1.0f *
M_PI_F / 180.0f;
865 const float spread_angle = 0.5f * (
M_PI_F -
max(light->spread, min_spread_angle));
868 const float tan_spread =
tanf(spread_angle);
869 const float normalize_spread = 2.0f / (2.0f + (2.0f * spread_angle -
M_PI_F) * tan_spread);
873 if (light->use_mis &&
area != 0.0f)
876 klights[light_index].
co[0] = co.
x;
877 klights[light_index].
co[1] = co.
y;
878 klights[light_index].
co[2] = co.
z;
887 klights[light_index].
area.
dir[0] = dir.
x;
888 klights[light_index].
area.
dir[1] = dir.
y;
889 klights[light_index].
area.
dir[2] = dir.
z;
896 float radius = light->size;
897 float invarea = (radius > 0.0f) ? 1.0f / (
M_PI_F * radius * radius) : 1.0f;
898 float spot_angle =
cosf(light->spot_angle * 0.5f);
899 float spot_smooth = (1.0f - spot_angle) * light->spot_smooth;
904 if (light->use_mis && radius > 0.0f)
907 klights[light_index].
co[0] = co.
x;
908 klights[light_index].
co[1] = co.
y;
909 klights[light_index].
co[2] = co.
z;
915 klights[light_index].
spot.
dir[0] = dir.x;
916 klights[light_index].
spot.
dir[1] = dir.y;
917 klights[light_index].
spot.
dir[2] = dir.z;
920 klights[light_index].
shader_id = shader_id;
925 klights[light_index].
tfm = light->tfm;
935 if (!light->is_portal)
940 float3 axisu = light->axisu * (light->sizeu * light->size);
941 float3 axisv = light->axisv * (light->sizev * light->size);
946 float invarea = (
area != 0.0f) ? 1.0f /
area : 1.0f;
951 klights[light_index].
co[0] = co.
x;
952 klights[light_index].
co[1] = co.
y;
953 klights[light_index].
co[2] = co.
z;
962 klights[light_index].
area.
dir[0] = dir.
x;
963 klights[light_index].
area.
dir[1] = dir.
y;
964 klights[light_index].
area.
dir[2] = dir.
z;
965 klights[light_index].
tfm = light->tfm;
971 VLOG(1) <<
"Number of lights sent to the device: " << light_index;
973 VLOG(1) <<
"Number of lights without contribution: " << num_scene_lights - light_index;
988 scene->update_stats->light.times.add_entry({
"device_update", time});
995 test_enabled_lights(
scene);
997 device_free(device, dscene, need_update_background);
999 use_light_visibility =
false;
1001 device_update_points(device, dscene,
scene);
1002 if (progress.get_cancel())
1005 device_update_distribution(device, dscene,
scene, progress);
1006 if (progress.get_cancel())
1009 if (need_update_background) {
1010 device_update_background(device, dscene,
scene, progress);
1011 if (progress.get_cancel())
1015 device_update_ies(dscene);
1016 if (progress.get_cancel())
1019 scene->
film->set_use_light_visibility(use_light_visibility);
1021 update_flags = UPDATE_NONE;
1022 need_update_background =
false;
1029 if (free_background) {
1051 if (filename.empty() || !
path_read_text(filename.c_str(), content)) {
1066 for (slot = 0; slot <
ies_slots.size(); slot++) {
1074 for (slot = 0; slot <
ies_slots.size(); slot++) {
1099 if (slot < 0 || slot >=
ies_slots.size()) {
1118 if (slot->
users == 0) {
1126 for (slot_end =
ies_slots.size(); slot_end; slot_end--) {
1139 int packed_size = 0;
1150 for (
int i = 0; i <
ies_slots.size(); i++) {
typedef float(TangentPoint)[2]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Shader * get_shader(const Scene *scene)
device_vector< float2 > light_background_marginal_cdf
device_vector< float > ies_lights
device_vector< float2 > light_background_conditional_cdf
device_vector< KernelLightDistribution > light_distribution
device_vector< KernelLight > lights
void split(list< DeviceTask > &tasks, int num, int max_size=0) const
function< bool()> get_cancel
virtual void const_copy_to(const char *name, void *host, size_t size)=0
virtual void task_wait()=0
virtual void task_add(DeviceTask &task)=0
void tag_update(Scene *scene, uint32_t flag)
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
void device_update_ies(DeviceScene *dscene)
int add_ies(const string &ies)
vector< IESSlot * > ies_slots
int add_ies_from_file(const string &filename)
void test_enabled_lights(Scene *scene)
void device_free(Device *device, DeviceScene *dscene, const bool free_background=true)
void device_update_distribution(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
bool need_update_background
bool use_light_visibility
void device_update_points(Device *device, DeviceScene *dscene, Scene *scene)
void remove_ies(int slot)
void device_update_background(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
int last_background_resolution
bool has_background_light(Scene *scene)
bool object_usable_as_light(Object *object)
void tag_update(Scene *scene, uint32_t flag)
bool last_background_enabled
void set_status(const string &status_, const string &substatus_="")
int get_shader_id(Shader *shader, bool smooth=false)
ShaderInput * input(const char *name)
ShaderOutput * output(const char *name)
bool has_surface_emission
Transform compute_transform()
TextureMapping tex_mapping
device_ptr device_pointer
T * alloc(size_t width, size_t height=0, size_t depth=0)
IMETHOD void random(Vector &a)
addDelta operator for displacement rotational velocity.
#define CCL_NAMESPACE_END
#define make_float4(x, y, z, w)
#define make_float3(x, y, z)
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
@ PATH_RAY_VOLUME_SCATTER
@ SHADER_EXCLUDE_TRANSMIT
static void background_cdf(int start, int end, int res_x, int res_y, const vector< float3 > *pixels, float2 *cond_cdf)
static CCL_NAMESPACE_BEGIN void shade_background_pixels(Device *device, DeviceScene *dscene, int width, int height, vector< float3 > &pixels, Progress &progress)
static void area(int d1, int d2, int e1, int e2, float weights[2])
struct blender::compositor::@172::@174 task
void parallel_for(IndexRange range, int64_t grain_size, const Function &function)
#define SOCKET_POINT(name, ui_name, default_value,...)
#define SOCKET_FLOAT(name, ui_name, default_value,...)
#define SOCKET_INT(name, ui_name, default_value,...)
#define SOCKET_NODE(name, ui_name, node_type,...)
#define SOCKET_TRANSFORM(name, ui_name, default_value,...)
#define SOCKET_UINT(name, ui_name, default_value,...)
#define SOCKET_VECTOR(name, ui_name, default_value,...)
#define SOCKET_COLOR(name, ui_name, default_value,...)
#define SOCKET_BOOLEAN(name, ui_name, default_value,...)
#define SOCKET_ENUM(name, ui_name, values, default_value,...)
__forceinline bool valid() const
KernelBackground background
KernelIntegrator integrator
struct KernelLightDistribution::@1195::@1198 lamp
struct KernelLightDistribution::@1195::@1197 mesh_light
KernelDistantLight distant
void tag_update(Scene *scene)
bool has_contribution(Scene *scene)
Triangle get_triangle(size_t i) const
size_t num_triangles() const
void insert(const char *x, int y)
static NodeType * add(const char *name, CreateFunc create, Type type=NONE, const NodeType *base=NULL)
NODE_DECLARE BoundBox bounds
vector< Object * > objects
ShaderManager * shader_manager
LightManager * light_manager
SceneUpdateStats * update_stats
static uint hash_string(const char *str)
#define VLOG_IF(severity, condition)
ccl_device_inline int __float_as_int(float f)
ccl_device_inline float triangle_area(const float3 &v1, const float3 &v2, const float3 &v3)
ccl_device_inline float __int_as_float(int i)
ccl_device_inline float2 safe_normalize(const float2 &a)
ccl_device_inline float average(const float2 &a)
ccl_device_inline float3 one_float3()
ccl_device_inline float3 zero_float3()
bool path_read_text(const string &path, string &text)
std::unique_lock< std::mutex > thread_scoped_lock
CCL_NAMESPACE_BEGIN double time_dt()
ccl_device_inline size_t divide_up(size_t x, size_t y)
ccl_device_inline uint4 make_uint4(uint x, uint y, uint z, uint w)