17 const float alpha = r.w;
40 uint co_offset, out_offset, alpha_offset, flags;
61 int num_nodes = (
int)node.y;
64 int next_offset = offset + num_nodes;
67 int tx = (
int)tex_co.
x;
68 int ty = (
int)tex_co.
y;
71 if (tx >= 0 && ty >= 0 && tx < 10) {
72 int tile = 1001 + 10 * ty + tx;
75 for (
int i = 0; i < num_nodes; i++) {
77 if (tile_node.
x ==
tile) {
81 if (tile_node.
z ==
tile) {
128 N /= (
N.x +
N.y +
N.z);
142 float limit = 0.5f * (1.0f +
blend);
145 if (
N.x > limit * (
N.x +
N.y) &&
N.x > limit * (
N.x +
N.z)) {
148 else if (
N.y > limit * (
N.x +
N.y) &&
N.y > limit * (
N.y +
N.z)) {
151 else if (
N.z > limit * (
N.x +
N.z) &&
N.z > limit * (
N.y +
N.z)) {
154 else if (
blend > 0.0f) {
156 if (
N.z < (1.0f - limit) * (
N.y +
N.x)) {
157 weight.x =
N.x / (
N.x +
N.y);
159 weight.y = 1.0f - weight.x;
161 else if (
N.x < (1.0f - limit) * (
N.y +
N.z)) {
162 weight.y =
N.y / (
N.y +
N.z);
164 weight.z = 1.0f - weight.y;
166 else if (
N.y < (1.0f - limit) * (
N.x +
N.z)) {
167 weight.x =
N.x / (
N.x +
N.z);
169 weight.z = 1.0f - weight.x;
173 weight.x = ((2.0f - limit) *
N.x + (limit - 1.0f)) / (2.0f * limit - 1.0f);
174 weight.y = ((2.0f - limit) *
N.y + (limit - 1.0f)) / (2.0f * limit - 1.0f);
175 weight.z = ((2.0f - limit) *
N.z + (limit - 1.0f)) / (2.0f * limit - 1.0f);
184 uint co_offset, out_offset, alpha_offset, flags;
193 if (weight.x > 0.0f) {
197 if (weight.y > 0.0f) {
201 if (weight.z > 0.0f) {
218 uint co_offset, out_offset, alpha_offset, flags;
219 uint projection = node.w;
bool map_to_sphere(float *r_u, float *r_v, float x, float y, float z)
bool map_to_tube(float *r_u, float *r_v, float x, float y, float z)
ccl_device float2 direction_to_mirrorball(float3 dir)
ccl_device float2 direction_to_equirectangular(float3 dir)
ccl_device float4 kernel_tex_image_interp(KernelGlobals kg, int id, float x, float y)
CCL_NAMESPACE_BEGIN ccl_device float4 svm_image_texture(KernelGlobals kg, int id, float x, float y, uint flags)
ccl_device_noinline void svm_node_tex_image_box(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node)
ccl_device_noinline void svm_node_tex_environment(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node)
ccl_device_noinline int svm_node_tex_image(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node, int offset)
ccl_device_inline float3 texco_remap_square(float3 co)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define ccl_device_inline
#define ccl_device_noinline
#define CCL_NAMESPACE_END
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
ccl_global const KernelWorkTile * tile
ccl_device_inline void object_inverse_normal_transform(KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private float3 *N)
ccl_device_inline void stack_store_float3(ccl_private float *stack, uint a, float3 f)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 stack_load_float3(ccl_private float *stack, uint a)
ccl_device_inline uint4 read_node(KernelGlobals kg, ccl_private int *offset)
ccl_device_inline void stack_store_float(ccl_private float *stack, uint a, float f)
ccl_device_forceinline void svm_unpack_node_uchar4(uint i, ccl_private uint *x, ccl_private uint *y, ccl_private uint *z, ccl_private uint *w)
ccl_device_inline bool stack_valid(uint a)
@ NODE_IMAGE_COMPRESS_AS_SRGB
@ NODE_IMAGE_ALPHA_UNASSOCIATE
ccl_device_inline float2 safe_normalize(const float2 a)
CCL_NAMESPACE_BEGIN ccl_device_inline float4 zero_float4()
ccl_device float4 color_srgb_to_linear_v4(float4 c)
#define TEX_IMAGE_MISSING_R
#define TEX_IMAGE_MISSING_B
#define TEX_IMAGE_MISSING_A
#define TEX_IMAGE_MISSING_G