Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_types.h
| Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | enum PathRayFlag { | ||||
| PATH_RAY_VOLUME_SCATTER = 1024, /* volume scattering */ | PATH_RAY_VOLUME_SCATTER = 1024, /* volume scattering */ | ||||
| /* note that these can use maximum 12 bits, the other are for layers */ | /* note that these can use maximum 12 bits, the other are for layers */ | ||||
| PATH_RAY_ALL_VISIBILITY = (1|2|4|8|16|32|64|128|256|512|1024), | PATH_RAY_ALL_VISIBILITY = (1|2|4|8|16|32|64|128|256|512|1024), | ||||
| PATH_RAY_MIS_SKIP = 2048, | PATH_RAY_MIS_SKIP = 2048, | ||||
| PATH_RAY_DIFFUSE_ANCESTOR = 4096, | PATH_RAY_DIFFUSE_ANCESTOR = 4096, | ||||
| PATH_RAY_SINGLE_PASS_DONE = 8192, | PATH_RAY_SINGLE_PASS_DONE = 8192, | ||||
| /* are we evaluating shaders in a context where only emission is needed? */ | |||||
| PATH_RAY_EMISSION = 16384, | |||||
| }; | }; | ||||
| /* Closure Label */ | /* Closure Label */ | ||||
| typedef enum ClosureLabel { | typedef enum ClosureLabel { | ||||
| LABEL_NONE = 0, | LABEL_NONE = 0, | ||||
| LABEL_TRANSMIT = 1, | LABEL_TRANSMIT = 1, | ||||
| LABEL_REFLECT = 2, | LABEL_REFLECT = 2, | ||||
| ▲ Show 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | typedef enum AttributeStandard { | ||||
| ATTR_STD_NOT_FOUND = ~0 | ATTR_STD_NOT_FOUND = ~0 | ||||
| } AttributeStandard; | } AttributeStandard; | ||||
| /* Closure data */ | /* Closure data */ | ||||
| #ifdef __MULTI_CLOSURE__ | #ifdef __MULTI_CLOSURE__ | ||||
| # ifndef __MAX_CLOSURE__ | # ifndef __MAX_CLOSURE__ | ||||
| # define MAX_CLOSURE 64 | # define MAX_MAIN_CLOSURE 64 | ||||
| # define MAX_EMISSION_CLOSURE 2 | |||||
| # define MAX_SHADOW_CLOSURE 2 | |||||
| # else | # else | ||||
| # define MAX_CLOSURE __MAX_CLOSURE__ | # define MAX_SPLIT_CLOSURE __MAX_CLOSURE__ | ||||
| # define MAX_MAIN_CLOSURE __MAX_CLOSURE__ | |||||
| # define MAX_SHADOW_CLOSURE __MAX_CLOSURE__ | |||||
| # define MAX_EMISSION_CLOSURE __MAX_CLOSURE__ | |||||
| # endif | # endif | ||||
| #else | #else | ||||
| # define MAX_CLOSURE 1 | # define MAX_MAIN_CLOSURE 1 | ||||
| # define MAX_SHADOW_CLOSURE 1 | |||||
| # define MAX_EMISSION_CLOSURE 1 | |||||
| #endif | #endif | ||||
| #define MAX_BSSRDF_CLOSURE 1 | |||||
| /* This struct is to be 16 bytes aligned, we also keep some extra precautions: | /* This struct is to be 16 bytes aligned, we also keep some extra precautions: | ||||
| * - All the float3 members are in the beginning of the struct, so compiler | * - All the float3 members are in the beginning of the struct, so compiler | ||||
| * does not put own padding trying to align this members. | * does not put own padding trying to align this members. | ||||
| * - We make sure OSL pointer is also 16 bytes aligned. | * - We make sure OSL pointer is also 16 bytes aligned. | ||||
| */ | */ | ||||
| typedef ccl_addr_space struct ShaderClosure { | typedef ccl_addr_space struct ShaderClosure { | ||||
| float3 weight; | float3 weight; | ||||
| float3 N; | float3 N; | ||||
| Show All 35 Lines | |||||
| /* Shader Data | /* Shader Data | ||||
| * | * | ||||
| * Main shader state at a point on the surface or in a volume. All coordinates | * Main shader state at a point on the surface or in a volume. All coordinates | ||||
| * are in world space. */ | * are in world space. */ | ||||
| enum ShaderDataFlag { | enum ShaderDataFlag { | ||||
| /* runtime flags */ | /* runtime flags */ | ||||
| SD_BACKFACING = (1 << 0), /* backside of surface? */ | SD_BACKFACING = (1 << 0), /* backside of surface? */ | ||||
| SD_EMISSION = (1 << 1), /* have emissive closure? */ | SD_EMISSION = (1 << 1), /* have emissive or background closure? */ | ||||
| SD_BSDF = (1 << 2), /* have bsdf closure? */ | SD_BSDF = (1 << 2), /* have bsdf closure? */ | ||||
| SD_BSDF_HAS_EVAL = (1 << 3), /* have non-singular bsdf closure? */ | SD_BSDF_HAS_EVAL = (1 << 3), /* have non-singular bsdf closure? */ | ||||
| SD_BSSRDF = (1 << 4), /* have bssrdf */ | SD_BSSRDF = (1 << 4), /* have bssrdf */ | ||||
| SD_HOLDOUT = (1 << 5), /* have holdout closure? */ | SD_HOLDOUT = (1 << 5), /* have holdout closure? */ | ||||
| SD_ABSORPTION = (1 << 6), /* have volume absorption closure? */ | SD_ABSORPTION = (1 << 6), /* have volume absorption closure? */ | ||||
| SD_SCATTER = (1 << 7), /* have volume phase closure? */ | SD_SCATTER = (1 << 7), /* have volume phase closure? */ | ||||
| SD_AO = (1 << 8), /* have ao closure? */ | SD_AO = (1 << 8), /* have ao closure? */ | ||||
| SD_TRANSPARENT = (1 << 9), /* have transparent closure? */ | SD_TRANSPARENT = (1 << 9), /* have transparent closure? */ | ||||
| ▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | |||||
| #ifdef __OBJECT_MOTION__ | #ifdef __OBJECT_MOTION__ | ||||
| /* object <-> world space transformations, cached to avoid | /* object <-> world space transformations, cached to avoid | ||||
| * re-interpolating them constantly for shading */ | * re-interpolating them constantly for shading */ | ||||
| Transform ob_tfm; | Transform ob_tfm; | ||||
| Transform ob_itfm; | Transform ob_itfm; | ||||
| #endif | #endif | ||||
| /* Closure data, we store a fixed array of closures */ | /* Closure data, we store a fixed array of closures for split kernel | ||||
| struct ShaderClosure closure[MAX_CLOSURE]; | * variable for other kernels */ | ||||
| #ifdef MAX_SPLIT_CLOSURE | |||||
| struct ShaderClosure closure[MAX_SPLIT_CLOSURE]; | |||||
| #else | |||||
| struct ShaderClosure *closure; | |||||
| #endif | |||||
| int max_closure; | |||||
| int num_closure; | int num_closure; | ||||
| float randb_closure; | float randb_closure; | ||||
| /* ray start position, only set for backgrounds */ | /* ray start position, only set for backgrounds */ | ||||
| float3 ray_P; | float3 ray_P; | ||||
| differential3 ray_dP; | differential3 ray_dP; | ||||
| #ifdef __OSL__ | #ifdef __OSL__ | ||||
| ▲ Show 20 Lines • Show All 419 Lines • Show Last 20 Lines | |||||