GOOENGINE: Shader C++ fixes
This commit is contained in:
@@ -64,5 +64,5 @@ void register_node_type_sh_curvature(void)
|
|||||||
ntype.declare = file_ns::node_declare;
|
ntype.declare = file_ns::node_declare;
|
||||||
ntype.gpu_fn = node_shader_gpu_curvature;
|
ntype.gpu_fn = node_shader_gpu_curvature;
|
||||||
|
|
||||||
blender::bke::nodeRegisterType(&ntype);
|
blender::bke::node_register_type(&ntype);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,5 +41,5 @@ void register_node_type_sh_screenspace_info(void)
|
|||||||
ntype.declare = file_ns::node_declare;
|
ntype.declare = file_ns::node_declare;
|
||||||
ntype.gpu_fn = node_shader_gpu_screenspace_info;
|
ntype.gpu_fn = node_shader_gpu_screenspace_info;
|
||||||
|
|
||||||
blender::bke::nodeRegisterType(&ntype);
|
blender::bke::node_register_type(&ntype);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,5 +70,5 @@ void register_node_type_sh_sdf_noise(void)
|
|||||||
ntype.declare = file_ns::node_declare;
|
ntype.declare = file_ns::node_declare;
|
||||||
ntype.gpu_fn = node_shader_gpu_sdf_noise;
|
ntype.gpu_fn = node_shader_gpu_sdf_noise;
|
||||||
|
|
||||||
blender::bke::nodeRegisterType(&ntype);
|
blender::bke::node_register_type(&ntype);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,9 +173,9 @@ static void node_shader_update_sdf_op(bNodeTree *ntree, bNode *node)
|
|||||||
bNodeSocket *sockDistanceOut = (bNodeSocket *)BLI_findlink(&node->outputs, 0);
|
bNodeSocket *sockDistanceOut = (bNodeSocket *)BLI_findlink(&node->outputs, 0);
|
||||||
|
|
||||||
/* Distance */
|
/* Distance */
|
||||||
nodeSetSocketAvailability(ntree, sockInputA, true);
|
node_set_socket_availability(ntree, sockInputA, true);
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree, sockInputB,
|
node_set_socket_availability(ntree, sockInputB,
|
||||||
!ELEM(sdf->operation,
|
!ELEM(sdf->operation,
|
||||||
SHD_SDF_OP_MASK,
|
SHD_SDF_OP_MASK,
|
||||||
SHD_SDF_OP_INVERT,
|
SHD_SDF_OP_INVERT,
|
||||||
@@ -186,14 +186,14 @@ static void node_shader_update_sdf_op(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_OP_FLATTEN));
|
SHD_SDF_OP_FLATTEN));
|
||||||
|
|
||||||
/* Values */
|
/* Values */
|
||||||
nodeSetSocketAvailability(ntree, sockValue,
|
node_set_socket_availability(ntree, sockValue,
|
||||||
!ELEM(sdf->operation,
|
!ELEM(sdf->operation,
|
||||||
SHD_SDF_OP_UNION,
|
SHD_SDF_OP_UNION,
|
||||||
SHD_SDF_OP_INTERSECT,
|
SHD_SDF_OP_INTERSECT,
|
||||||
SHD_SDF_OP_DIFF,
|
SHD_SDF_OP_DIFF,
|
||||||
SHD_SDF_OP_INVERT));
|
SHD_SDF_OP_INVERT));
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree, sockValue2,
|
node_set_socket_availability(ntree, sockValue2,
|
||||||
ELEM(sdf->operation,
|
ELEM(sdf->operation,
|
||||||
SHD_SDF_OP_DIVIDE,
|
SHD_SDF_OP_DIVIDE,
|
||||||
SHD_SDF_OP_FLATTEN,
|
SHD_SDF_OP_FLATTEN,
|
||||||
@@ -208,7 +208,7 @@ static void node_shader_update_sdf_op(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_OP_INTERSECT_STAIRS,
|
SHD_SDF_OP_INTERSECT_STAIRS,
|
||||||
SHD_SDF_OP_DIFF_STAIRS));
|
SHD_SDF_OP_DIFF_STAIRS));
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree, sockCount, ELEM(sdf->operation, SHD_SDF_OP_ONION));
|
node_set_socket_availability(ntree, sockCount, ELEM(sdf->operation, SHD_SDF_OP_ONION));
|
||||||
|
|
||||||
node_sock_label_clear(sockValue);
|
node_sock_label_clear(sockValue);
|
||||||
node_sock_label_clear(sockValue2);
|
node_sock_label_clear(sockValue2);
|
||||||
@@ -296,5 +296,5 @@ void register_node_type_sh_sdf_op(void)
|
|||||||
ntype.labelfunc = node_shader_label_sdf_op;
|
ntype.labelfunc = node_shader_label_sdf_op;
|
||||||
ntype.updatefunc = node_shader_update_sdf_op;
|
ntype.updatefunc = node_shader_update_sdf_op;
|
||||||
ntype.draw_buttons = node_shader_buts_sdf_op;
|
ntype.draw_buttons = node_shader_buts_sdf_op;
|
||||||
blender::bke::nodeRegisterType(&ntype);
|
blender::bke::node_register_type(&ntype);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ static void node_shader_update_sdf_primitive(bNodeTree *ntree, bNode *node)
|
|||||||
bNodeSocket *sockRound = (bNodeSocket *)BLI_findlink(&node->inputs, 12);
|
bNodeSocket *sockRound = (bNodeSocket *)BLI_findlink(&node->inputs, 12);
|
||||||
bNodeSocket *sockLinewidth = (bNodeSocket *)BLI_findlink(&node->inputs, 13);
|
bNodeSocket *sockLinewidth = (bNodeSocket *)BLI_findlink(&node->inputs, 13);
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree, sockRound,
|
node_set_socket_availability(ntree, sockRound,
|
||||||
ELEM(sdf->mode,
|
ELEM(sdf->mode,
|
||||||
SHD_SDF_3D_BOX,
|
SHD_SDF_3D_BOX,
|
||||||
SHD_SDF_3D_CONE,
|
SHD_SDF_3D_CONE,
|
||||||
@@ -265,10 +265,10 @@ static void node_shader_update_sdf_primitive(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_2D_TRIANGLE,
|
SHD_SDF_2D_TRIANGLE,
|
||||||
SHD_SDF_2D_UNEVEN_CAPSULE,
|
SHD_SDF_2D_UNEVEN_CAPSULE,
|
||||||
SHD_SDF_2D_HORSESHOE));
|
SHD_SDF_2D_HORSESHOE));
|
||||||
nodeSetSocketAvailability(ntree, sockLinewidth, true);
|
node_set_socket_availability(ntree, sockLinewidth, true);
|
||||||
|
|
||||||
/* Points */
|
/* Points */
|
||||||
nodeSetSocketAvailability(ntree, sockPoint1,
|
node_set_socket_availability(ntree, sockPoint1,
|
||||||
ELEM(sdf->mode,
|
ELEM(sdf->mode,
|
||||||
SHD_SDF_3D_PLANE,
|
SHD_SDF_3D_PLANE,
|
||||||
SHD_SDF_3D_POINT_CONE,
|
SHD_SDF_3D_POINT_CONE,
|
||||||
@@ -279,7 +279,7 @@ static void node_shader_update_sdf_primitive(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_2D_BEZIER,
|
SHD_SDF_2D_BEZIER,
|
||||||
SHD_SDF_2D_POINT_TRIANGLE,
|
SHD_SDF_2D_POINT_TRIANGLE,
|
||||||
SHD_SDF_2D_QUAD));
|
SHD_SDF_2D_QUAD));
|
||||||
nodeSetSocketAvailability(ntree, sockPoint2,
|
node_set_socket_availability(ntree, sockPoint2,
|
||||||
ELEM(sdf->mode,
|
ELEM(sdf->mode,
|
||||||
SHD_SDF_3D_POINT_CONE,
|
SHD_SDF_3D_POINT_CONE,
|
||||||
SHD_SDF_3D_POINT_CYLINDER,
|
SHD_SDF_3D_POINT_CYLINDER,
|
||||||
@@ -289,12 +289,12 @@ static void node_shader_update_sdf_primitive(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_2D_BEZIER,
|
SHD_SDF_2D_BEZIER,
|
||||||
SHD_SDF_2D_POINT_TRIANGLE,
|
SHD_SDF_2D_POINT_TRIANGLE,
|
||||||
SHD_SDF_2D_QUAD));
|
SHD_SDF_2D_QUAD));
|
||||||
nodeSetSocketAvailability(ntree,
|
node_set_socket_availability(ntree,
|
||||||
sockPoint3, ELEM(sdf->mode, SHD_SDF_2D_BEZIER, SHD_SDF_2D_POINT_TRIANGLE, SHD_SDF_2D_QUAD));
|
sockPoint3, ELEM(sdf->mode, SHD_SDF_2D_BEZIER, SHD_SDF_2D_POINT_TRIANGLE, SHD_SDF_2D_QUAD));
|
||||||
nodeSetSocketAvailability(ntree, sockPoint4, ELEM(sdf->mode, SHD_SDF_2D_QUAD));
|
node_set_socket_availability(ntree, sockPoint4, ELEM(sdf->mode, SHD_SDF_2D_QUAD));
|
||||||
|
|
||||||
/* Radius */
|
/* Radius */
|
||||||
nodeSetSocketAvailability(ntree, sockRadius,
|
node_set_socket_availability(ntree, sockRadius,
|
||||||
ELEM(sdf->mode,
|
ELEM(sdf->mode,
|
||||||
SHD_SDF_2D_CIRCLE,
|
SHD_SDF_2D_CIRCLE,
|
||||||
SHD_SDF_2D_ARC,
|
SHD_SDF_2D_ARC,
|
||||||
@@ -324,7 +324,7 @@ static void node_shader_update_sdf_primitive(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_3D_POINT_CONE));
|
SHD_SDF_3D_POINT_CONE));
|
||||||
|
|
||||||
/* Values */
|
/* Values */
|
||||||
nodeSetSocketAvailability(ntree, sockValue1,
|
node_set_socket_availability(ntree, sockValue1,
|
||||||
ELEM(sdf->mode,
|
ELEM(sdf->mode,
|
||||||
SHD_SDF_3D_PYRAMID,
|
SHD_SDF_3D_PYRAMID,
|
||||||
SHD_SDF_3D_PLANE,
|
SHD_SDF_3D_PLANE,
|
||||||
@@ -348,7 +348,7 @@ static void node_shader_update_sdf_primitive(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_2D_STAR,
|
SHD_SDF_2D_STAR,
|
||||||
SHD_SDF_2D_UNEVEN_CAPSULE,
|
SHD_SDF_2D_UNEVEN_CAPSULE,
|
||||||
SHD_SDF_2D_ELLIPSE));
|
SHD_SDF_2D_ELLIPSE));
|
||||||
nodeSetSocketAvailability(ntree, sockValue2,
|
node_set_socket_availability(ntree, sockValue2,
|
||||||
ELEM(sdf->mode,
|
ELEM(sdf->mode,
|
||||||
SHD_SDF_2D_PARABOLA_SEGMENT,
|
SHD_SDF_2D_PARABOLA_SEGMENT,
|
||||||
SHD_SDF_2D_ELLIPSE,
|
SHD_SDF_2D_ELLIPSE,
|
||||||
@@ -358,7 +358,7 @@ static void node_shader_update_sdf_primitive(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_2D_RECTANGLE,
|
SHD_SDF_2D_RECTANGLE,
|
||||||
SHD_SDF_2D_RHOMBUS) ||
|
SHD_SDF_2D_RHOMBUS) ||
|
||||||
ELEM(sdf->mode, SHD_SDF_3D_BOX));
|
ELEM(sdf->mode, SHD_SDF_3D_BOX));
|
||||||
nodeSetSocketAvailability(ntree, sockValue3,
|
node_set_socket_availability(ntree, sockValue3,
|
||||||
ELEM(sdf->mode,
|
ELEM(sdf->mode,
|
||||||
SHD_SDF_2D_ISOSCELES,
|
SHD_SDF_2D_ISOSCELES,
|
||||||
SHD_SDF_2D_TRAPEZOID,
|
SHD_SDF_2D_TRAPEZOID,
|
||||||
@@ -369,10 +369,10 @@ static void node_shader_update_sdf_primitive(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_3D_HEX_PRISM,
|
SHD_SDF_3D_HEX_PRISM,
|
||||||
SHD_SDF_3D_HEX_PRISM_INCIRCLE,
|
SHD_SDF_3D_HEX_PRISM_INCIRCLE,
|
||||||
SHD_SDF_3D_BOX));
|
SHD_SDF_3D_BOX));
|
||||||
nodeSetSocketAvailability(ntree, sockValue4, false);
|
node_set_socket_availability(ntree, sockValue4, false);
|
||||||
|
|
||||||
/* Angles */
|
/* Angles */
|
||||||
nodeSetSocketAvailability(ntree, sockAngle1,
|
node_set_socket_availability(ntree, sockAngle1,
|
||||||
ELEM(sdf->mode,
|
ELEM(sdf->mode,
|
||||||
SHD_SDF_3D_SOLID_ANGLE,
|
SHD_SDF_3D_SOLID_ANGLE,
|
||||||
SHD_SDF_2D_FLAT_JOINT,
|
SHD_SDF_2D_FLAT_JOINT,
|
||||||
@@ -480,5 +480,5 @@ void register_node_type_sh_sdf_primitive(void)
|
|||||||
ntype.updatefunc = node_shader_update_sdf_primitive;
|
ntype.updatefunc = node_shader_update_sdf_primitive;
|
||||||
ntype.draw_buttons = node_shader_buts_sdf_primitive;
|
ntype.draw_buttons = node_shader_buts_sdf_primitive;
|
||||||
|
|
||||||
blender::bke::nodeRegisterType(&ntype);
|
blender::bke::node_register_type(&ntype);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,18 +166,18 @@ static void node_shader_update_sdf_vector_op(bNodeTree *ntree, bNode *node)
|
|||||||
bNodeSocket *sockValueOut = (bNodeSocket *)BLI_findlink(&node->outputs, 2);
|
bNodeSocket *sockValueOut = (bNodeSocket *)BLI_findlink(&node->outputs, 2);
|
||||||
|
|
||||||
/* Out sockets. */
|
/* Out sockets. */
|
||||||
nodeSetSocketAvailability(ntree, sockValueOut,
|
node_set_socket_availability(ntree, sockValueOut,
|
||||||
ELEM(sdf->operation,
|
ELEM(sdf->operation,
|
||||||
SHD_SDF_VEC_OP_MIRROR,
|
SHD_SDF_VEC_OP_MIRROR,
|
||||||
SHD_SDF_VEC_OP_REFLECT,
|
SHD_SDF_VEC_OP_REFLECT,
|
||||||
SHD_SDF_VEC_OP_POLAR,
|
SHD_SDF_VEC_OP_POLAR,
|
||||||
SHD_SDF_VEC_OP_EXTRUDE));
|
SHD_SDF_VEC_OP_EXTRUDE));
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree, sockPositionOut,
|
node_set_socket_availability(ntree, sockPositionOut,
|
||||||
ELEM(sdf->operation, SHD_SDF_VEC_OP_MIRROR, SHD_SDF_VEC_OP_GRID));
|
ELEM(sdf->operation, SHD_SDF_VEC_OP_MIRROR, SHD_SDF_VEC_OP_GRID));
|
||||||
|
|
||||||
/* In sockets. */
|
/* In sockets. */
|
||||||
nodeSetSocketAvailability(ntree, sockVector2,
|
node_set_socket_availability(ntree, sockVector2,
|
||||||
ELEM(sdf->operation,
|
ELEM(sdf->operation,
|
||||||
SHD_SDF_VEC_OP_SWIRL,
|
SHD_SDF_VEC_OP_SWIRL,
|
||||||
SHD_SDF_VEC_OP_RADIAL_SHEAR,
|
SHD_SDF_VEC_OP_RADIAL_SHEAR,
|
||||||
@@ -193,17 +193,17 @@ static void node_shader_update_sdf_vector_op(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_VEC_OP_REPEAT_INF,
|
SHD_SDF_VEC_OP_REPEAT_INF,
|
||||||
SHD_SDF_VEC_OP_REPEAT_INF_MIRROR));
|
SHD_SDF_VEC_OP_REPEAT_INF_MIRROR));
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree, sockVector3,
|
node_set_socket_availability(ntree, sockVector3,
|
||||||
ELEM(sdf->operation,
|
ELEM(sdf->operation,
|
||||||
SHD_SDF_VEC_OP_SWIRL,
|
SHD_SDF_VEC_OP_SWIRL,
|
||||||
SHD_SDF_VEC_OP_RADIAL_SHEAR,
|
SHD_SDF_VEC_OP_RADIAL_SHEAR,
|
||||||
SHD_SDF_VEC_OP_REPEAT_FINITE));
|
SHD_SDF_VEC_OP_REPEAT_FINITE));
|
||||||
|
|
||||||
/* Values */
|
/* Values */
|
||||||
nodeSetSocketAvailability(ntree, sockScale,
|
node_set_socket_availability(ntree, sockScale,
|
||||||
ELEM(sdf->operation, SHD_SDF_VEC_OP_SCALE_UV, SHD_SDF_VEC_OP_TILESET));
|
ELEM(sdf->operation, SHD_SDF_VEC_OP_SCALE_UV, SHD_SDF_VEC_OP_TILESET));
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree, sockValue,
|
node_set_socket_availability(ntree, sockValue,
|
||||||
!ELEM(sdf->operation,
|
!ELEM(sdf->operation,
|
||||||
SHD_SDF_VEC_OP_MAP_11,
|
SHD_SDF_VEC_OP_MAP_11,
|
||||||
SHD_SDF_VEC_OP_MAP_05,
|
SHD_SDF_VEC_OP_MAP_05,
|
||||||
@@ -222,17 +222,17 @@ static void node_shader_update_sdf_vector_op(bNodeTree *ntree, bNode *node)
|
|||||||
SHD_SDF_VEC_OP_REPEAT_INF,
|
SHD_SDF_VEC_OP_REPEAT_INF,
|
||||||
SHD_SDF_VEC_OP_REPEAT_INF_MIRROR));
|
SHD_SDF_VEC_OP_REPEAT_INF_MIRROR));
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree,
|
node_set_socket_availability(ntree,
|
||||||
sockValue2, ELEM(sdf->operation, SHD_SDF_VEC_OP_TILESET, SHD_SDF_VEC_OP_PINCH_INFLATE));
|
sockValue2, ELEM(sdf->operation, SHD_SDF_VEC_OP_TILESET, SHD_SDF_VEC_OP_PINCH_INFLATE));
|
||||||
|
|
||||||
nodeSetSocketAvailability(ntree, sockAngle,
|
node_set_socket_availability(ntree, sockAngle,
|
||||||
ELEM(sdf->operation,
|
ELEM(sdf->operation,
|
||||||
SHD_SDF_VEC_OP_BEND,
|
SHD_SDF_VEC_OP_BEND,
|
||||||
SHD_SDF_VEC_OP_TWIST,
|
SHD_SDF_VEC_OP_TWIST,
|
||||||
SHD_SDF_VEC_OP_ROTATE,
|
SHD_SDF_VEC_OP_ROTATE,
|
||||||
SHD_SDF_VEC_OP_ROTATE_UV));
|
SHD_SDF_VEC_OP_ROTATE_UV));
|
||||||
nodeSetSocketAvailability(ntree, sockCount, ELEM(sdf->operation, SHD_SDF_VEC_OP_TILESET));
|
node_set_socket_availability(ntree, sockCount, ELEM(sdf->operation, SHD_SDF_VEC_OP_TILESET));
|
||||||
nodeSetSocketAvailability(ntree, sockCount2, ELEM(sdf->operation, SHD_SDF_VEC_OP_TILESET));
|
node_set_socket_availability(ntree, sockCount2, ELEM(sdf->operation, SHD_SDF_VEC_OP_TILESET));
|
||||||
|
|
||||||
node_sock_label_clear(sockValue);
|
node_sock_label_clear(sockValue);
|
||||||
node_sock_label_clear(sockValue2);
|
node_sock_label_clear(sockValue2);
|
||||||
@@ -358,5 +358,5 @@ void register_node_type_sh_sdf_vector_op(void)
|
|||||||
ntype.labelfunc = node_shader_label_sdf_vector_op;
|
ntype.labelfunc = node_shader_label_sdf_vector_op;
|
||||||
ntype.updatefunc = node_shader_update_sdf_vector_op;
|
ntype.updatefunc = node_shader_update_sdf_vector_op;
|
||||||
ntype.draw_buttons = node_shader_buts_sdf_vector_op;
|
ntype.draw_buttons = node_shader_buts_sdf_vector_op;
|
||||||
blender::bke::nodeRegisterType(&ntype);
|
blender::bke::node_register_type(&ntype);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,5 +40,5 @@ void register_node_type_sh_set_depth(void)
|
|||||||
ntype.declare = file_ns::node_declare;
|
ntype.declare = file_ns::node_declare;
|
||||||
ntype.gpu_fn = file_ns::node_shader_gpu_add_shader;
|
ntype.gpu_fn = file_ns::node_shader_gpu_add_shader;
|
||||||
|
|
||||||
blender::bke::nodeRegisterType(&ntype);
|
blender::bke::node_register_type(&ntype);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,5 +99,5 @@ void register_node_type_sh_shader_info(void)
|
|||||||
|
|
||||||
ntype.gpu_fn = file_ns::node_shader_gpu_shader_info;
|
ntype.gpu_fn = file_ns::node_shader_gpu_shader_info;
|
||||||
|
|
||||||
blender::bke::nodeRegisterType(&ntype);
|
blender::bke::node_register_type(&ntype);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user