41 if (depth1[0] < depth2[0]) {
54 const float depth1 = *it.in(1);
55 const float depth2 = *it.in(3);
56 const float *
color = (depth1 < depth2) ? it.in(0) : it.in(2);
61 void ZCombineAlphaOperation::execute_pixel_sampled(
float output[4],
73 if (depth1[0] <= depth2[0]) {
81 float fac = color1[3];
82 float ifac = 1.0f - fac;
83 output[0] = fac * color1[0] + ifac * color2[0];
84 output[1] = fac * color1[1] + ifac * color2[1];
85 output[2] = fac * color1[2] + ifac * color2[2];
89 void ZCombineAlphaOperation::update_memory_buffer_partial(MemoryBuffer *
output,
91 Span<MemoryBuffer *>
inputs)
93 for (BuffersIterator<float> it =
output->iterate_with(
inputs,
area); !it.is_end(); ++it) {
94 const float depth1 = *it.in(1);
95 const float depth2 = *it.in(3);
98 if (depth1 <= depth2) {
106 const float fac = color1[3];
107 const float ifac = 1.0f - fac;
108 it.out[0] = fac * color1[0] + ifac * color2[0];
109 it.out[1] = fac * color1[1] + ifac * color2[1];
110 it.out[2] = fac * color1[2] + ifac * color2[2];
111 it.out[3] =
MAX2(color1[3], color2[3]);
164 const float mask = *it.in(0);
165 const float *color1 = it.in(1);
166 const float *color2 = it.in(2);
171 void ZCombineMaskAlphaOperation::execute_pixel_sampled(
float output[4],
184 float fac = (1.0f -
mask[0]) * (1.0f - color1[3]) +
mask[0] * color2[3];
185 float mfac = 1.0f - fac;
187 output[0] = color1[0] * mfac + color2[0] * fac;
188 output[1] = color1[1] * mfac + color2[1] * fac;
189 output[2] = color1[2] * mfac + color2[2] * fac;
193 void ZCombineMaskAlphaOperation::update_memory_buffer_partial(MemoryBuffer *
output,
197 for (BuffersIterator<float> it =
output->iterate_with(
inputs,
area); !it.is_end(); ++it) {
198 const float mask = *it.in(0);
199 const float *color1 = it.in(1);
200 const float *color2 = it.in(2);
201 const float fac = (1.0f -
mask) * (1.0f - color1[3]) +
mask * color2[3];
202 const float mfac = 1.0f - fac;
204 it.out[0] = color1[0] * mfac + color2[0] * fac;
205 it.out[1] = color1[1] * mfac + color2[1] * fac;
206 it.out[2] = color1[2] * mfac + color2[2] * fac;
207 it.out[3] =
MAX2(color1[3], color2[3]);
MINLINE void copy_v4_v4(float r[4], const float a[4])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
a MemoryBuffer contains access to the data of a chunk
void add_output_socket(DataType datatype)
SocketReader * get_input_socket_reader(unsigned int index)
NodeOperationFlags flags_
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void init_execution() override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
SocketReader * mask_reader_
SocketReader * image1Reader_
SocketReader * image2Reader_
void deinit_execution() override
SocketReader * image2Reader_
SocketReader * image1Reader_
void deinit_execution() override
void init_execution() override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
SocketReader * depth1Reader_
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
SocketReader * depth2Reader_
depth_tx sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static void area(int d1, int d2, int e1, int e2, float weights[2])
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
static bNodeSocketTemplate inputs[]