render_configs
Table of Contents
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 <index> "name" fbo GL_COLOR_ATTACHMENT0 GL_FLOAT GL_RGBA (texture "name" | renderbuffer <<imageType>> | 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" <m11> <m12> <m13> <m14> ... <m41> <m42> <m43> <m44> uniform_vec3 "uniformName" <x> <y> <z> uniform_mtl "uniformName" "materialPropertyName" uniformType sampler "samplerObjectName" ((GL_WRAP_S|GL_WRAP_T|GL_WRAP_R|...) (PARAMVALUE) ...) pass <index> bindfbo "fboname" bindtexture "shaderVariable" "textureName" "" zonly 1 useuniforms "uniformlist" pass <index> # optional zonly 0
VertexAttribInfo
struct VertexAttribInfo { int index; string name; };
Render Configuration Syntax:
vertattrib <index> <name>
ProgramInfo
struct ProgramInfo { string name; string vertShader; string fragShader; vector<VertexAttribInfo> vertexAttribs; };
Render Configuration Syntax:
program <name> vertshader <vertShader> fragshader <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<tuple<GLenum, string>> renderbuffers; // attachment, target, texture, level vector<tuple<GLenum, GLenum, string, int>> 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<enum> enables; vector<string> uniformLists; vector<tuple<string,string,string>> 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<PassInfo> passes; int zonly; int drawsg; int width; int height; };
Render Configuration Syntax:
renderconfig <name> glEnable <enum>
SamplerInfo
struct SamplerInfo { string name; vector<pair<enum, enum>> parameters; };
Render Configuration Syntax:
sampler <name> sampler <param> <param value>
TextureInfo
struct TextureInfo { string name; enum target; vector<string> files; int components; enum format; enum internalformat; int width; int height; bool generateMipmap; };
Render Configuration Syntax:
texture <name> texture <target> <filename> texture <level> <internalformat> <width> <height> <format> <type> 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<string, RenderConfigInfo> renderConfigs; map<string, UniformLists> uniformLists; map<string, TextureInfo> textures; map<string, SamplerInfo> samplers; };
To tell the renderer what to render, use the render command
render <renderconfig 1> render <renderconfig 2>
render_configs.txt · Last modified: 2016/10/31 21:48 by 47.200.224.152