integrator.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright 2011-2013 Blender Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef __INTEGRATOR_H__
  17. #define __INTEGRATOR_H__
  18. #include "kernel/kernel_types.h"
  19. #include "graph/node.h"
  20. CCL_NAMESPACE_BEGIN
  21. class Device;
  22. class DeviceScene;
  23. class Scene;
  24. class Integrator : public Node {
  25. public:
  26. NODE_DECLARE
  27. int min_bounce;
  28. int max_bounce;
  29. int max_diffuse_bounce;
  30. int max_glossy_bounce;
  31. int max_transmission_bounce;
  32. int max_volume_bounce;
  33. int transparent_min_bounce;
  34. int transparent_max_bounce;
  35. int ao_bounces;
  36. int volume_max_steps;
  37. float volume_step_size;
  38. bool caustics_reflective;
  39. bool caustics_refractive;
  40. float filter_glossy;
  41. int seed;
  42. float sample_clamp_direct;
  43. float sample_clamp_indirect;
  44. bool motion_blur;
  45. /* Maximum number of samples, beyond which we are likely to run into
  46. * precision issues for sampling patterns. */
  47. static const int MAX_SAMPLES = (1 << 24);
  48. int aa_samples;
  49. int diffuse_samples;
  50. int glossy_samples;
  51. int transmission_samples;
  52. int ao_samples;
  53. int mesh_light_samples;
  54. int subsurface_samples;
  55. int volume_samples;
  56. int start_sample;
  57. bool sample_all_lights_direct;
  58. bool sample_all_lights_indirect;
  59. float light_sampling_threshold;
  60. enum Method {
  61. BRANCHED_PATH = 0,
  62. PATH = 1,
  63. NUM_METHODS,
  64. };
  65. Method method;
  66. SamplingPattern sampling_pattern;
  67. bool need_update;
  68. Integrator();
  69. ~Integrator();
  70. void device_update(Device *device, DeviceScene *dscene, Scene *scene);
  71. void device_free(Device *device, DeviceScene *dscene);
  72. bool modified(const Integrator &integrator);
  73. void tag_update(Scene *scene);
  74. };
  75. CCL_NAMESPACE_END
  76. #endif /* __INTEGRATOR_H__ */