===== Render Configs =====
setvar myVariable 11235
setvar screenWidth $myVariable * 8
enum imageType { GL_UNSIGNED_BYTE }
renderconfig "DeferredRenderer"
path "path1"
path "path2"
program ""
vertshader "filename"
fragshader "filename"
vertattrib 0 "vtxPosition"
vertattrib "name"
fbo GL_COLOR_ATTACHMENT0 GL_FLOAT GL_RGBA (texture "name" | renderbuffer <> | cube_(pos|neg)_(x|y|z) "name")
texture name "name" width 256 height 256 components 3 type GL_UNSIGNED_BYTE
loadtexture name "name" filename "filename"
uniformlist "uniformListName"
uniform_mat4 "uniformName" ...
uniform_vec3 "uniformName"
uniform_mtl "uniformName" "materialPropertyName" uniformType
sampler "samplerObjectName" ((GL_WRAP_S|GL_WRAP_T|GL_WRAP_R|...) (PARAMVALUE) ...)
pass
bindfbo "fboname"
bindtexture "shaderVariable" "textureName" ""
zonly 1
useuniforms "uniformlist"
pass
# optional
zonly 0
==== VertexAttribInfo ====
struct VertexAttribInfo
{
int index;
string name;
};
**Render Configuration Syntax:**
vertattrib
==== ProgramInfo ====
struct ProgramInfo
{
string name;
string vertShader;
string fragShader;
vector vertexAttribs;
};
**Render Configuration Syntax:**
program
vertshader
fragshader
==== AttachmentInfo ====
struct AttachmentInfo
{
string attachment; // "COLOR_ATTACHMENT0", "COLOR_ATTACHMENT1", "DEPTH_ATTACHMENT"
string type; // "GL_UNSIGNED_BYTE", ...
string renderbuffer;
string texture;
string target;
};
==== FrambufferInfo ====
struct FramebufferInfo
{
string name;
// attachment, renderbuffer
vector> renderbuffers;
// attachment, target, texture, level
vector> textures;
};
fbo "name"
fbo attach GL_RENDERBUFFER (GL_COLOR_ATTACHMENTn | GL_DEPTH_ATTACHMENT) "name"
fbo attach GL_TEXTURE_2D GL_(COLOR|DEPTH)_ATTACHMENT "name" [level = 0]
fbo attach GL_TEXTURE_CUBE_MAP_(POSITIVE|NEGATIVE)_(X|Y|Z) "name" [level = 0]
==== PassInfo ====
struct PassInfo
{
int index;
string fboName;
string program;
vector enables;
vector uniformLists;
vector> textures; // uniformName, textureObj, samplerObj
};
==== RenderConfigInfo ====
//RenderConfigInfo// is used to set up the entire rendering pipeline. It bridges the scene graph with the rendering engine. It tells the Fluxions engine how exactly a rendered image should be produced with OpenGL. It can be used to decide whether to quick render a depth pass with //zonly//. It can be used to decide whether to render the scene graph with //drawsg// or a full screen quad instead. The //width// and //height// may be specified. If they are 0, then the default screen width and height are used instead.
struct RenderConfigInfo
{
string name;
ProgramInfo program;
FramebufferInfo fbo;
vector passes;
int zonly;
int drawsg;
int width;
int height;
};
**Render Configuration Syntax:**
renderconfig
glEnable
==== SamplerInfo ====
struct SamplerInfo
{
string name;
vector> parameters;
};
**Render Configuration Syntax:**
sampler
sampler
==== TextureInfo ====
struct TextureInfo
{
string name;
enum target;
vector files;
int components;
enum format;
enum internalformat;
int width;
int height;
bool generateMipmap;
};
**Render Configuration Syntax:**
texture
texture
texture
texture generateMipmap
| //internalformat// | GL_RGB[A], GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL |
| //format// | GL_UNSIGNED_BYTE, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT_32F |
==== RenderbufferInfo ====
struct RenderbufferInfo
{
int width;
int height;
enum format;
};
==== Renderer ====
struct Renderer
{
map renderConfigs;
map uniformLists;
map textures;
map samplers;
};
To tell the renderer what to render, use the render command
render
render