GelFX – Nodes

This will be a short tutorial on how to make a new node.

Usually if you are making a Node, all that you want to change is the render function. Within a custom render function, you can make basically any OpenGL calls you would like, though there are some OpenGL states that are assumed to be one way or another before some Core rendering functions begin. glColor is supposed to be 1,1,1,1, faces should be culled, depth testing enabled with the depthFunc being GL_LESS, and GL_TEXTURE_2D should be enabled. Make sure that at the end of the function this is all true.

If all you change is the render function, the SceneGraph will interface with the new node class fine without any other changes. If you are making a new Pipe to use that Node in a special case, you need to make a new Node type. To do this, you must define a new node type in “Node.h”. You can see where the other defines are, right after it includes vector. The standard for Node type defines is to put GFX_NODE_ and then whatever type of Node it is. In your custom constructor you must set the variable “type” of the Node to whatever define you created.

I hope this might be useful someday when the GelFX library actually has some usable features, and full tutorials on handling the Core.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>