18 #include "integrator/shader_eval.h"
40 const int num_channels = 3;
55 float u = (
x + 0.5f) /
width;
63 d_input_data[
x +
y *
width] = in;
71 float *d_output_data = d_output.data();
75 pixels[
y *
width +
x].x = d_output_data[(
y *
width +
x) * num_channels + 0];
76 pixels[
y *
width +
x].y = d_output_data[(
y *
width +
x) * num_channels + 1];
77 pixels[
y *
width +
x].z = d_output_data[(
y *
width +
x) * num_channels + 2];
112 SOCKET_INT(map_resolution,
"Map Resolution", 0);
135 SOCKET_NODE(shader,
"Shader", Shader::get_node_type());
201 bool has_portal =
false, has_background =
false;
204 has_portal |= light->is_portal;
208 bool background_enabled =
false;
209 int background_resolution = 0;
211 if (has_background) {
219 VLOG_INFO <<
"Background MIS has been disabled.\n";
223 light->is_enabled = !disable_mis;
224 background_enabled = !disable_mis;
225 background_resolution = light->map_resolution;
240 Geometry *geom =
object->get_geometry();
257 foreach (
Node *
node, geom->get_used_shaders()) {
271 progress.
set_status(
"Updating Lights",
"Computing distribution");
274 size_t num_lights = 0;
275 size_t num_portals = 0;
276 size_t num_background_lights = 0;
277 size_t num_triangles = 0;
279 bool background_mis =
false;
282 if (light->is_enabled) {
285 if (light->is_portal) {
299 Mesh *
mesh =
static_cast<Mesh *
>(
object->get_geometry());
301 for (
size_t i = 0; i < mesh_num_triangles; i++) {
302 int shader_index =
mesh->get_shader()[i];
303 Shader *shader = (shader_index <
mesh->get_used_shaders().
size()) ?
304 static_cast<Shader *
>(
mesh->get_used_shaders()[shader_index]) :
313 size_t num_distribution = num_triangles + num_lights;
314 VLOG_INFO <<
"Total " << num_distribution <<
" of light distribution primitives.";
318 float totarea = 0.0f;
333 Mesh *
mesh =
static_cast<Mesh *
>(
object->get_geometry());
354 if (!(object->get_is_shadow_catcher())) {
359 for (
size_t i = 0; i < mesh_num_triangles; i++) {
360 int shader_index =
mesh->get_shader()[i];
361 Shader *shader = (shader_index <
mesh->get_used_shaders().
size()) ?
362 static_cast<Shader *
>(
mesh->get_used_shaders()[shader_index]) :
373 if (!
t.valid(&
mesh->get_verts()[0])) {
380 if (!transform_applied) {
393 float trianglearea = totarea;
395 bool use_lamp_mis =
false;
398 if (num_lights > 0) {
399 float lightarea = (totarea > 0.0f) ? totarea / num_lights : 1.0f;
401 if (!light->is_enabled)
408 totarea += lightarea;
411 use_lamp_mis |= (light->angle > 0.0f && light->use_mis);
414 use_lamp_mis |= (light->size > 0.0f && light->use_mis);
417 use_lamp_mis |= light->use_mis;
420 num_background_lights++;
421 background_mis |= light->use_mis;
430 distribution[num_distribution].
totarea = totarea;
431 distribution[num_distribution].
prim = 0.0f;
432 distribution[num_distribution].
lamp.pad = 0.0f;
433 distribution[num_distribution].
lamp.size = 0.0f;
435 if (totarea > 0.0f) {
436 for (
size_t i = 0; i < num_distribution; i++)
437 distribution[i].totarea /= totarea;
438 distribution[num_distribution].
totarea = 1.0f;
445 KernelIntegrator *kintegrator = &dscene->
data.integrator;
446 KernelBackground *kbackground = &dscene->
data.background;
447 KernelFilm *kfilm = &dscene->
data.film;
448 kintegrator->use_direct_light = (totarea > 0.0f);
450 if (kintegrator->use_direct_light) {
452 kintegrator->num_distribution = num_distribution;
455 kintegrator->pdf_triangles = 0.0f;
456 kintegrator->pdf_lights = 0.0f;
459 kintegrator->num_all_lights = num_lights;
461 if (trianglearea > 0.0f) {
462 kintegrator->pdf_triangles = 1.0f / trianglearea;
464 kintegrator->pdf_triangles *= 0.5f;
468 kintegrator->pdf_lights = 1.0f / num_lights;
469 if (trianglearea > 0.0f)
470 kintegrator->pdf_lights *= 0.5f;
473 kintegrator->use_lamp_mis = use_lamp_mis;
477 kfilm->pass_shadow_scale = 1.0f;
479 if (kintegrator->pdf_triangles != 0.0f)
480 kfilm->pass_shadow_scale /= 0.5f;
482 if (num_background_lights < num_lights)
483 kfilm->pass_shadow_scale /= (
float)(num_lights - num_background_lights) / (
float)num_lights;
489 if (num_portals > 0) {
490 kbackground->portal_offset = light_index;
491 kbackground->num_portals = num_portals;
492 kbackground->portal_weight = 1.0f;
495 kbackground->num_portals = 0;
496 kbackground->portal_offset = 0;
497 kbackground->portal_weight = 0.0f;
501 kbackground->map_weight = background_mis ? 1.0f : 0.0f;
506 kintegrator->num_distribution = 0;
507 kintegrator->num_all_lights = 0;
508 kintegrator->pdf_triangles = 0.0f;
509 kintegrator->pdf_lights = 0.0f;
510 kintegrator->use_lamp_mis =
false;
512 kbackground->num_portals = 0;
513 kbackground->portal_offset = 0;
514 kbackground->portal_weight = 0.0f;
515 kbackground->sun_weight = 0.0f;
516 kbackground->map_weight = 0.0f;
518 kfilm->pass_shadow_scale = 1.0f;
525 int cdf_width = res_x + 1;
527 for (
int i = start; i < end; i++) {
528 float sin_theta =
sinf(
M_PI_F * (i + 0.5f) / res_y);
529 float3 env_color = (*pixels)[i * res_x];
530 float ave_luminance =
average(env_color);
532 cond_cdf[i * cdf_width].
x = ave_luminance * sin_theta;
533 cond_cdf[i * cdf_width].
y = 0.0f;
535 for (
int j = 1; j < res_x; j++) {
536 env_color = (*pixels)[i * res_x + j];
537 ave_luminance =
average(env_color);
539 cond_cdf[i * cdf_width + j].
x = ave_luminance * sin_theta;
540 cond_cdf[i * cdf_width + j].
y = cond_cdf[i * cdf_width + j - 1].
y +
541 cond_cdf[i * cdf_width + j - 1].
x / res_x;
544 const float cdf_total = cond_cdf[i * cdf_width + res_x - 1].
y +
545 cond_cdf[i * cdf_width + res_x - 1].
x / res_x;
549 cond_cdf[i * cdf_width + res_x].
x = cdf_total;
551 if (cdf_total > 0.0f) {
552 const float cdf_total_inv = 1.0f / cdf_total;
553 for (
int j = 1; j < res_x; j++) {
554 cond_cdf[i * cdf_width + j].
y *= cdf_total_inv;
558 cond_cdf[i * cdf_width + res_x].
y = 1.0f;
567 KernelBackground *kbackground = &dscene->
data.background;
573 background_light = light;
579 if (!background_light || !background_light->is_enabled) {
580 kbackground->map_res_x = 0;
581 kbackground->map_res_y = 0;
582 kbackground->map_weight = 0.0f;
583 kbackground->sun_weight = 0.0f;
584 kbackground->use_mis = (kbackground->portal_weight > 0.0f);
588 progress.
set_status(
"Updating Lights",
"Importance map");
590 assert(dscene->
data.integrator.use_direct_light);
596 if (
node->type == EnvironmentTextureNode::get_node_type()) {
601 environment_res.
x =
max(environment_res.
x, (
int)metadata.
width);
602 environment_res.
y =
max(environment_res.
y, (
int)metadata.
height);
605 if (
node->type == SkyTextureNode::get_node_type()) {
614 if ((vec_src->
type != TextureCoordinateNode::get_node_type()) ||
615 (vec_in->
link != vec_src->
output(
"Generated"))) {
616 environment_res.
x =
max(environment_res.
x, 4096);
617 environment_res.
y =
max(environment_res.
y, 2048);
623 float latitude = sky->get_sun_elevation();
633 sun_direction.
x, sun_direction.
y, sun_direction.
z, half_angle);
635 kbackground->sun_weight = 4.0f;
636 environment_res.
x =
max(environment_res.
x, 512);
637 environment_res.
y =
max(environment_res.
y, 256);
645 kbackground->sun_weight = 0.0f;
646 environment_res.
x =
max(environment_res.
x, 4096);
647 environment_res.
y =
max(environment_res.
y, 2048);
651 kbackground->use_mis = (kbackground->portal_weight + kbackground->map_weight +
652 kbackground->sun_weight) > 0.0f;
655 int2 res =
make_int2(background_light->map_resolution, background_light->map_resolution / 2);
658 res = environment_res;
659 if (res.
x > 0 && res.
y > 0) {
660 VLOG_INFO <<
"Automatically set World MIS resolution to " << res.
x <<
" by " << res.
y
665 if (res.
x == 0 || res.
y == 0) {
667 VLOG_INFO <<
"Setting World MIS resolution to default\n";
669 kbackground->map_res_x = res.
x;
670 kbackground->map_res_y = res.
y;
679 int cdf_width = res.
x + 1;
686 const int rows_per_task =
divide_up(10240, res.
x);
688 [&](
const blocked_range<size_t> &
r) {
689 background_cdf(r.begin(), r.end(), res.x, res.y, &pixels, cond_cdf);
693 marg_cdf[0].
x = cond_cdf[res.
x].
x;
694 marg_cdf[0].
y = 0.0f;
696 for (
int i = 1; i < res.
y; i++) {
697 marg_cdf[i].
x = cond_cdf[i * cdf_width + res.
x].
x;
698 marg_cdf[i].
y = marg_cdf[i - 1].
y + marg_cdf[i - 1].
x / res.
y;
701 float cdf_total = marg_cdf[res.
y - 1].
y + marg_cdf[res.
y - 1].
x / res.
y;
702 marg_cdf[res.
y].
x = cdf_total;
704 if (cdf_total > 0.0f)
705 for (
int i = 1; i < res.
y; i++)
706 marg_cdf[i].
y /= cdf_total;
708 marg_cdf[res.
y].
y = 1.0f;
710 VLOG_WORK <<
"Background MIS build time " <<
time_dt() - time_start <<
"\n";
723 if (light->is_enabled || light->is_portal) {
730 if (num_lights == 0) {
731 VLOG_WORK <<
"No effective light, ignoring points update.";
738 if (!light->is_enabled) {
745 int max_bounces = light->max_bounces;
746 float random = (
float)light->random_id * (1.0f / (
float)0xFFFFFFFF);
748 if (!light->cast_shadow)
751 if (!light->use_camera) {
754 if (!light->use_diffuse) {
757 if (!light->use_glossy) {
760 if (!light->use_transmission) {
763 if (!light->use_scatter) {
766 if (!light->is_shadow_catcher) {
770 klights[light_index].
type = light->light_type;
771 klights[light_index].
strength[0] = light->strength.x;
772 klights[light_index].
strength[1] = light->strength.y;
773 klights[light_index].
strength[2] = light->strength.z;
778 float radius = light->size;
779 float invarea = (radius > 0.0f) ? 1.0f / (
M_PI_F * radius * radius) : 1.0f;
781 if (light->use_mis && radius > 0.0f)
784 klights[light_index].
co[0] = co.
x;
785 klights[light_index].
co[1] = co.
y;
786 klights[light_index].
co[2] = co.
z;
794 float angle = light->angle / 2.0f;
798 float invarea = (
area > 0.0f) ? 1.0f /
area : 1.0f;
803 if (light->use_mis &&
area > 0.0f)
806 klights[light_index].
co[0] = dir.
x;
807 klights[light_index].
co[1] = dir.
y;
808 klights[light_index].
co[2] = dir.
z;
834 float3 axisu = light->axisu * (light->sizeu * light->size);
835 float3 axisv = light->axisv * (light->sizev * light->size);
840 float invarea = (
area != 0.0f) ? 1.0f /
area : 1.0f;
845 const float min_spread_angle = 1.0f *
M_PI_F / 180.0f;
846 const float spread_angle = 0.5f * (
M_PI_F -
max(light->spread, min_spread_angle));
849 const float tan_spread =
tanf(spread_angle);
850 const float normalize_spread = 2.0f / (2.0f + (2.0f * spread_angle -
M_PI_F) * tan_spread);
854 if (light->use_mis &&
area != 0.0f)
857 klights[light_index].
co[0] = co.
x;
858 klights[light_index].
co[1] = co.
y;
859 klights[light_index].
co[2] = co.
z;
868 klights[light_index].
area.
dir[0] = dir.
x;
869 klights[light_index].
area.
dir[1] = dir.
y;
870 klights[light_index].
area.
dir[2] = dir.
z;
877 float radius = light->size;
878 float invarea = (radius > 0.0f) ? 1.0f / (
M_PI_F * radius * radius) : 1.0f;
879 float spot_angle =
cosf(light->spot_angle * 0.5f);
880 float spot_smooth = (1.0f - spot_angle) * light->spot_smooth;
885 if (light->use_mis && radius > 0.0f)
888 klights[light_index].
co[0] = co.
x;
889 klights[light_index].
co[1] = co.
y;
890 klights[light_index].
co[2] = co.
z;
896 klights[light_index].
spot.
dir[0] = dir.x;
897 klights[light_index].
spot.
dir[1] = dir.y;
898 klights[light_index].
spot.
dir[2] = dir.z;
901 klights[light_index].
shader_id = shader_id;
905 klights[light_index].
use_caustics = light->use_caustics;
907 klights[light_index].
tfm = light->tfm;
925 if (!light->is_portal)
930 float3 axisu = light->axisu * (light->sizeu * light->size);
931 float3 axisv = light->axisv * (light->sizev * light->size);
936 float invarea = (
area != 0.0f) ? 1.0f /
area : 1.0f;
941 klights[light_index].
co[0] = co.
x;
942 klights[light_index].
co[1] = co.
y;
943 klights[light_index].
co[2] = co.
z;
952 klights[light_index].
area.
dir[0] = dir.
x;
953 klights[light_index].
area.
dir[1] = dir.
y;
954 klights[light_index].
area.
dir[2] = dir.
z;
955 klights[light_index].
tfm = light->tfm;
961 VLOG_INFO <<
"Number of lights sent to the device: " << light_index;
963 VLOG_INFO <<
"Number of lights without contribution: " << num_scene_lights - light_index;
978 scene->update_stats->light.times.add_entry({
"device_update", time});
985 test_enabled_lights(
scene);
987 device_free(device, dscene, need_update_background);
989 device_update_points(device, dscene,
scene);
990 if (progress.get_cancel())
993 device_update_distribution(device, dscene,
scene, progress);
994 if (progress.get_cancel())
997 if (need_update_background) {
998 device_update_background(device, dscene,
scene, progress);
999 if (progress.get_cancel())
1003 device_update_ies(dscene);
1004 if (progress.get_cancel())
1007 update_flags = UPDATE_NONE;
1008 need_update_background =
false;
1015 if (free_background) {
1037 if (filename.empty() || !
path_read_text(filename.c_str(), content)) {
1052 for (slot = 0; slot <
ies_slots.size(); slot++) {
1060 for (slot = 0; slot <
ies_slots.size(); slot++) {
1085 if (slot < 0 || slot >=
ies_slots.size()) {
1104 if (slot->
users == 0) {
1112 for (slot_end =
ies_slots.size(); slot_end; slot_end--) {
1125 int packed_size = 0;
1136 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 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 type
_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 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
virtual void const_copy_to(const char *name, void *host, size_t size)=0
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
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_="")
bool eval(const ShaderEvalType type, const int max_num_inputs, const int num_channels, const function< int(device_vector< KernelShaderEvalInput > &)> &fill_input, const function< void(device_vector< float > &)> &read_output)
list< ShaderNode * > nodes
int get_shader_id(Shader *shader, bool smooth=false)
ShaderInput * input(const char *name)
ShaderOutput * output(const char *name)
bool has_surface_spatial_varying
NODE_DECLARE ShaderGraph * graph
bool has_surface_emission
Transform compute_transform()
TextureMapping tex_mapping
T * alloc(size_t width, size_t height=0, size_t depth=0)
#define CCL_NAMESPACE_END
IMETHOD void random(Vector &a)
addDelta operator for displacement rotational velocity.
static uint hash_string(const char *str)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
@ PATH_RAY_VOLUME_SCATTER
@ SHADER_EXCLUDE_SHADOW_CATCHER
@ SHADER_EXCLUDE_TRANSMIT
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()
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRefNull prop_name, int32_t value)
Allocate a new IDProperty of type IDP_INT, set its name and value.
static void area(int d1, int d2, int e1, int e2, float weights[2])
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_STRING(name, ui_name, default_value,...)
#define SOCKET_ENUM(name, ui_name, values, default_value,...)
bool path_read_text(const string &path, string &text)
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)
__forceinline bool valid() const
struct KernelLightDistribution::@1252::@1254 mesh_light
struct KernelLightDistribution::@1252::@1255 lamp
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)
void dereference_all_used_nodes()
NODE_DECLARE BoundBox bounds
vector< Object * > objects
ShaderManager * shader_manager
LightManager * light_manager
map< ustring, int > lightgroups
SceneUpdateStats * update_stats
std::unique_lock< std::mutex > thread_scoped_lock
CCL_NAMESPACE_BEGIN double time_dt()
ccl_device_inline float triangle_area(ccl_private const float3 &v1, ccl_private const float3 &v2, ccl_private const float3 &v3)
ccl_device_inline float __int_as_float(int i)
ccl_device_inline size_t divide_up(size_t x, size_t y)