Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_draw.c
| Context not available. | |||||
| static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node) | static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node) | ||||
| { | { | ||||
| bNodeLink *link; | bNodeLink *link; | ||||
| unsigned attrib_array[3]; | |||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| glEnable(GL_LINE_SMOOTH); | |||||
| VertexFormat* format = immVertexFormat(); | |||||
| attrib_array[0] = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | |||||
| attrib_array[1] = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); | |||||
| attrib_array[2] = add_attrib(format, "pos_handle", GL_FLOAT, 2, KEEP_FLOAT); | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_BEZIER_CURVE); | |||||
| for (link = node->internal_links.first; link; link = link->next) | for (link = node->internal_links.first; link; link = link->next) | ||||
| node_draw_link_bezier(v2d, snode, link, TH_REDALERT, 0, TH_WIRE, 0, TH_WIRE); | node_draw_link_bezier_glsl(v2d, snode, link, TH_REDALERT, 0, TH_WIRE, 0, TH_WIRE, attrib_array); | ||||
| immUnbindProgram(); | |||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| glDisable(GL_LINE_SMOOTH); | |||||
| } | } | ||||
| static void node_socket_circle_draw(const bContext *C, bNodeTree *ntree, PointerRNA node_ptr, bNodeSocket *sock, unsigned pos, unsigned col) | static void node_socket_circle_draw(const bContext *C, bNodeTree *ntree, PointerRNA node_ptr, bNodeSocket *sock, unsigned pos, unsigned col) | ||||
| Context not available. | |||||
| } | } | ||||
| /* node lines */ | /* node lines */ | ||||
| unsigned attrib_array[3]; | |||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| glEnable(GL_LINE_SMOOTH); | |||||
| VertexFormat* format = immVertexFormat(); | |||||
| attrib_array[0] = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | |||||
| attrib_array[1] = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); | |||||
| attrib_array[2] = add_attrib(format, "pos_handle", GL_FLOAT, 2, KEEP_FLOAT); | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_BEZIER_CURVE); | |||||
| for (link = ntree->links.first; link; link = link->next) { | for (link = ntree->links.first; link; link = link->next) { | ||||
| if (!nodeLinkIsHidden(link)) | if (!nodeLinkIsHidden(link)) | ||||
| node_draw_link(&ar->v2d, snode, link); | node_draw_link(&ar->v2d, snode, link, attrib_array); | ||||
| } | } | ||||
| glDisable(GL_LINE_SMOOTH); | immUnbindProgram(); | ||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| /* draw foreground nodes, last nodes in front */ | /* draw foreground nodes, last nodes in front */ | ||||
| Context not available. | |||||
| } | } | ||||
| /* temporary links */ | /* temporary links */ | ||||
| unsigned attrib_array[3]; | |||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| glEnable(GL_LINE_SMOOTH); | |||||
| VertexFormat* format = immVertexFormat(); | |||||
| attrib_array[0] = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); | |||||
| attrib_array[1] = add_attrib(format, "color", GL_FLOAT, 3, KEEP_FLOAT); | |||||
| attrib_array[2] = add_attrib(format, "pos_handle", GL_FLOAT, 2, KEEP_FLOAT); | |||||
| immBindBuiltinProgram(GPU_SHADER_2D_BEZIER_CURVE); | |||||
| for (nldrag = snode->linkdrag.first; nldrag; nldrag = nldrag->next) { | for (nldrag = snode->linkdrag.first; nldrag; nldrag = nldrag->next) { | ||||
| for (linkdata = nldrag->links.first; linkdata; linkdata = linkdata->next) | for (linkdata = nldrag->links.first; linkdata; linkdata = linkdata->next) | ||||
| node_draw_link(v2d, snode, (bNodeLink *)linkdata->data); | node_draw_link(v2d, snode, (bNodeLink *)linkdata->data, attrib_array); | ||||
| } | } | ||||
| glDisable(GL_LINE_SMOOTH); | immUnbindProgram(); | ||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| if (snode->flag & SNODE_SHOW_GPENCIL) { | if (snode->flag & SNODE_SHOW_GPENCIL) { | ||||
| Context not available. | |||||