17 input_color_program_ =
nullptr;
27 vector_read_fn_ = [=](
float x,
float y,
float *
out) {
30 scale_x_read_fn_ = [=](
float x,
float y,
float *
out) {
33 scale_y_read_fn_ = [=](
float x,
float y,
float *
out) {
40 input_vector_width_ =
vector->get_width();
41 input_vector_height_ =
vector->get_height();
50 float uv[2], deriv[2][2];
62 bool DisplaceOperation::read_displacement(
63 float x,
float y,
float xscale,
float yscale,
const float origin[2],
float &r_u,
float &r_v)
65 float width = input_vector_width_;
66 float height = input_vector_height_;
67 if (x < 0.0f || x >=
width || y < 0.0f || y >=
height) {
74 vector_read_fn_(
x,
y,
col);
75 r_u = origin[0] -
col[0] * xscale;
76 r_v = origin[1] -
col[1] * yscale;
86 scale_x_read_fn_(
xy[0],
xy[1],
col);
88 scale_y_read_fn_(
xy[0],
xy[1],
col);
92 CLAMP(xs, -width_x4_, width_x4_);
93 CLAMP(ys, -height_x4_, height_x4_);
96 read_displacement(
xy[0],
xy[1], xs, ys,
xy, r_uv[0], r_uv[1]);
99 const float epsilon[2] = {1.0f, 1.0f};
105 if (read_displacement(
xy[0] +
epsilon[0],
xy[1], xs, ys,
xy, uv[0], uv[1])) {
106 r_deriv[0][0] += uv[0] - r_uv[0];
107 r_deriv[1][0] += uv[1] - r_uv[1];
110 if (read_displacement(
xy[0] -
epsilon[0],
xy[1], xs, ys,
xy, uv[0], uv[1])) {
111 r_deriv[0][0] += r_uv[0] - uv[0];
112 r_deriv[1][0] += r_uv[1] - uv[1];
116 float numinv = 1.0f / (
float)num;
117 r_deriv[0][0] *= numinv;
118 r_deriv[1][0] *= numinv;
122 if (read_displacement(
xy[0],
xy[1] +
epsilon[1], xs, ys,
xy, uv[0], uv[1])) {
123 r_deriv[0][1] += uv[0] - r_uv[0];
124 r_deriv[1][1] += uv[1] - r_uv[1];
127 if (read_displacement(
xy[0],
xy[1] -
epsilon[1], xs, ys,
xy, uv[0], uv[1])) {
128 r_deriv[0][1] += r_uv[0] - uv[0];
129 r_deriv[1][1] += r_uv[1] - uv[1];
133 float numinv = 1.0f / (
float)num;
134 r_deriv[0][1] *= numinv;
135 r_deriv[1][1] *= numinv;
141 input_color_program_ =
nullptr;
142 vector_read_fn_ =
nullptr;
143 scale_x_read_fn_ =
nullptr;
144 scale_y_read_fn_ =
nullptr;
159 color_input.
xmin = 0;
161 color_input.
ymin = 0;
192 const rcti &output_area,
201 r_input_area = output_area;
206 r_input_area = output_area;
219 vector_read_fn_ = [=](
float x,
float y,
float *
out) {
vector->read_elem_bilinear(
x,
y,
out); };
230 const float xy[2] = {(
float)it.x, (
float)it.y};
typedef float(TangentPoint)[2]
MINLINE void zero_v2(float r[2])
MINLINE bool is_zero_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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
_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 GLsizei width
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
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
void pixel_transform(const float xy[2], float r_uv[2], float r_deriv[2][2])
void deinit_execution() override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void init_execution() override
void update_memory_buffer_started(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
a MemoryBuffer contains access to the data of a chunk
void read_elem_checked(int x, int y, float *out) const
void read_elem_bilinear(float x, float y, float *out) const
void read_elem_filtered(float x, float y, float dx[2], float dy[2], float *out) const
NodeOperation contains calculation logic.
unsigned int get_height() const
void add_output_socket(DataType datatype)
void read_filtered(float result[4], float x, float y, float dx[2], float dy[2])
SocketReader * get_input_socket_reader(unsigned int index)
unsigned int get_width() const
eExecutionModel execution_model_
NodeOperationFlags flags_
const rcti & get_canvas() const
NodeOperation * get_input_operation(int index)
virtual bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output)
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
@ Vector
Vector data type.
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
static void area(int d1, int d2, int e1, int e2, float weights[2])
void expand_area_for_sampler(rcti &area, PixelSampler sampler)
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static bNodeSocketTemplate inputs[]