2011-04-27 11:58:34 +00:00
#
2013-08-18 14:16:15 +00:00
# Copyright 2011-2013 Blender Foundation
2011-04-27 11:58:34 +00:00
#
2013-08-18 14:16:15 +00:00
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
2011-04-27 11:58:34 +00:00
#
2013-08-18 14:16:15 +00:00
# http://www.apache.org/licenses/LICENSE-2.0
2011-04-27 11:58:34 +00:00
#
2013-08-18 14:16:15 +00:00
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
2014-12-25 02:50:24 +01:00
# limitations under the License.
2011-04-27 11:58:34 +00:00
#
2011-11-15 02:58:01 +00:00
# <pep8 compliant>
2011-04-27 11:58:34 +00:00
import bpy
2011-11-24 21:14:48 +00:00
from bpy . props import ( BoolProperty ,
EnumProperty ,
2011-11-24 19:36:12 +00:00
FloatProperty ,
IntProperty ,
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
PointerProperty ,
StringProperty )
2011-04-27 11:58:34 +00:00
2012-12-13 08:45:55 +00:00
# enums
2013-12-07 02:29:53 +01:00
import _cycles
2012-12-13 08:45:55 +00:00
enum_devices = (
2013-12-30 12:06:36 +11:00
( ' CPU ' , " CPU " , " Use CPU for rendering " ) ,
2016-11-19 01:15:08 +01:00
( ' GPU ' , " GPU Compute " , " Use GPU compute device for rendering, configured in the system tab in the user preferences " ) ,
2013-12-30 12:06:36 +11:00
)
2013-12-07 02:29:53 +01:00
if _cycles . with_network :
2014-02-13 08:51:33 +11:00
enum_devices + = ( ( ' NETWORK ' , " Networked Device " , " Use networked device for rendering " ) , )
2012-12-13 08:45:55 +00:00
enum_feature_set = (
( ' SUPPORTED ' , " Supported " , " Only use finished and supported features " ) ,
2014-09-26 01:02:28 +06:00
( ' EXPERIMENTAL ' , " Experimental " , " Use experimental and incomplete features that might be broken or change in the future " , ' ERROR ' , 1 ) ,
2012-12-13 08:45:55 +00:00
)
enum_displacement_methods = (
2018-01-25 14:08:56 +01:00
( ' BUMP ' , " Bump Only " , " Bump mapping to simulate the appearance of displacement " ) ,
( ' DISPLACEMENT ' , " Displacement Only " , " Use true displacement of surface only, requires fine subdivision " ) ,
( ' BOTH ' , " Displacement and Bump " , " Combination of true displacement and bump mapping for finer detail " ) ,
2012-12-13 08:45:55 +00:00
)
2018-01-19 10:59:58 +01:00
enum_bvh_layouts = (
( ' BVH2 ' , " BVH2 " , " " , 1 ) ,
( ' BVH4 ' , " BVH4 " , " " , 2 ) ,
)
2012-12-13 08:45:55 +00:00
enum_bvh_types = (
( ' DYNAMIC_BVH ' , " Dynamic BVH " , " Objects can be individually updated, at the cost of slower render time " ) ,
( ' STATIC_BVH ' , " Static BVH " , " Any object modification requires a complete BVH rebuild, but renders faster " ) ,
)
enum_filter_types = (
( ' BOX ' , " Box " , " Box filter " ) ,
( ' GAUSSIAN ' , " Gaussian " , " Gaussian filter " ) ,
2015-08-06 21:04:43 +02:00
( ' BLACKMAN_HARRIS ' , " Blackman-Harris " , " Blackman-Harris filter " ) ,
2012-12-13 08:45:55 +00:00
)
enum_aperture_types = (
( ' RADIUS ' , " Radius " , " Directly change the size of the aperture " ) ,
2015-02-16 20:00:20 +01:00
( ' FSTOP ' , " F-stop " , " Change the size of the aperture by f-stop " ) ,
2012-12-13 08:45:55 +00:00
)
enum_panorama_types = (
( ' EQUIRECTANGULAR ' , " Equirectangular " , " Render the scene with a spherical camera, also known as Lat Long panorama " ) ,
( ' FISHEYE_EQUIDISTANT ' , " Fisheye Equidistant " , " Ideal for fulldomes, ignore the sensor dimensions " ) ,
( ' FISHEYE_EQUISOLID ' , " Fisheye Equisolid " ,
" Similar to most fisheye modern lens, takes sensor dimensions into consideration " ) ,
2015-04-25 23:49:17 +02:00
( ' MIRRORBALL ' , " Mirror Ball " , " Uses the mirror ball mapping " ) ,
2012-12-13 08:45:55 +00:00
)
2012-12-30 23:21:33 +00:00
2012-12-28 14:21:30 +00:00
enum_curve_primitives = (
2012-12-30 23:21:33 +00:00
( ' TRIANGLES ' , " Triangles " , " Create triangle geometry around strands " ) ,
( ' LINE_SEGMENTS ' , " Line Segments " , " Use line segment primitives " ) ,
2013-01-15 19:44:41 +00:00
( ' CURVE_SEGMENTS ' , " Curve Segments " , " Use segmented cardinal curve primitives " ) ,
2012-12-28 14:21:30 +00:00
)
2012-12-30 23:21:33 +00:00
2012-12-28 14:21:30 +00:00
enum_triangle_curves = (
2013-01-15 19:44:41 +00:00
( ' CAMERA_TRIANGLES ' , " Planes " , " Create individual triangles forming planes that face camera " ) ,
( ' TESSELLATED_TRIANGLES ' , " Tessellated " , " Create mesh surrounding each strand " ) ,
2012-12-28 14:21:30 +00:00
)
2012-12-30 23:21:33 +00:00
2013-08-18 13:41:53 +00:00
enum_curve_shape = (
( ' RIBBONS ' , " Ribbons " , " Ignore thickness of each strand " ) ,
( ' THICK ' , " Thick " , " Use thickness of strand when rendering " ) ,
2012-12-28 14:21:30 +00:00
)
2013-01-15 23:17:45 +00:00
2013-01-07 19:55:49 +00:00
enum_tile_order = (
( ' CENTER ' , " Center " , " Render from center to the edges " ) ,
( ' RIGHT_TO_LEFT ' , " Right to Left " , " Render from right to left " ) ,
( ' LEFT_TO_RIGHT ' , " Left to Right " , " Render from left to right " ) ,
( ' TOP_TO_BOTTOM ' , " Top to Bottom " , " Render from top to bottom " ) ,
( ' BOTTOM_TO_TOP ' , " Bottom to Top " , " Render from bottom to top " ) ,
Cycles: Adding Hilbert Spiral as a tile order for rendering
This patch adds the "Hilbert Spiral", a custom-designed continuous space-filling curve, as a tile order for rendering in Cycles.
It essentially works by dividing the tiles into tile blocks which are processed in a spiral outwards from the center. Inside each
block, the tiles are processed in a regular Hilbert curve pattern. By rotating that pattern according to the spiral direction,
a continuous curve is obtained, which helps with cache coherency and therefore rendering speed.
The curve is a compromise between the faster-rendering Bottom-to-Top etc. orders and the Center order, which is a bit slower,
but starts with the more important areas. The Hilbert Spiral also starts in the center (unless huge tiles are used) and is still
marginally slower than Bottom-to-Top, but noticeably faster than Center.
Reviewers: sergey, #cycles, dingto
Reviewed By: #cycles, dingto
Subscribers: iscream, gregzaal, sergey, mib2berlin
Differential Revision: https://developer.blender.org/D1166
2016-01-10 00:11:34 +01:00
( ' HILBERT_SPIRAL ' , " Hilbert Spiral " , " Render in a Hilbert Spiral " ) ,
2013-01-07 19:55:49 +00:00
)
2011-11-15 02:58:01 +00:00
2013-04-16 16:18:14 +00:00
enum_use_layer_samples = (
( ' USE ' , " Use " , " Per render layer number of samples override scene samples " ) ,
( ' BOUNDED ' , " Bounded " , " Bound per render layer number of samples by global samples " ) ,
( ' IGNORE ' , " Ignore " , " Ignore per render layer number of samples " ) ,
)
2013-06-07 16:06:22 +00:00
enum_sampling_pattern = (
( ' SOBOL ' , " Sobol " , " Use Sobol random sampling pattern " ) ,
( ' CORRELATED_MUTI_JITTER ' , " Correlated Multi-Jitter " , " Use Correlated Multi-Jitter random sampling pattern " ) ,
)
2013-08-23 14:08:40 +00:00
enum_integrator = (
( ' BRANCHED_PATH ' , " Branched Path Tracing " , " Path tracing integrator that branches on the first bounce, giving more control over the number of light and material samples " ) ,
( ' PATH ' , " Path Tracing " , " Pure path tracing integrator " ) ,
)
2014-02-19 08:02:59 +11:00
2014-06-07 18:47:14 +02:00
enum_volume_sampling = (
( ' DISTANCE ' , " Distance " , " Use distance sampling, best for dense volumes with lights far away " ) ,
( ' EQUIANGULAR ' , " Equiangular " , " Use equiangular sampling, best for volumes with low density with light inside or near the volume " ) ,
( ' MULTIPLE_IMPORTANCE ' , " Multiple Importance " , " Combine distance and equi-angular sampling for volumes where neither method is ideal " ) ,
2014-02-05 16:33:51 +01:00
)
2013-08-23 14:08:40 +00:00
2014-10-22 19:23:45 +06:00
enum_volume_interpolation = (
( ' LINEAR ' , " Linear " , " Good smoothness and speed " ) ,
2015-02-16 22:10:38 +01:00
( ' CUBIC ' , " Cubic " , " Smoothed high quality interpolation, but slower " )
2014-10-22 19:23:45 +06:00
)
2018-06-14 16:18:34 +02:00
enum_world_mis = (
( ' NONE ' , " None " , " Don ' t sample the background, faster but might cause noise for non-solid backgrounds " ) ,
( ' AUTOMATIC ' , " Auto " , " Automatically try to determine the best setting " ) ,
( ' MANUAL ' , " Manual " , " Manually set the resolution of the sampling map, higher values are slower and require more memory but reduce noise " )
)
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
enum_device_type = (
( ' CPU ' , " CPU " , " CPU " , 0 ) ,
( ' CUDA ' , " CUDA " , " CUDA " , 1 ) ,
( ' OPENCL ' , " OpenCL " , " OpenCL " , 2 )
)
2016-11-17 12:13:22 +01:00
enum_texture_limit = (
( ' OFF ' , " No Limit " , " No texture size limit " , 0 ) ,
( ' 128 ' , " 128 " , " Limit texture size to 128 pixels " , 1 ) ,
( ' 256 ' , " 256 " , " Limit texture size to 256 pixels " , 2 ) ,
( ' 512 ' , " 512 " , " Limit texture size to 512 pixels " , 3 ) ,
( ' 1024 ' , " 1024 " , " Limit texture size to 1024 pixels " , 4 ) ,
( ' 2048 ' , " 2048 " , " Limit texture size to 2048 pixels " , 5 ) ,
( ' 4096 ' , " 4096 " , " Limit texture size to 4096 pixels " , 6 ) ,
( ' 8192 ' , " 8192 " , " Limit texture size to 8192 pixels " , 7 ) ,
)
2013-01-15 23:17:45 +00:00
2011-04-27 11:58:34 +00:00
class CyclesRenderSettings ( bpy . types . PropertyGroup ) :
2011-08-28 13:55:59 +00:00
@classmethod
def register ( cls ) :
2012-01-20 18:31:23 +00:00
bpy . types . Scene . cycles = PointerProperty (
name = " Cycles Render Settings " ,
description = " Cycles render settings " ,
type = cls ,
)
cls . device = EnumProperty (
name = " Device " ,
description = " Device to use for rendering " ,
2012-12-13 08:45:55 +00:00
items = enum_devices ,
2012-01-20 18:31:23 +00:00
default = ' CPU ' ,
)
cls . feature_set = EnumProperty (
name = " Feature Set " ,
description = " Feature set to use for rendering " ,
2012-12-13 08:45:55 +00:00
items = enum_feature_set ,
2012-01-20 18:31:23 +00:00
default = ' SUPPORTED ' ,
)
2012-12-14 15:26:49 +00:00
cls . shading_system = BoolProperty (
name = " Open Shading Language " ,
description = " Use Open Shading Language (CPU rendering only) " ,
2012-01-20 18:31:23 +00:00
)
2013-08-23 14:34:34 +00:00
cls . progressive = EnumProperty (
2013-08-23 14:08:40 +00:00
name = " Integrator " ,
description = " Method to sample lights and materials " ,
items = enum_integrator ,
default = ' PATH ' ,
2012-06-13 11:44:48 +00:00
)
2014-02-19 08:02:59 +11:00
2017-08-20 23:46:05 +02:00
cls . use_square_samples = BoolProperty (
name = " Square Samples " ,
description = " Square sampling values for easier artist control " ,
default = False ,
)
2012-01-20 18:31:23 +00:00
cls . samples = IntProperty (
name = " Samples " ,
description = " Number of samples to render for each pixel " ,
min = 1 , max = 2147483647 ,
2016-01-24 13:31:07 +01:00
default = 128 ,
2012-01-20 18:31:23 +00:00
)
cls . preview_samples = IntProperty (
name = " Preview Samples " ,
description = " Number of samples to render in the viewport, unlimited if 0 " ,
min = 0 , max = 2147483647 ,
2016-01-24 13:31:07 +01:00
default = 32 ,
2012-01-20 18:31:23 +00:00
)
cls . preview_pause = BoolProperty (
name = " Pause Preview " ,
description = " Pause all viewport preview renders " ,
default = False ,
2012-03-28 09:07:35 +00:00
)
2012-06-13 11:44:48 +00:00
cls . aa_samples = IntProperty (
name = " AA Samples " ,
description = " Number of antialiasing samples to render for each pixel " ,
2016-04-28 23:46:00 +02:00
min = 1 , max = 2097151 ,
2017-08-02 15:29:08 +02:00
default = 128 ,
2012-06-13 11:44:48 +00:00
)
cls . preview_aa_samples = IntProperty (
name = " AA Samples " ,
2012-06-13 14:18:42 +00:00
description = " Number of antialiasing samples to render in the viewport, unlimited if 0 " ,
2016-04-28 23:46:00 +02:00
min = 0 , max = 2097151 ,
2017-08-02 15:29:08 +02:00
default = 32 ,
2012-06-13 11:44:48 +00:00
)
cls . diffuse_samples = IntProperty (
name = " Diffuse Samples " ,
description = " Number of diffuse bounce samples to render for each AA sample " ,
2016-04-28 23:46:00 +02:00
min = 1 , max = 1024 ,
2012-06-13 11:44:48 +00:00
default = 1 ,
)
cls . glossy_samples = IntProperty (
name = " Glossy Samples " ,
description = " Number of glossy bounce samples to render for each AA sample " ,
2016-04-28 23:46:00 +02:00
min = 1 , max = 1024 ,
2012-06-13 11:44:48 +00:00
default = 1 ,
)
cls . transmission_samples = IntProperty (
name = " Transmission Samples " ,
description = " Number of transmission bounce samples to render for each AA sample " ,
2016-04-28 23:46:00 +02:00
min = 1 , max = 1024 ,
2012-06-13 11:44:48 +00:00
default = 1 ,
)
cls . ao_samples = IntProperty (
name = " Ambient Occlusion Samples " ,
description = " Number of ambient occlusion samples to render for each AA sample " ,
2016-04-28 23:46:00 +02:00
min = 1 , max = 1024 ,
2012-06-13 11:44:48 +00:00
default = 1 ,
)
cls . mesh_light_samples = IntProperty (
name = " Mesh Light Samples " ,
description = " Number of mesh emission light samples to render for each AA sample " ,
2016-04-28 23:46:00 +02:00
min = 1 , max = 1024 ,
2012-06-13 11:44:48 +00:00
default = 1 ,
)
2013-04-01 20:26:52 +00:00
cls . subsurface_samples = IntProperty (
name = " Subsurface Samples " ,
description = " Number of subsurface scattering samples to render for each AA sample " ,
2016-04-28 23:46:00 +02:00
min = 1 , max = 1024 ,
2013-04-01 20:26:52 +00:00
default = 1 ,
)
2013-12-29 15:40:43 +01:00
cls . volume_samples = IntProperty (
name = " Volume Samples " ,
description = " Number of volume scattering samples to render for each AA sample " ,
2016-04-28 23:46:00 +02:00
min = 1 , max = 1024 ,
2016-03-02 14:53:36 +05:00
default = 1 ,
2013-12-29 15:40:43 +01:00
)
2013-06-07 16:06:22 +00:00
cls . sampling_pattern = EnumProperty (
name = " Sampling Pattern " ,
description = " Random sampling pattern used by the integrator " ,
items = enum_sampling_pattern ,
default = ' SOBOL ' ,
)
2013-04-16 16:18:14 +00:00
cls . use_layer_samples = EnumProperty (
name = " Layer Samples " ,
description = " How to use per render layer sample settings " ,
items = enum_use_layer_samples ,
default = ' USE ' ,
)
2014-03-15 17:36:44 +01:00
cls . sample_all_lights_direct = BoolProperty (
name = " Sample All Direct Lights " ,
description = " Sample all lights (for direct samples), rather than randomly picking one " ,
default = True ,
)
2014-03-09 22:19:27 +01:00
cls . sample_all_lights_indirect = BoolProperty (
2014-03-15 17:36:44 +01:00
name = " Sample All Indirect Lights " ,
2014-03-09 22:19:27 +01:00
description = " Sample all lights (for indirect samples), rather than randomly picking one " ,
2014-03-15 17:36:44 +01:00
default = True ,
2014-03-09 22:19:27 +01:00
)
2016-10-29 23:47:30 +02:00
cls . light_sampling_threshold = FloatProperty (
name = " Light Sampling Threshold " ,
description = " Probabilistically terminate light samples when the light contribution is below this threshold (more noise but faster rendering). "
2016-10-30 13:51:03 +01:00
" Zero disables the test and never ignores lights " ,
2016-10-29 23:47:30 +02:00
min = 0.0 , max = 1.0 ,
2016-12-01 14:27:10 +01:00
default = 0.01 ,
2016-10-29 23:47:30 +02:00
)
2013-04-16 16:18:14 +00:00
2014-09-05 20:39:35 +02:00
cls . caustics_reflective = BoolProperty (
name = " Reflective Caustics " ,
2014-09-07 01:35:20 +02:00
description = " Use reflective caustics, resulting in a brighter image (more noise but added realism) " ,
2014-09-05 20:39:35 +02:00
default = True ,
)
cls . caustics_refractive = BoolProperty (
name = " Refractive Caustics " ,
2014-09-07 01:35:20 +02:00
description = " Use refractive caustics, resulting in a brighter image (more noise but added realism) " ,
2014-09-05 20:39:35 +02:00
default = True ,
2012-01-20 18:31:23 +00:00
)
2014-09-05 20:39:35 +02:00
Cycles: merging features from tomato branch.
=== BVH build time optimizations ===
* BVH building was multithreaded. Not all building is multithreaded, packing
and the initial bounding/splitting is still single threaded, but recursive
splitting is, which was the main bottleneck.
* Object splitting now uses binning rather than sorting of all elements, using
code from the Embree raytracer from Intel.
http://software.intel.com/en-us/articles/embree-photo-realistic-ray-tracing-kernels/
* Other small changes to avoid allocations, pack memory more tightly, avoid
some unnecessary operations, ...
These optimizations do not work yet when Spatial Splits are enabled, for that
more work is needed. There's also other optimizations still needed, in
particular for the case of many low poly objects, the packing step and node
memory allocation.
BVH raytracing time should remain about the same, but BVH build time should be
significantly reduced, test here show speedup of about 5x to 10x on a dual core
and 5x to 25x on an 8-core machine, depending on the scene.
=== Threads ===
Centralized task scheduler for multithreading, which is basically the
CPU device threading code wrapped into something reusable.
Basic idea is that there is a single TaskScheduler that keeps a pool of threads,
one for each core. Other places in the code can then create a TaskPool that they
can drop Tasks in to be executed by the scheduler, and wait for them to complete
or cancel them early.
=== Normal ====
Added a Normal output to the texture coordinate node. This currently
gives the object space normal, which is the same under object animation.
In the future this might become a "generated" normal so it's also stable for
deforming objects, but for now it's already useful for non-deforming objects.
=== Render Layers ===
Per render layer Samples control, leaving it to 0 will use the common scene
setting.
Environment pass will now render environment even if film is set to transparent.
Exclude Layers" added. Scene layers (all object that influence the render,
directly or indirectly) are shared between all render layers. However sometimes
it's useful to leave out some object influence for a particular render layer.
That's what this option allows you to do.
=== Filter Glossy ===
When using a value higher than 0.0, this will blur glossy reflections after
blurry bounces, to reduce noise at the cost of accuracy. 1.0 is a good
starting value to tweak.
Some light paths have a low probability of being found while contributing much
light to the pixel. As a result these light paths will be found in some pixels
and not in others, causing fireflies. An example of such a difficult path might
be a small light that is causing a small specular highlight on a sharp glossy
material, which we are seeing through a rough glossy material. With path tracing
it is difficult to find the specular highlight, but if we increase the roughness
on the material the highlight gets bigger and softer, and so easier to find.
Often this blurring will be hardly noticeable, because we are seeing it through
a blurry material anyway, but there are also cases where this will lead to a
loss of detail in lighting.
2012-04-28 08:53:59 +00:00
cls . blur_glossy = FloatProperty (
name = " Filter Glossy " ,
2012-10-16 03:21:22 +00:00
description = " Adaptively blur glossy shaders after blurry bounces, "
" to reduce noise at the cost of accuracy " ,
Cycles: merging features from tomato branch.
=== BVH build time optimizations ===
* BVH building was multithreaded. Not all building is multithreaded, packing
and the initial bounding/splitting is still single threaded, but recursive
splitting is, which was the main bottleneck.
* Object splitting now uses binning rather than sorting of all elements, using
code from the Embree raytracer from Intel.
http://software.intel.com/en-us/articles/embree-photo-realistic-ray-tracing-kernels/
* Other small changes to avoid allocations, pack memory more tightly, avoid
some unnecessary operations, ...
These optimizations do not work yet when Spatial Splits are enabled, for that
more work is needed. There's also other optimizations still needed, in
particular for the case of many low poly objects, the packing step and node
memory allocation.
BVH raytracing time should remain about the same, but BVH build time should be
significantly reduced, test here show speedup of about 5x to 10x on a dual core
and 5x to 25x on an 8-core machine, depending on the scene.
=== Threads ===
Centralized task scheduler for multithreading, which is basically the
CPU device threading code wrapped into something reusable.
Basic idea is that there is a single TaskScheduler that keeps a pool of threads,
one for each core. Other places in the code can then create a TaskPool that they
can drop Tasks in to be executed by the scheduler, and wait for them to complete
or cancel them early.
=== Normal ====
Added a Normal output to the texture coordinate node. This currently
gives the object space normal, which is the same under object animation.
In the future this might become a "generated" normal so it's also stable for
deforming objects, but for now it's already useful for non-deforming objects.
=== Render Layers ===
Per render layer Samples control, leaving it to 0 will use the common scene
setting.
Environment pass will now render environment even if film is set to transparent.
Exclude Layers" added. Scene layers (all object that influence the render,
directly or indirectly) are shared between all render layers. However sometimes
it's useful to leave out some object influence for a particular render layer.
That's what this option allows you to do.
=== Filter Glossy ===
When using a value higher than 0.0, this will blur glossy reflections after
blurry bounces, to reduce noise at the cost of accuracy. 1.0 is a good
starting value to tweak.
Some light paths have a low probability of being found while contributing much
light to the pixel. As a result these light paths will be found in some pixels
and not in others, causing fireflies. An example of such a difficult path might
be a small light that is causing a small specular highlight on a sharp glossy
material, which we are seeing through a rough glossy material. With path tracing
it is difficult to find the specular highlight, but if we increase the roughness
on the material the highlight gets bigger and softer, and so easier to find.
Often this blurring will be hardly noticeable, because we are seeing it through
a blurry material anyway, but there are also cases where this will lead to a
loss of detail in lighting.
2012-04-28 08:53:59 +00:00
min = 0.0 , max = 10.0 ,
2017-08-02 15:29:08 +02:00
default = 1.0 ,
2012-01-20 18:31:23 +00:00
)
cls . max_bounces = IntProperty (
name = " Max Bounces " ,
description = " Total maximum number of bounces " ,
min = 0 , max = 1024 ,
2013-11-01 09:37:42 +00:00
default = 12 ,
2012-01-20 18:31:23 +00:00
)
cls . diffuse_bounces = IntProperty (
name = " Diffuse Bounces " ,
description = " Maximum number of diffuse reflection bounces, bounded by total maximum " ,
min = 0 , max = 1024 ,
2013-11-01 09:37:42 +00:00
default = 4 ,
2012-01-20 18:31:23 +00:00
)
cls . glossy_bounces = IntProperty (
name = " Glossy Bounces " ,
description = " Maximum number of glossy reflection bounces, bounded by total maximum " ,
min = 0 , max = 1024 ,
2013-11-01 09:37:42 +00:00
default = 4 ,
2012-01-20 18:31:23 +00:00
)
cls . transmission_bounces = IntProperty (
name = " Transmission Bounces " ,
description = " Maximum number of transmission bounces, bounded by total maximum " ,
min = 0 , max = 1024 ,
2013-11-01 09:37:42 +00:00
default = 12 ,
2012-01-20 18:31:23 +00:00
)
2013-12-29 15:40:43 +01:00
cls . volume_bounces = IntProperty (
name = " Volume Bounces " ,
description = " Maximum number of volumetric scattering events " ,
min = 0 , max = 1024 ,
2014-06-19 19:04:44 +02:00
default = 0 ,
2013-12-29 15:40:43 +01:00
)
2012-01-20 18:31:23 +00:00
cls . transparent_max_bounces = IntProperty (
name = " Transparent Max Bounces " ,
description = " Maximum number of transparent bounces " ,
min = 0 , max = 1024 ,
default = 8 ,
)
2013-12-29 22:19:38 +01:00
cls . volume_step_size = FloatProperty (
name = " Step Size " ,
2014-01-15 10:40:28 +01:00
description = " Distance between volume shader samples when rendering the volume "
" (lower values give more accurate and detailed results, but also increased render time) " ,
2013-12-29 22:19:38 +01:00
default = 0.1 ,
2016-05-24 12:16:16 +02:00
min = 0.0000001 , max = 100000.0 , soft_min = 0.01 , soft_max = 1.0 , precision = 4
2013-12-29 22:19:38 +01:00
)
cls . volume_max_steps = IntProperty (
name = " Max Steps " ,
2013-12-30 12:06:36 +11:00
description = " Maximum number of steps through the volume before giving up, "
2014-01-15 10:40:28 +01:00
" to avoid extremely long render times with big objects or small step sizes " ,
2013-12-29 22:19:38 +01:00
default = 1024 ,
min = 2 , max = 65536
)
2016-04-17 20:15:50 +02:00
cls . dicing_rate = FloatProperty (
name = " Dicing Rate " ,
description = " Size of a micropolygon in pixels " ,
2016-09-17 20:45:00 -04:00
min = 0.1 , max = 1000.0 , soft_min = 0.5 ,
2016-04-17 20:15:50 +02:00
default = 1.0 ,
2016-08-24 11:26:19 -04:00
subtype = " PIXEL "
2016-04-17 20:15:50 +02:00
)
cls . preview_dicing_rate = FloatProperty (
name = " Preview Dicing Rate " ,
description = " Size of a micropolygon in pixels during preview render " ,
2016-09-17 20:45:00 -04:00
min = 0.1 , max = 1000.0 , soft_min = 0.5 ,
2016-04-17 20:15:50 +02:00
default = 8.0 ,
2016-08-24 11:26:19 -04:00
subtype = " PIXEL "
2016-04-17 20:15:50 +02:00
)
2016-04-18 22:35:49 +02:00
cls . max_subdivisions = IntProperty (
name = " Max Subdivisions " ,
description = " Stop subdividing when this level is reached even if the dice rate would produce finer tessellation " ,
min = 0 , max = 16 ,
default = 12 ,
)
2018-01-12 00:50:34 +01:00
cls . dicing_camera = PointerProperty (
name = " Dicing Camera " ,
description = " Camera to use as reference point when subdividing geometry, useful to avoid crawling "
" artifacts in animations when the scene camera is moving " ,
type = bpy . types . Object ,
poll = lambda self , obj : obj . type == ' CAMERA ' ,
)
cls . offscreen_dicing_scale = FloatProperty (
name = " Offscreen Dicing Scale " ,
description = " Multiplier for dicing rate of geometry outside of the camera view. The dicing rate "
" of objects is gradually increased the further they are outside the camera view. "
" Lower values provide higher quality reflections and shadows for off screen objects, "
" while higher values use less memory " ,
min = 1.0 , soft_max = 25.0 ,
default = 4.0 ,
)
2012-01-20 18:31:23 +00:00
cls . film_exposure = FloatProperty (
name = " Exposure " ,
description = " Image brightness scale " ,
min = 0.0 , max = 10.0 ,
default = 1.0 ,
)
cls . film_transparent = BoolProperty (
name = " Transparent " ,
2018-01-11 20:03:31 +01:00
description = " World background is transparent, for compositing the render over another background " ,
2012-01-20 18:31:23 +00:00
default = False ,
)
2018-01-11 20:03:31 +01:00
cls . film_transparent_glass = BoolProperty (
name = " Transparent Glass " ,
description = " Render transmissive surfaces as transparent, for compositing glass over another background " ,
2012-01-20 18:31:23 +00:00
default = False ,
)
2018-01-11 20:03:31 +01:00
cls . film_transparent_roughness = FloatProperty (
name = " Transparent Roughness Threshold " ,
description = " For transparent transmission, keep surfaces with roughness above the threshold opaque " ,
min = 0.0 , max = 1.0 ,
default = 0.1 ,
)
2012-01-20 18:31:23 +00:00
2016-02-10 04:00:29 +05:00
# Really annoyingly, we have to keep it around for a few releases,
# otherwise forward compatibility breaks in really bad manner: CRASH!
#
# TODO(sergey): Remove this during 2.8x series of Blender.
2012-01-20 18:31:23 +00:00
cls . filter_type = EnumProperty (
name = " Filter Type " ,
description = " Pixel filter type " ,
2012-12-13 08:45:55 +00:00
items = enum_filter_types ,
2016-01-22 23:19:23 +01:00
default = ' BLACKMAN_HARRIS ' ,
2012-01-20 18:31:23 +00:00
)
2016-02-10 04:00:29 +05:00
cls . pixel_filter_type = EnumProperty (
name = " Filter Type " ,
description = " Pixel filter type " ,
items = enum_filter_types ,
default = ' BLACKMAN_HARRIS ' ,
)
2012-01-20 18:31:23 +00:00
cls . filter_width = FloatProperty (
name = " Filter Width " ,
description = " Pixel filter width " ,
min = 0.01 , max = 10.0 ,
default = 1.5 ,
)
cls . seed = IntProperty (
name = " Seed " ,
description = " Seed value for integrator to get different noise patterns " ,
min = 0 , max = 2147483647 ,
default = 0 ,
)
2015-05-15 13:49:17 +02:00
cls . use_animated_seed = BoolProperty (
name = " Use Animated Seed " ,
description = " Use different seed values (and hence noise patterns) at different frames " ,
default = False ,
)
2014-02-10 21:44:49 +01:00
cls . sample_clamp_direct = FloatProperty (
name = " Clamp Direct " ,
description = " If non-zero, the maximum value for a direct sample, "
" higher values will be scaled down to avoid too "
" much noise and slow convergence at the cost of accuracy " ,
min = 0.0 , max = 1e8 ,
default = 0.0 ,
)
2014-02-13 08:51:33 +11:00
2014-02-10 21:44:49 +01:00
cls . sample_clamp_indirect = FloatProperty (
name = " Clamp Indirect " ,
description = " If non-zero, the maximum value for an indirect sample, "
2012-10-16 03:21:22 +00:00
" higher values will be scaled down to avoid too "
" much noise and slow convergence at the cost of accuracy " ,
2012-04-05 15:17:45 +00:00
min = 0.0 , max = 1e8 ,
2017-08-02 15:29:08 +02:00
default = 10.0 ,
2012-04-05 15:17:45 +00:00
)
2012-01-20 18:31:23 +00:00
cls . debug_tile_size = IntProperty (
name = " Tile Size " ,
description = " " ,
min = 1 , max = 4096 ,
default = 1024 ,
)
2012-09-04 13:29:07 +00:00
2012-09-17 10:55:18 +00:00
cls . preview_start_resolution = IntProperty (
name = " Start Resolution " ,
2012-10-16 03:21:22 +00:00
description = " Resolution to start rendering preview at, "
" progressively increasing it to the full viewport size " ,
2012-09-17 10:55:18 +00:00
min = 8 , max = 16384 ,
default = 64 ,
2012-01-20 18:31:23 +00:00
)
2012-09-04 13:29:07 +00:00
2012-01-20 18:31:23 +00:00
cls . debug_reset_timeout = FloatProperty (
name = " Reset timeout " ,
description = " " ,
min = 0.01 , max = 10.0 ,
default = 0.1 ,
)
cls . debug_cancel_timeout = FloatProperty (
name = " Cancel timeout " ,
description = " " ,
min = 0.01 , max = 10.0 ,
default = 0.1 ,
)
cls . debug_text_timeout = FloatProperty (
name = " Text timeout " ,
description = " " ,
min = 0.01 , max = 10.0 ,
default = 1.0 ,
)
cls . debug_bvh_type = EnumProperty (
name = " Viewport BVH Type " ,
description = " Choose between faster updates, or faster render " ,
2012-12-13 08:45:55 +00:00
items = enum_bvh_types ,
2012-01-20 18:31:23 +00:00
default = ' DYNAMIC_BVH ' ,
)
cls . debug_use_spatial_splits = BoolProperty (
name = " Use Spatial Splits " ,
description = " Use BVH spatial splits: longer builder time, faster render " ,
default = False ,
)
2016-07-07 18:04:16 +02:00
cls . debug_use_hair_bvh = BoolProperty (
name = " Use Hair BVH " ,
2016-07-19 15:41:28 +02:00
description = " Use special type BVH optimized for hair (uses more ram but renders faster) " ,
2016-07-07 18:04:16 +02:00
default = True ,
)
2017-01-17 14:37:32 +01:00
cls . debug_bvh_time_steps = IntProperty (
name = " BVH Time Steps " ,
description = " Split BVH primitives by this number of time steps to speed up render time in cost of memory " ,
default = 0 ,
min = 0 , max = 16 ,
)
2013-01-07 19:55:49 +00:00
cls . tile_order = EnumProperty (
name = " Tile Order " ,
description = " Tile order for rendering " ,
items = enum_tile_order ,
2016-01-22 23:19:23 +01:00
default = ' HILBERT_SPIRAL ' ,
2013-08-19 13:30:17 +00:00
options = set ( ) , # Not animatable!
2013-01-07 19:55:49 +00:00
)
2012-10-13 12:38:32 +00:00
cls . use_progressive_refine = BoolProperty (
name = " Progressive Refine " ,
2012-10-16 03:21:22 +00:00
description = " Instead of rendering each tile until it is finished, "
2012-10-21 14:02:30 +00:00
" refine the whole image progressively "
" (this renders somewhat slower, "
" but time can be saved by manually stopping the render when the noise is low enough) " ,
2012-10-13 12:38:32 +00:00
default = False ,
2012-01-20 18:31:23 +00:00
)
2011-08-28 13:55:59 +00:00
2014-01-02 19:05:07 -02:00
cls . bake_type = EnumProperty (
name = " Bake Type " ,
default = ' COMBINED ' ,
description = " Type of pass to bake " ,
2015-01-29 15:35:06 +11:00
items = (
2014-01-02 19:05:07 -02:00
( ' COMBINED ' , " Combined " , " " ) ,
( ' AO ' , " Ambient Occlusion " , " " ) ,
( ' SHADOW ' , " Shadow " , " " ) ,
( ' NORMAL ' , " Normal " , " " ) ,
( ' UV ' , " UV " , " " ) ,
2018-03-10 18:18:05 +01:00
( ' ROUGHNESS ' , " Roughness " , " " ) ,
2014-01-02 19:05:07 -02:00
( ' EMIT ' , " Emit " , " " ) ,
( ' ENVIRONMENT ' , " Environment " , " " ) ,
2016-01-15 13:00:56 -02:00
( ' DIFFUSE ' , " Diffuse " , " " ) ,
( ' GLOSSY ' , " Glossy " , " " ) ,
( ' TRANSMISSION ' , " Transmission " , " " ) ,
( ' SUBSURFACE ' , " Subsurface " , " " ) ,
2014-01-02 19:05:07 -02:00
) ,
)
2015-04-10 18:09:58 +05:00
cls . use_camera_cull = BoolProperty (
name = " Use Camera Cull " ,
description = " Allow objects to be culled based on the camera frustum " ,
default = False ,
)
cls . camera_cull_margin = FloatProperty (
name = " Camera Cull Margin " ,
description = " Margin for the camera space culling " ,
default = 0.1 ,
min = 0.0 , max = 5.0
)
2016-11-13 00:16:50 +01:00
cls . use_distance_cull = BoolProperty (
name = " Use Distance Cull " ,
description = " Allow objects to be culled based on the distance from camera " ,
default = False ,
)
cls . distance_cull_margin = FloatProperty (
name = " Cull Distance " ,
2016-11-20 20:50:16 +01:00
description = " Cull objects which are further away from camera than this distance " ,
2016-11-13 00:16:50 +01:00
default = 50 ,
min = 0.0
)
2015-06-29 17:40:13 +02:00
cls . motion_blur_position = EnumProperty (
name = " Motion Blur Position " ,
default = ' CENTER ' ,
2015-10-20 20:08:37 +02:00
description = " Offset for the shutter ' s time interval, allows to change the motion blur trails " ,
2015-06-29 17:40:13 +02:00
items = (
( ' START ' , " Start on Frame " , " The shutter opens at the current frame " ) ,
( ' CENTER ' , " Center on Frame " , " The shutter is open during the current frame " ) ,
( ' END ' , " End on Frame " , " The shutter closes at the current frame " ) ,
) ,
)
2015-11-20 14:42:34 +05:00
cls . rolling_shutter_type = EnumProperty (
name = " Shutter Type " ,
default = ' NONE ' ,
description = " Type of rolling shutter effect matching CMOS-based cameras " ,
items = (
( ' NONE ' , " None " , " No rolling shutter effect used " ) ,
( ' TOP ' , " Top-Bottom " , " Sensor is being scanned from top to bottom " )
# TODO(seergey): Are there real cameras with different scanning direction?
) ,
)
cls . rolling_shutter_duration = FloatProperty (
name = " Rolling Shutter Duration " ,
description = " Scanline \" exposure \" time for the rolling shutter effect " ,
2016-02-01 00:47:10 +11:00
default = 0.1 ,
2015-11-20 14:42:34 +05:00
min = 0.0 , max = 1.0 ,
)
2016-11-17 12:13:22 +01:00
cls . texture_limit = EnumProperty (
name = " Viewport Texture Limit " ,
default = ' OFF ' ,
description = " Limit texture size used by viewport rendering " ,
items = enum_texture_limit
)
cls . texture_limit_render = EnumProperty (
name = " Render Texture Limit " ,
default = ' OFF ' ,
description = " Limit texture size used by final rendering " ,
items = enum_texture_limit
)
2016-11-25 18:59:43 +01:00
cls . ao_bounces = IntProperty (
name = " AO Bounces " ,
default = 0 ,
description = " Approximate indirect light with background tinted ambient occlusion at the specified bounce, 0 disables this feature " ,
min = 0 , max = 1024 ,
)
cls . ao_bounces_render = IntProperty (
name = " AO Bounces Render " ,
default = 0 ,
description = " Approximate indirect light with background tinted ambient occlusion at the specified bounce, 0 disables this feature " ,
min = 0 , max = 1024 ,
)
2016-01-12 16:00:48 +05:00
# Various fine-tuning debug flags
def devices_update_callback ( self , context ) :
import _cycles
scene = context . scene . as_pointer ( )
return _cycles . debug_flags_update ( scene )
cls . debug_use_cpu_avx2 = BoolProperty ( name = " AVX2 " , default = True )
cls . debug_use_cpu_avx = BoolProperty ( name = " AVX " , default = True )
cls . debug_use_cpu_sse41 = BoolProperty ( name = " SSE41 " , default = True )
cls . debug_use_cpu_sse3 = BoolProperty ( name = " SSE3 " , default = True )
cls . debug_use_cpu_sse2 = BoolProperty ( name = " SSE2 " , default = True )
2018-01-19 10:59:58 +01:00
cls . debug_bvh_layout = EnumProperty (
name = " BVH Layout " ,
items = enum_bvh_layouts ,
default = ' BVH4 ' ,
)
2017-02-14 06:20:48 -05:00
cls . debug_use_cpu_split_kernel = BoolProperty ( name = " Split Kernel " , default = False )
2016-01-12 16:00:48 +05:00
2016-05-06 22:34:15 +02:00
cls . debug_use_cuda_adaptive_compile = BoolProperty ( name = " Adaptive Compile " , default = False )
2017-02-14 05:50:29 -05:00
cls . debug_use_cuda_split_kernel = BoolProperty ( name = " Split Kernel " , default = False )
2016-05-06 22:34:15 +02:00
2016-01-12 16:00:48 +05:00
cls . debug_opencl_kernel_type = EnumProperty (
name = " OpenCL Kernel Type " ,
default = ' DEFAULT ' ,
items = (
( ' DEFAULT ' , " Default " , " " ) ,
( ' MEGA ' , " Mega " , " " ) ,
( ' SPLIT ' , " Split " , " " ) ,
) ,
update = devices_update_callback
)
cls . debug_opencl_device_type = EnumProperty (
name = " OpenCL Device Type " ,
default = ' ALL ' ,
items = (
( ' NONE ' , " None " , " " ) ,
( ' ALL ' , " All " , " " ) ,
( ' DEFAULT ' , " Default " , " " ) ,
( ' CPU ' , " CPU " , " " ) ,
( ' GPU ' , " GPU " , " " ) ,
2016-01-14 16:37:06 +01:00
( ' ACCELERATOR ' , " Accelerator " , " " ) ,
2016-01-12 16:00:48 +05:00
) ,
update = devices_update_callback
)
2017-06-12 13:35:00 +10:00
cls . debug_opencl_kernel_single_program = BoolProperty (
name = " Single Program " ,
default = True ,
update = devices_update_callback ,
)
2017-03-08 17:56:06 +01:00
2016-01-12 16:00:48 +05:00
cls . debug_use_opencl_debug = BoolProperty ( name = " Debug OpenCL " , default = False )
2017-07-05 20:16:41 -04:00
cls . debug_opencl_mem_limit = IntProperty ( name = " Memory limit " , default = 0 ,
description = " Artificial limit on OpenCL memory usage in MB (0 to disable limit) " )
2011-08-28 13:55:59 +00:00
@classmethod
def unregister ( cls ) :
del bpy . types . Scene . cycles
2011-04-27 11:58:34 +00:00
2011-11-15 02:58:01 +00:00
2011-04-27 11:58:34 +00:00
class CyclesCameraSettings ( bpy . types . PropertyGroup ) :
2011-08-28 13:55:59 +00:00
@classmethod
def register ( cls ) :
2012-12-13 08:45:55 +00:00
import math
2012-01-20 18:31:23 +00:00
bpy . types . Camera . cycles = PointerProperty (
name = " Cycles Camera Settings " ,
description = " Cycles camera settings " ,
type = cls ,
)
2012-03-07 13:01:30 +00:00
cls . aperture_type = EnumProperty (
name = " Aperture Type " ,
2015-02-16 20:00:20 +01:00
description = " Use f-stop number or aperture radius " ,
2012-12-13 08:45:55 +00:00
items = enum_aperture_types ,
2012-03-07 13:01:30 +00:00
default = ' RADIUS ' ,
)
cls . aperture_fstop = FloatProperty (
2015-02-16 20:00:20 +01:00
name = " Aperture f-stop " ,
description = " F-stop ratio (lower numbers give more defocus, higher numbers give a sharper image) " ,
2012-03-07 13:01:30 +00:00
min = 0.0 , soft_min = 0.1 , soft_max = 64.0 ,
default = 5.6 ,
step = 10 ,
precision = 1 ,
)
2012-01-20 18:31:23 +00:00
cls . aperture_size = FloatProperty (
name = " Aperture Size " ,
2012-03-09 19:01:44 +00:00
description = " Radius of the aperture for depth of field (higher values give more defocus) " ,
2012-03-07 13:01:30 +00:00
min = 0.0 , soft_max = 10.0 ,
2012-01-20 18:31:23 +00:00
default = 0.0 ,
2012-03-07 13:01:30 +00:00
step = 1 ,
precision = 4 ,
2013-03-28 19:33:14 +00:00
subtype = ' DISTANCE ' ,
2012-01-20 18:31:23 +00:00
)
cls . aperture_blades = IntProperty (
name = " Aperture Blades " ,
description = " Number of blades in aperture for polygonal bokeh (at least 3) " ,
min = 0 , max = 100 ,
default = 0 ,
)
cls . aperture_rotation = FloatProperty (
name = " Aperture Rotation " ,
description = " Rotation of blades in aperture " ,
soft_min = - math . pi , soft_max = math . pi ,
subtype = ' ANGLE ' ,
default = 0 ,
)
2014-08-27 10:51:50 +02:00
cls . aperture_ratio = FloatProperty (
name = " Aperture Ratio " ,
description = " Distortion to simulate anamorphic lens bokeh " ,
min = 0.01 , soft_min = 1.0 , soft_max = 2.0 ,
default = 1.0 ,
precision = 4 ,
)
2012-05-04 16:20:51 +00:00
cls . panorama_type = EnumProperty (
name = " Panorama Type " ,
description = " Distortion to use for the calculation " ,
2012-12-13 08:45:55 +00:00
items = enum_panorama_types ,
2012-05-04 16:20:51 +00:00
default = ' FISHEYE_EQUISOLID ' ,
)
cls . fisheye_fov = FloatProperty (
name = " Field of View " ,
description = " Field of view for the fisheye lens " ,
2013-04-16 03:27:51 +00:00
min = 0.1745 , soft_max = 2.0 * math . pi , max = 10.0 * math . pi ,
2012-05-04 16:20:51 +00:00
subtype = ' ANGLE ' ,
default = math . pi ,
)
cls . fisheye_lens = FloatProperty (
name = " Fisheye Lens " ,
2012-05-07 15:50:57 +00:00
description = " Lens focal length (mm) " ,
2012-05-04 16:20:51 +00:00
min = 0.01 , soft_max = 15.0 , max = 100.0 ,
default = 10.5 ,
)
2015-01-14 23:14:45 +05:00
cls . latitude_min = FloatProperty (
2015-01-15 08:23:27 +01:00
name = " Min Latitude " ,
2015-01-14 23:14:45 +05:00
description = " Minimum latitude (vertical angle) for the equirectangular lens " ,
min = - 0.5 * math . pi , max = 0.5 * math . pi ,
subtype = ' ANGLE ' ,
default = - 0.5 * math . pi ,
)
cls . latitude_max = FloatProperty (
2015-01-15 08:23:27 +01:00
name = " Max Latitude " ,
2015-01-14 23:14:45 +05:00
description = " Maximum latitude (vertical angle) for the equirectangular lens " ,
min = - 0.5 * math . pi , max = 0.5 * math . pi ,
subtype = ' ANGLE ' ,
default = 0.5 * math . pi ,
)
cls . longitude_min = FloatProperty (
2015-01-15 08:23:27 +01:00
name = " Min Longitude " ,
2015-01-14 23:14:45 +05:00
description = " Minimum longitude (horizontal angle) for the equirectangular lens " ,
min = - math . pi , max = math . pi ,
subtype = ' ANGLE ' ,
default = - math . pi ,
)
cls . longitude_max = FloatProperty (
2015-01-15 08:23:27 +01:00
name = " Max Longitude " ,
2015-01-14 23:14:45 +05:00
description = " Maximum longitude (horizontal angle) for the equirectangular lens " ,
min = - math . pi , max = math . pi ,
subtype = ' ANGLE ' ,
default = math . pi ,
)
2011-11-15 02:58:01 +00:00
2011-08-28 13:55:59 +00:00
@classmethod
def unregister ( cls ) :
del bpy . types . Camera . cycles
2011-04-27 11:58:34 +00:00
2011-11-15 02:58:01 +00:00
2011-04-27 11:58:34 +00:00
class CyclesMaterialSettings ( bpy . types . PropertyGroup ) :
2011-08-28 13:55:59 +00:00
@classmethod
def register ( cls ) :
2012-01-20 18:31:23 +00:00
bpy . types . Material . cycles = PointerProperty (
name = " Cycles Material Settings " ,
description = " Cycles material settings " ,
type = cls ,
)
cls . sample_as_light = BoolProperty (
2013-01-30 15:57:15 +00:00
name = " Multiple Importance Sample " ,
description = " Use multiple importance sampling for this material, "
2012-10-16 03:21:22 +00:00
" disabling may reduce overall noise for large "
" objects that emit little light compared to other light sources " ,
2012-01-20 18:31:23 +00:00
default = True ,
)
2013-06-18 09:36:00 +00:00
cls . use_transparent_shadow = BoolProperty (
name = " Transparent Shadows " ,
2013-06-18 22:34:37 +00:00
description = " Use transparent shadows for this material if it contains a Transparent BSDF, "
2013-06-18 09:36:00 +00:00
" disabling will render faster but not give accurate shadows " ,
default = True ,
)
2012-01-20 18:31:23 +00:00
cls . homogeneous_volume = BoolProperty (
name = " Homogeneous Volume " ,
2014-01-15 10:40:28 +01:00
description = " When using volume rendering, assume volume has the same density everywhere "
2013-12-29 22:19:38 +01:00
" (not using any textures), for faster rendering " ,
2012-01-20 18:31:23 +00:00
default = False ,
)
2014-06-07 18:47:14 +02:00
cls . volume_sampling = EnumProperty (
name = " Volume Sampling " ,
description = " Sampling method to use for volumes " ,
items = enum_volume_sampling ,
2016-01-22 23:19:23 +01:00
default = ' MULTIPLE_IMPORTANCE ' ,
2014-06-07 18:47:14 +02:00
)
2011-04-27 11:58:34 +00:00
2014-10-22 19:23:45 +06:00
cls . volume_interpolation = EnumProperty (
name = " Volume Interpolation " ,
2015-02-16 22:10:38 +01:00
description = " Interpolation method to use for smoke/fire volumes " ,
2014-10-22 19:23:45 +06:00
items = enum_volume_interpolation ,
default = ' LINEAR ' ,
)
2016-08-02 05:13:58 -04:00
cls . displacement_method = EnumProperty (
name = " Displacement Method " ,
description = " Method to use for the displacement " ,
items = enum_displacement_methods ,
2018-01-25 14:08:56 +01:00
default = ' DISPLACEMENT ' ,
2016-08-02 05:13:58 -04:00
)
2011-08-28 13:55:59 +00:00
@classmethod
def unregister ( cls ) :
del bpy . types . Material . cycles
2011-11-15 02:58:01 +00:00
2018-06-27 14:41:53 +02:00
class CyclesLightSettings ( bpy . types . PropertyGroup ) :
2011-09-27 20:37:24 +00:00
@classmethod
def register ( cls ) :
2018-06-27 14:41:53 +02:00
bpy . types . Light . cycles = PointerProperty (
name = " Cycles Light Settings " ,
description = " Cycles light settings " ,
2012-01-20 18:31:23 +00:00
type = cls ,
)
cls . cast_shadow = BoolProperty (
name = " Cast Shadow " ,
2018-06-27 14:41:53 +02:00
description = " Light casts shadows " ,
2012-01-20 18:31:23 +00:00
default = True ,
)
2012-06-13 11:44:48 +00:00
cls . samples = IntProperty (
name = " Samples " ,
description = " Number of light samples to render for each AA sample " ,
min = 1 , max = 10000 ,
default = 1 ,
)
2014-11-05 22:48:45 +01:00
cls . max_bounces = IntProperty (
name = " Max Bounces " ,
description = " Maximum number of bounces the light will contribute to the render " ,
min = 0 , max = 1024 ,
default = 1024 ,
)
2013-01-30 15:57:15 +00:00
cls . use_multiple_importance_sampling = BoolProperty (
name = " Multiple Importance Sample " ,
2018-06-27 14:41:53 +02:00
description = " Use multiple importance sampling for the light, "
" reduces noise for area lights and sharp glossy materials " ,
2016-01-22 23:19:23 +01:00
default = True ,
2013-01-30 15:57:15 +00:00
)
Cycles: Added support for light portals
This patch adds support for light portals: objects that help sampling the
environment light, therefore improving convergence. Using them tor other
lights in a unidirectional pathtracer is virtually useless.
The sampling is done with the area-preserving code already used for area lamps.
MIS is used both for combination of different portals and for combining portal-
and envmap-sampling.
The direction of portals is considered, they aren't used if the sampling point
is behind them.
Reviewers: sergey, dingto, #cycles
Reviewed By: dingto, #cycles
Subscribers: Lapineige, nutel, jtheninja, dsisco11, januz, vitorbalbio, candreacchio, TARDISMaker, lichtwerk, ace_dragon, marcog, mib2berlin, Tunge, lopataasdf, lordodin, sergey, dingto
Differential Revision: https://developer.blender.org/D1133
2015-04-28 00:51:55 +05:00
cls . is_portal = BoolProperty (
name = " Is Portal " ,
2018-06-27 14:41:53 +02:00
description = " Use this area light to guide sampling of the background, "
" note that this will make the light invisible " ,
Cycles: Added support for light portals
This patch adds support for light portals: objects that help sampling the
environment light, therefore improving convergence. Using them tor other
lights in a unidirectional pathtracer is virtually useless.
The sampling is done with the area-preserving code already used for area lamps.
MIS is used both for combination of different portals and for combining portal-
and envmap-sampling.
The direction of portals is considered, they aren't used if the sampling point
is behind them.
Reviewers: sergey, dingto, #cycles
Reviewed By: dingto, #cycles
Subscribers: Lapineige, nutel, jtheninja, dsisco11, januz, vitorbalbio, candreacchio, TARDISMaker, lichtwerk, ace_dragon, marcog, mib2berlin, Tunge, lopataasdf, lordodin, sergey, dingto
Differential Revision: https://developer.blender.org/D1133
2015-04-28 00:51:55 +05:00
default = False ,
)
2011-09-27 20:37:24 +00:00
@classmethod
def unregister ( cls ) :
2018-06-27 14:41:53 +02:00
del bpy . types . Light . cycles
2011-09-27 20:37:24 +00:00
2011-11-15 02:58:01 +00:00
2011-08-28 13:55:59 +00:00
class CyclesWorldSettings ( bpy . types . PropertyGroup ) :
@classmethod
def register ( cls ) :
2012-01-20 18:31:23 +00:00
bpy . types . World . cycles = PointerProperty (
name = " Cycles World Settings " ,
description = " Cycles world settings " ,
type = cls ,
)
2018-06-14 16:18:34 +02:00
cls . sampling_method = EnumProperty (
name = " Sampling method " ,
description = " How to sample the background light " ,
items = enum_world_mis ,
default = ' AUTOMATIC ' ,
2012-01-20 18:31:23 +00:00
)
cls . sample_map_resolution = IntProperty (
name = " Map Resolution " ,
2018-06-14 16:18:34 +02:00
description = " Importance map size is resolution x resolution/2; "
2012-10-16 03:21:22 +00:00
" higher values potentially produce less noise, at the cost of memory and speed " ,
2015-08-31 18:17:16 +02:00
min = 4 , max = 8192 ,
2016-02-05 22:45:36 +01:00
default = 1024 ,
2012-01-20 18:31:23 +00:00
)
2012-06-13 11:44:48 +00:00
cls . samples = IntProperty (
name = " Samples " ,
description = " Number of light samples to render for each AA sample " ,
min = 1 , max = 10000 ,
2016-02-05 22:45:36 +01:00
default = 1 ,
2012-06-13 11:44:48 +00:00
)
2015-07-12 17:56:54 +02:00
cls . max_bounces = IntProperty (
name = " Max Bounces " ,
description = " Maximum number of bounces the background light will contribute to the render " ,
min = 0 , max = 1024 ,
default = 1024 ,
)
2013-12-28 16:56:19 +01:00
cls . homogeneous_volume = BoolProperty (
name = " Homogeneous Volume " ,
2013-12-29 22:19:38 +01:00
description = " When using volume rendering, assume volume has the same density everywhere "
" (not using any textures), for faster rendering " ,
2013-12-28 16:56:19 +01:00
default = False ,
)
2014-06-07 18:47:14 +02:00
cls . volume_sampling = EnumProperty (
name = " Volume Sampling " ,
description = " Sampling method to use for volumes " ,
items = enum_volume_sampling ,
default = ' EQUIANGULAR ' ,
)
2011-08-28 13:55:59 +00:00
2014-10-22 19:23:45 +06:00
cls . volume_interpolation = EnumProperty (
name = " Volume Interpolation " ,
description = " Interpolation method to use for volumes " ,
items = enum_volume_interpolation ,
default = ' LINEAR ' ,
)
2011-08-28 13:55:59 +00:00
@classmethod
def unregister ( cls ) :
del bpy . types . World . cycles
2011-04-27 11:58:34 +00:00
2011-11-15 02:58:01 +00:00
2011-09-01 15:53:36 +00:00
class CyclesVisibilitySettings ( bpy . types . PropertyGroup ) :
@classmethod
def register ( cls ) :
2012-01-20 18:31:23 +00:00
bpy . types . Object . cycles_visibility = PointerProperty (
2013-06-10 20:34:34 +00:00
name = " Cycles Visibility Settings " ,
description = " Cycles visibility settings " ,
type = cls ,
)
bpy . types . World . cycles_visibility = PointerProperty (
2012-01-20 18:31:23 +00:00
name = " Cycles Visibility Settings " ,
description = " Cycles visibility settings " ,
type = cls ,
)
cls . camera = BoolProperty (
name = " Camera " ,
description = " Object visibility for camera rays " ,
default = True ,
)
cls . diffuse = BoolProperty (
name = " Diffuse " ,
description = " Object visibility for diffuse reflection rays " ,
default = True ,
)
cls . glossy = BoolProperty (
name = " Glossy " ,
description = " Object visibility for glossy reflection rays " ,
default = True ,
)
cls . transmission = BoolProperty (
name = " Transmission " ,
description = " Object visibility for transmission rays " ,
default = True ,
)
cls . shadow = BoolProperty (
name = " Shadow " ,
description = " Object visibility for shadow rays " ,
default = True ,
)
2014-09-05 16:17:24 +02:00
cls . scatter = BoolProperty (
name = " Volume Scatter " ,
description = " Object visibility for volume scatter rays " ,
default = True ,
)
2011-09-01 15:53:36 +00:00
@classmethod
def unregister ( cls ) :
del bpy . types . Object . cycles_visibility
2013-11-24 22:29:58 +01:00
del bpy . types . World . cycles_visibility
2011-09-01 15:53:36 +00:00
2011-11-15 02:58:01 +00:00
2011-04-27 11:58:34 +00:00
class CyclesMeshSettings ( bpy . types . PropertyGroup ) :
2011-08-28 13:55:59 +00:00
@classmethod
def register ( cls ) :
2012-01-20 18:31:23 +00:00
bpy . types . Mesh . cycles = PointerProperty (
name = " Cycles Mesh Settings " ,
description = " Cycles mesh settings " ,
type = cls ,
)
bpy . types . Curve . cycles = PointerProperty (
name = " Cycles Mesh Settings " ,
description = " Cycles mesh settings " ,
type = cls ,
)
bpy . types . MetaBall . cycles = PointerProperty (
name = " Cycles Mesh Settings " ,
description = " Cycles mesh settings " ,
type = cls ,
)
2011-08-28 13:55:59 +00:00
@classmethod
def unregister ( cls ) :
del bpy . types . Mesh . cycles
2011-09-01 15:53:36 +00:00
del bpy . types . Curve . cycles
del bpy . types . MetaBall . cycles
2011-04-27 11:58:34 +00:00
2013-01-15 23:17:45 +00:00
2016-07-16 19:56:45 -04:00
class CyclesObjectSettings ( bpy . types . PropertyGroup ) :
2014-03-29 13:03:47 +01:00
@classmethod
def register ( cls ) :
bpy . types . Object . cycles = PointerProperty (
name = " Cycles Object Settings " ,
description = " Cycles object settings " ,
type = cls ,
)
cls . use_motion_blur = BoolProperty (
name = " Use Motion Blur " ,
description = " Use motion blur for this object " ,
default = True ,
)
cls . use_deform_motion = BoolProperty (
name = " Use Deformation Motion " ,
description = " Use deformation motion blur for this object " ,
default = True ,
)
cls . motion_steps = IntProperty (
name = " Motion Steps " ,
2018-03-08 04:04:52 +01:00
description = " Control accuracy of motion blur, more steps gives more memory usage (actual number of steps is 2^(steps - 1)) " ,
2014-03-29 13:03:47 +01:00
min = 1 , soft_max = 8 ,
default = 1 ,
)
2015-04-10 18:09:58 +05:00
cls . use_camera_cull = BoolProperty (
name = " Use Camera Cull " ,
2015-07-20 22:22:31 +02:00
description = " Allow this object and its duplicators to be culled by camera space culling " ,
2015-04-10 18:09:58 +05:00
default = False ,
)
2016-11-13 00:16:50 +01:00
cls . use_distance_cull = BoolProperty (
name = " Use Distance Cull " ,
description = " Allow this object and its duplicators to be culled by distance from camera " ,
default = False ,
)
2016-07-16 19:56:45 -04:00
cls . use_adaptive_subdivision = BoolProperty (
name = " Use Adaptive Subdivision " ,
description = " Use adaptive render time subdivision " ,
default = False ,
)
cls . dicing_rate = FloatProperty (
2016-08-24 11:26:19 -04:00
name = " Dicing Scale " ,
description = " Multiplier for scene dicing rate (located in the Geometry Panel) " ,
2016-09-17 20:45:00 -04:00
min = 0.1 , max = 1000.0 , soft_min = 0.5 ,
2016-07-16 19:56:45 -04:00
default = 1.0 ,
)
2017-02-09 14:19:01 +01:00
cls . is_shadow_catcher = BoolProperty (
name = " Shadow Catcher " ,
description = " Only render shadows on this object, for compositing renders into real footage " ,
default = False ,
)
2017-11-18 06:06:27 +01:00
cls . is_holdout = BoolProperty (
name = " Holdout " ,
description = " Render objects as a holdout or matte, creating a "
" hole in the image with zero alpha, to fill out in "
" compositing with real footange or another render " ,
default = False ,
)
2014-03-29 13:03:47 +01:00
@classmethod
def unregister ( cls ) :
del bpy . types . Object . cycles
2012-12-28 14:21:30 +00:00
class CyclesCurveRenderSettings ( bpy . types . PropertyGroup ) :
@classmethod
def register ( cls ) :
bpy . types . Scene . cycles_curves = PointerProperty (
name = " Cycles Hair Rendering Settings " ,
description = " Cycles hair rendering settings " ,
type = cls ,
)
cls . primitive = EnumProperty (
name = " Primitive " ,
description = " Type of primitive used for hair rendering " ,
items = enum_curve_primitives ,
default = ' LINE_SEGMENTS ' ,
)
2013-08-18 13:41:53 +00:00
cls . shape = EnumProperty (
name = " Shape " ,
description = " Form of hair " ,
items = enum_curve_shape ,
default = ' THICK ' ,
2012-12-28 14:21:30 +00:00
)
2013-08-18 13:41:53 +00:00
cls . cull_backfacing = BoolProperty (
2018-05-31 16:05:38 +02:00
name = " Cull Back-faces " ,
2013-08-18 13:41:53 +00:00
description = " Do not test the back-face of each strand " ,
2012-12-28 14:21:30 +00:00
default = True ,
)
cls . use_curves = BoolProperty (
name = " Use Cycles Hair Rendering " ,
2012-12-30 23:21:33 +00:00
description = " Activate Cycles hair rendering for particle system " ,
2012-12-28 14:21:30 +00:00
default = True ,
2013-01-15 23:17:45 +00:00
)
2012-12-28 14:21:30 +00:00
cls . resolution = IntProperty (
name = " Resolution " ,
description = " Resolution of generated mesh " ,
min = 3 , max = 64 ,
default = 3 ,
)
2013-04-15 21:38:31 +00:00
cls . minimum_width = FloatProperty (
name = " Minimal width " ,
description = " Minimal pixel width for strands (0 - deactivated) " ,
2013-04-16 03:27:51 +00:00
min = 0.0 , max = 100.0 ,
2013-04-15 21:38:31 +00:00
default = 0.0 ,
)
cls . maximum_width = FloatProperty (
name = " Maximal width " ,
description = " Maximum extension that strand radius can be increased by " ,
2013-04-16 03:27:51 +00:00
min = 0.0 , max = 100.0 ,
2013-04-15 21:38:31 +00:00
default = 0.1 ,
)
2013-01-15 19:44:41 +00:00
cls . subdivisions = IntProperty (
name = " Subdivisions " ,
description = " Number of subdivisions used in Cardinal curve intersection (power of 2) " ,
min = 0 , max = 24 ,
2013-04-15 21:38:31 +00:00
default = 4 ,
2013-01-15 19:44:41 +00:00
)
2012-12-28 14:21:30 +00:00
@classmethod
def unregister ( cls ) :
del bpy . types . Scene . cycles_curves
2017-05-26 02:13:21 +02:00
def update_render_passes ( self , context ) :
scene = context . scene
rd = scene . render
2018-04-24 15:20:17 +02:00
view_layer = context . view_layer
2017-11-22 10:52:39 -02:00
view_layer . update_render_passes ( )
2017-05-26 02:13:21 +02:00
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
class CyclesRenderLayerSettings ( bpy . types . PropertyGroup ) :
@classmethod
def register ( cls ) :
2017-11-22 10:52:39 -02:00
bpy . types . ViewLayer . cycles = PointerProperty (
name = " Cycles ViewLayer Settings " ,
description = " Cycles ViewLayer Settings " ,
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
type = cls ,
)
cls . pass_debug_bvh_traversed_nodes = BoolProperty (
name = " Debug BVH Traversed Nodes " ,
description = " Store Debug BVH Traversed Nodes pass " ,
default = False ,
2017-05-26 02:13:21 +02:00
update = update_render_passes ,
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
)
cls . pass_debug_bvh_traversed_instances = BoolProperty (
name = " Debug BVH Traversed Instances " ,
description = " Store Debug BVH Traversed Instances pass " ,
default = False ,
2017-05-26 02:13:21 +02:00
update = update_render_passes ,
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
)
cls . pass_debug_bvh_intersections = BoolProperty (
name = " Debug BVH Intersections " ,
description = " Store Debug BVH Intersections " ,
default = False ,
2017-05-26 02:13:21 +02:00
update = update_render_passes ,
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
)
cls . pass_debug_ray_bounces = BoolProperty (
name = " Debug Ray Bounces " ,
description = " Store Debug Ray Bounces pass " ,
default = False ,
2017-05-26 02:13:21 +02:00
update = update_render_passes ,
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
)
2017-11-17 14:23:48 +01:00
cls . pass_debug_render_time = BoolProperty (
name = " Debug Render Time " ,
description = " Render time in milliseconds per sample and pixel " ,
default = False ,
update = update_render_passes ,
)
2017-11-14 07:21:07 +01:00
cls . use_pass_volume_direct = BoolProperty (
name = " Volume Direct " ,
description = " Deliver direct volumetric scattering pass " ,
default = False ,
update = update_render_passes ,
)
cls . use_pass_volume_indirect = BoolProperty (
name = " Volume Indirect " ,
description = " Deliver indirect volumetric scattering pass " ,
default = False ,
update = update_render_passes ,
)
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
2017-05-07 14:40:58 +02:00
cls . use_denoising = BoolProperty (
name = " Use Denoising " ,
description = " Denoise the rendered image " ,
default = False ,
2017-06-09 23:02:56 +02:00
update = update_render_passes ,
2017-05-07 14:40:58 +02:00
)
cls . denoising_diffuse_direct = BoolProperty (
name = " Diffuse Direct " ,
description = " Denoise the direct diffuse lighting " ,
default = True ,
)
cls . denoising_diffuse_indirect = BoolProperty (
name = " Diffuse Indirect " ,
description = " Denoise the indirect diffuse lighting " ,
default = True ,
)
cls . denoising_glossy_direct = BoolProperty (
name = " Glossy Direct " ,
description = " Denoise the direct glossy lighting " ,
default = True ,
)
cls . denoising_glossy_indirect = BoolProperty (
name = " Glossy Indirect " ,
description = " Denoise the indirect glossy lighting " ,
default = True ,
)
cls . denoising_transmission_direct = BoolProperty (
name = " Transmission Direct " ,
description = " Denoise the direct transmission lighting " ,
default = True ,
)
cls . denoising_transmission_indirect = BoolProperty (
name = " Transmission Indirect " ,
description = " Denoise the indirect transmission lighting " ,
default = True ,
)
cls . denoising_subsurface_direct = BoolProperty (
name = " Subsurface Direct " ,
description = " Denoise the direct subsurface lighting " ,
default = True ,
)
cls . denoising_subsurface_indirect = BoolProperty (
name = " Subsurface Indirect " ,
description = " Denoise the indirect subsurface lighting " ,
default = True ,
)
cls . denoising_strength = FloatProperty (
name = " Denoising Strength " ,
description = " Controls neighbor pixel weighting for the denoising filter (lower values preserve more detail, but aren ' t as smooth) " ,
min = 0.0 , max = 1.0 ,
default = 0.5 ,
)
cls . denoising_feature_strength = FloatProperty (
name = " Denoising Feature Strength " ,
description = " Controls removal of noisy image feature passes (lower values preserve more detail, but aren ' t as smooth) " ,
min = 0.0 , max = 1.0 ,
default = 0.5 ,
)
cls . denoising_radius = IntProperty (
name = " Denoising Radius " ,
description = " Size of the image area that ' s used to denoise a pixel (higher values are smoother, but might lose detail and are slower) " ,
2017-05-08 22:09:35 +02:00
min = 1 , max = 25 ,
2017-05-07 14:40:58 +02:00
default = 8 ,
)
cls . denoising_relative_pca = BoolProperty (
name = " Relative filter " ,
2017-05-09 14:44:59 +02:00
description = " When removing pixels that don ' t carry information, use a relative threshold instead of an absolute one (can help to reduce artifacts, but might cause detail loss around edges) " ,
2017-05-07 14:40:58 +02:00
default = False ,
)
cls . denoising_store_passes = BoolProperty (
name = " Store denoising passes " ,
description = " Store the denoising feature passes and the noisy image " ,
default = False ,
2017-05-26 02:13:21 +02:00
update = update_render_passes ,
2017-05-07 14:40:58 +02:00
)
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
@classmethod
def unregister ( cls ) :
2017-11-22 10:52:39 -02:00
del bpy . types . ViewLayer . cycles
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
2013-01-15 23:17:45 +00:00
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
class CyclesDeviceSettings ( bpy . types . PropertyGroup ) :
@classmethod
def register ( cls ) :
cls . id = StringProperty ( name = " ID " )
cls . name = StringProperty ( name = " Name " )
cls . use = BoolProperty ( name = " Use " , default = True )
cls . type = EnumProperty ( name = " Type " , items = enum_device_type , default = ' CUDA ' )
class CyclesPreferences ( bpy . types . AddonPreferences ) :
bl_idname = __package__
def get_device_types ( self , context ) :
import _cycles
has_cuda , has_opencl = _cycles . get_device_types ( )
list = [ ( ' NONE ' , " None " , " Don ' t use compute device " , 0 ) ]
if has_cuda :
list . append ( ( ' CUDA ' , " CUDA " , " Use CUDA for GPU acceleration " , 1 ) )
if has_opencl :
list . append ( ( ' OPENCL ' , " OpenCL " , " Use OpenCL for GPU acceleration " , 2 ) )
return list
compute_device_type = EnumProperty (
name = " Compute Device Type " ,
description = " Device to use for computation (rendering with Cycles) " ,
items = get_device_types ,
)
devices = bpy . props . CollectionProperty ( type = CyclesDeviceSettings )
2017-12-19 15:51:28 +01:00
def find_existing_device_entry ( self , device ) :
for device_entry in self . devices :
if device_entry . id == device [ 2 ] and device_entry . type == device [ 1 ] :
return device_entry
return None
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
2017-12-19 15:51:28 +01:00
def update_device_entries ( self , device_list ) :
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
for device in device_list :
2017-10-21 18:58:59 +02:00
if not device [ 1 ] in { ' CUDA ' , ' OPENCL ' , ' CPU ' } :
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
continue
# Try to find existing Device entry
2017-12-19 15:51:28 +01:00
entry = self . find_existing_device_entry ( device )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
if not entry :
2017-10-21 18:58:59 +02:00
# Create new entry if no existing one was found
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
entry = self . devices . add ( )
entry . id = device [ 2 ]
entry . name = device [ 0 ]
entry . type = device [ 1 ]
2017-10-21 18:58:59 +02:00
entry . use = entry . type != ' CPU '
elif entry . name != device [ 0 ] :
# Update name in case it changed
entry . name = device [ 0 ]
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
2017-12-19 15:51:28 +01:00
def get_devices ( self ) :
import _cycles
# Layout of the device tuples: (Name, Type, Persistent ID)
device_list = _cycles . available_devices ( )
# Make sure device entries are up to date and not referenced before
# we know we don't add new devices. This way we guarantee to not
# hold pointers to a resized array.
self . update_device_entries ( device_list )
# Sort entries into lists
cuda_devices = [ ]
opencl_devices = [ ]
cpu_devices = [ ]
for device in device_list :
entry = self . find_existing_device_entry ( device )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
if entry . type == ' CUDA ' :
cuda_devices . append ( entry )
elif entry . type == ' OPENCL ' :
opencl_devices . append ( entry )
2017-12-19 15:51:28 +01:00
elif entry . type == ' CPU ' :
2017-10-21 18:58:59 +02:00
cpu_devices . append ( entry )
2017-12-19 15:51:28 +01:00
# Extend all GPU devices with CPU.
2017-10-21 18:58:59 +02:00
cuda_devices . extend ( cpu_devices )
opencl_devices . extend ( cpu_devices )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
return cuda_devices , opencl_devices
2016-11-17 02:16:21 +01:00
def get_num_gpu_devices ( self ) :
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
import _cycles
device_list = _cycles . available_devices ( )
2016-11-17 02:16:21 +01:00
num = 0
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
for device in device_list :
if device [ 1 ] != self . compute_device_type :
continue
2016-11-17 02:16:21 +01:00
for dev in self . devices :
if dev . use and dev . id == device [ 2 ] :
num + = 1
return num
def has_active_device ( self ) :
return self . get_num_gpu_devices ( ) > 0
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
def draw_impl ( self , layout , context ) :
2016-11-19 01:15:08 +01:00
layout . label ( text = " Cycles Compute Device: " )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
layout . row ( ) . prop ( self , " compute_device_type " , expand = True )
cuda_devices , opencl_devices = self . get_devices ( )
row = layout . row ( )
2016-11-19 01:15:08 +01:00
if self . compute_device_type == ' CUDA ' and cuda_devices :
2017-04-26 15:06:31 +02:00
box = row . box ( )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
for device in cuda_devices :
2017-04-26 15:06:31 +02:00
box . prop ( device , " use " , text = device . name )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
2016-11-19 01:15:08 +01:00
if self . compute_device_type == ' OPENCL ' and opencl_devices :
2017-04-26 15:06:31 +02:00
box = row . box ( )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
for device in opencl_devices :
2017-04-26 15:06:31 +02:00
box . prop ( device , " use " , text = device . name )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
def draw ( self , context ) :
self . draw_impl ( self . layout , context )
2011-04-27 11:58:34 +00:00
def register ( ) :
2011-08-28 13:55:59 +00:00
bpy . utils . register_class ( CyclesRenderSettings )
bpy . utils . register_class ( CyclesCameraSettings )
bpy . utils . register_class ( CyclesMaterialSettings )
2018-06-27 14:41:53 +02:00
bpy . utils . register_class ( CyclesLightSettings )
2011-08-28 13:55:59 +00:00
bpy . utils . register_class ( CyclesWorldSettings )
2011-09-01 15:53:36 +00:00
bpy . utils . register_class ( CyclesVisibilitySettings )
2011-08-28 13:55:59 +00:00
bpy . utils . register_class ( CyclesMeshSettings )
2016-07-16 19:56:45 -04:00
bpy . utils . register_class ( CyclesObjectSettings )
2012-12-28 14:21:30 +00:00
bpy . utils . register_class ( CyclesCurveRenderSettings )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
bpy . utils . register_class ( CyclesDeviceSettings )
bpy . utils . register_class ( CyclesPreferences )
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
bpy . utils . register_class ( CyclesRenderLayerSettings )
2011-11-15 02:58:01 +00:00
2011-04-27 11:58:34 +00:00
def unregister ( ) :
2011-08-28 13:55:59 +00:00
bpy . utils . unregister_class ( CyclesRenderSettings )
bpy . utils . unregister_class ( CyclesCameraSettings )
bpy . utils . unregister_class ( CyclesMaterialSettings )
2018-06-27 14:41:53 +02:00
bpy . utils . unregister_class ( CyclesLightSettings )
2011-08-28 13:55:59 +00:00
bpy . utils . unregister_class ( CyclesWorldSettings )
bpy . utils . unregister_class ( CyclesMeshSettings )
2016-07-16 19:56:45 -04:00
bpy . utils . unregister_class ( CyclesObjectSettings )
2011-09-01 15:53:36 +00:00
bpy . utils . unregister_class ( CyclesVisibilitySettings )
2012-12-28 14:21:30 +00:00
bpy . utils . unregister_class ( CyclesCurveRenderSettings )
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL).
Now, a toggle button is displayed for every device.
These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards).
From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences.
This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items.
Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken.
Reviewers: #cycles, brecht
Reviewed By: #cycles, brecht
Subscribers: brecht, juicyfruit, mib2berlin, Blendify
Differential Revision: https://developer.blender.org/D2338
2016-11-07 02:33:53 +01:00
bpy . utils . unregister_class ( CyclesDeviceSettings )
bpy . utils . unregister_class ( CyclesPreferences )
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
bpy . utils . unregister_class ( CyclesRenderLayerSettings )