Permalink
Browse files

GLSL input nodes

  • Loading branch information...
1 parent f0ee2b1 commit 5b2e56dabaebf79debcd1fb0677a858c63c6cc08 frigge committed Dec 6, 2011
@@ -129,3 +129,72 @@ IlluminateInputNode::IlluminateInputNode(const IlluminateInputNode *node)
: InputNode(node)
{
}
+
+GLFragmentInputNode::GLFragmentInputNode(bool raw)
+ : InputNode("Fragment Shader Input")
+{
+ setNodeType(GLFRAGMENTINPUT);
+ if(!raw){
+ new DoutSocket("gl_Color", COLOR, this);
+ new DoutSocket("gl_SecondaryColor", COLOR, this);
+ new DoutSocket("gl_TexCoord[]", COLOR, this);
+ new DoutSocket("gl__FogFragCoord", FLOAT, this);
+ new DoutSocket("gl_FragCoord", POINT, this);
+ new DoutSocket("gl_FrontFacing", CONDITION, this);
+ }
+}
+
+GLFragmentInputNode::GLFragmentInputNode(const GLFragmentInputNode *node)
+ : InputNode(node)
+{
+}
+
+GLVertexInputNode::GLVertexInputNode(bool raw)
+ : InputNode("Vertex Shader Input")
+{
+ setNodeType(GLVERTEXINPUT);
+ if(!raw){
+ new DoutSocket("gl_Vertex", VECTOR, this);
+ new DoutSocket("gl_Normal", NORMAL, this);
+ new DoutSocket("gl_Color", COLOR, this);
+ new DoutSocket("gl_SecondaryColor", COLOR, this);
+ new DoutSocket("gl_MultiTexCoord0", POINT, this);
+ new DoutSocket("gl_MultiTexCoord1", POINT, this);
+ new DoutSocket("gl_MultiTexCoord2", POINT, this);
+ new DoutSocket("gl_MultiTexCoord3", POINT, this);
+ new DoutSocket("gl_MultiTexCoord4", POINT, this);
+ new DoutSocket("gl_MultiTexCoord5", POINT, this);
+ new DoutSocket("gl_MultiTexCoord6", POINT, this);
+ new DoutSocket("gl_MultiTexCoord7", POINT, this);
+ new DoutSocket("gl_FogCoord", FLOAT, this);
+ }
+}
+
+GLVertexInputNode::GLVertexInputNode(const GLVertexInputNode *node)
+ : InputNode(node)
+{
+}
+
+GLGeometryInputNode::GLGeometryInputNode(bool raw)
+ : InputNode("Geometry Shader Input")
+{
+ setNodeType(GLGEOMETRYINPUT);
+ if(!raw){
+ new DoutSocket("gl_VerticesIn", INTEGER, this);
+ new DoutSocket("gl_FrontColorIn", COLOR, this);
+ new DoutSocket("gl_BackColorIn", COLOR, this);
+ new DoutSocket("gl_FrontSecondaryColorIn", COLOR, this);
+ new DoutSocket("gl_BackSecondaryColorIn", COLOR, this);
+ new DoutSocket("gl_TexCoordIn", POINT, this);
+ new DoutSocket("gl_FogFragCoordIn", POINT, this);
+ new DoutSocket("gl_PositionIn", POINT, this);
+ new DoutSocket("gl_PointSizeIn", POINT, this);
+ new DoutSocket("gl_ClipVertexIn", POINT, this);
+ }
+}
+
+GLGeometryInputNode::GLGeometryInputNode(const GLGeometryInputNode *node)
+ : InputNode(node)
+{
+}
+
@@ -72,5 +72,28 @@ class IlluminateInputNode : public InputNode
IlluminateInputNode(const IlluminateInputNode *node);
};
//RSL Input Nodes <<
+
+//GLSL Input Nodes >>
+class GLFragmentInputNode : public InputNode
+{
+public:
+ GLFragmentInputNode(bool raw=false);
+ GLFragmentInputNode(const GLFragmentInputNode *node);
+};
+
+class GLVertexInputNode : public InputNode
+{
+public:
+ GLVertexInputNode(bool raw=false);
+ GLVertexInputNode(const GLVertexInputNode *node);
+};
+
+class GLGeometryInputNode : public InputNode
+{
+public:
+ GLGeometryInputNode(bool raw=false);
+ GLGeometryInputNode(const GLGeometryInputNode *node);
+};
+//GLSL Input Nodes <<
#endif /* end of include guard: INPUTS_4BXR1560 */
@@ -211,6 +211,8 @@ FragmentOutputNode::FragmentOutputNode(bool raw)
DinSocket *dirsocket = new DinSocket("Directory", STRING, this);
((StringProperty*)dirsocket->getProperty())->setPath(StringProperty::DIRPATH);
new DinSocket("gl_FragColor", COLOR, this);
+ new DinSocket("gl_FragData", POINT, this);
+ new DinSocket("gl_FragDepth", FLOAT, this);
new DoutSocket("ID", INTEGER, this);
}
}
@@ -121,10 +121,15 @@ void BuildIn::registerNodes()
FRG::lib->addNode("Light Output", "RSL Outputs", createNode<LightOutputNode>);
FRG::lib->addNode("Preview", "RSL Outputs", createNode<DShaderPreview>);
+ FRG::lib->addGroup("GLSL Inputs", "Shading");
+ FRG::lib->addNode("Fragment Input", "GLSL Inputs", createNode<GLFragmentInputNode>);
+ FRG::lib->addNode("Vertex Input", "GLSL Inputs", createNode<GLVertexInputNode>);
+ FRG::lib->addNode("Geometry Input", "GLSL Inputs", createNode<GLGeometryInputNode>);
+
FRG::lib->addGroup("GLSL Outputs", "Shading");
FRG::lib->addNode("Fragment Output", "GLSL Outputs", createNode<FragmentOutputNode>);
- //FRG::lib->addNode("Vertex Output", "GLSL Outputs", createNode<VertexOutputNode>);
- //FRG::lib->addNode("Geometry Output", "GLSL Outputs", createNode<GeometryOutputNode>);
+ FRG::lib->addNode("Vertex Output", "GLSL Outputs", createNode<VertexOutputNode>);
+ FRG::lib->addNode("Geometry Output", "GLSL Outputs", createNode<GeometryOutputNode>);
FRG::lib->addNode("Add", "Math", &MaddNode);
FRG::lib->addNode("Subtract", "Math", &MSubNode);
@@ -82,7 +82,9 @@ enum NType
FLOATTOVECTOR, VIEWPORTNODE,
FRAGMENTOUTPUT, VERTEXOUTPUT,
- GEOMETRYOUTPUT
+ GEOMETRYOUTPUT,
+ GLFRAGMENTINPUT, GLVERTEXINPUT,
+ GLGEOMETRYINPUT
};
class VNode;
@@ -97,6 +97,17 @@ typedef enum
SCENEOBJECT,
POLYGON,
INTEGER,
+
+ VEC2,
+ MAT2,
+ MAT3,
+
+ SAMPLER1D,
+ SAMPLER2D,
+ SAMPLER3D,
+ SAMPLERCUBE,
+ SAMPLER1DSHADOW,
+ SAMPLER2DSHADOW
}socket_type;
typedef enum

0 comments on commit 5b2e56d

Please sign in to comment.