22 FrameBufferRenderShader::FrameBufferRenderShader(
Renderer* renderer)
43 "shader/" + shaderVersion +
"/framebuffer",
44 "render_vertexshader.vert"
50 "shader/" + shaderVersion +
"/framebuffer",
51 "render_fragmentshader.frag"
81 auto fbVertices = ObjectBuffer::getByteBuffer(contextIdx, 6 * 3 *
sizeof(
float))->asFloatBuffer();
83 fbVertices.put(-1.0f); fbVertices.put(+1.0f); fbVertices.put(0.0f);
84 fbVertices.put(+1.0f); fbVertices.put(+1.0f); fbVertices.put(0.0f);
85 fbVertices.put(+1.0f); fbVertices.put(-1.0f); fbVertices.put(0.0f);
87 fbVertices.put(+1.0f); fbVertices.put(-1.0f); fbVertices.put(0.0f);
88 fbVertices.put(-1.0f); fbVertices.put(-1.0f); fbVertices.put(0.0f);
89 fbVertices.put(-1.0f); fbVertices.put(+1.0f); fbVertices.put(0.0f);
96 auto fbTextureCoordinates = ObjectBuffer::getByteBuffer(contextIdx, 6 * 2 *
sizeof(
float))->asFloatBuffer();
99 fbTextureCoordinates.put(+0.0f); fbTextureCoordinates.put(0.0f);
100 fbTextureCoordinates.put(+1.0f); fbTextureCoordinates.put(0.0f);
101 fbTextureCoordinates.put(+1.0f); fbTextureCoordinates.put(1.0f);
103 fbTextureCoordinates.put(+1.0f); fbTextureCoordinates.put(1.0f);
104 fbTextureCoordinates.put(+0.0f); fbTextureCoordinates.put(1.0f);
105 fbTextureCoordinates.put(+0.0f); fbTextureCoordinates.put(0.0f);
107 fbTextureCoordinates.put(+0.0f); fbTextureCoordinates.put(+1.0f);
108 fbTextureCoordinates.put(+1.0f); fbTextureCoordinates.put(+1.0f);
109 fbTextureCoordinates.put(+1.0f); fbTextureCoordinates.put(0.0f);
111 fbTextureCoordinates.put(+1.0f); fbTextureCoordinates.put(0.0f);
112 fbTextureCoordinates.put(+0.0f); fbTextureCoordinates.put(0.0f);
113 fbTextureCoordinates.put(+0.0f); fbTextureCoordinates.put(+1.0f);
static Engine * getInstance()
Returns engine instance.
static VBOManager * getVBOManager()
Frame buffer render shader.
int32_t vboTextureCoordinates
void initialize()
Initialize.
~FrameBufferRenderShader()
Public destructor.
int32_t uniformDepthBufferTextureUnit
int32_t uniformColorBufferTextureUnit
void useProgram()
Use render program.
void unUseProgram()
Un use render program.
VBOManager_VBOManaged * addVBO(const string &vboId, int32_t ids, bool useGPUMemory, bool shared, bool &created)
Adds a VBO to manager or retrieve VBO if existing.
void removeVBO(const string &vboId)
Removes a VBO from manager.
virtual int32_t loadShader(int32_t type, const string &pathName, const string &fileName, const string &definitions=string(), const string &functions=string())=0
Loads a shader.
int32_t SHADER_FRAGMENT_SHADER
int32_t SHADER_VERTEX_SHADER
virtual int32_t createProgram(int type)=0
Creates a shader program.
virtual bool isUsingProgramAttributeLocation()=0
virtual void setProgramAttributeLocation(int32_t programId, int32_t location, const string &name)=0
Bind attribute to a input location.
virtual void setProgramUniformInteger(int contextIdx, int32_t uniformId, int32_t value)=0
Set up a integer uniform value.
RendererType getRendererType()
virtual bool linkProgram(int32_t programId)=0
Links attached shaders to a program.
void setLighting(int contextIdx, int32_t lighting)
Set current lighting model.
virtual void attachShaderToProgram(int32_t programId, int32_t shaderId)=0
Attaches a shader to a program.
virtual int32_t getProgramUniformLocation(int32_t programId, const string &name)=0
Returns location of given uniform variable.
int32_t CONTEXTINDEX_DEFAULT
virtual void uploadBufferObject(int contextIdx, int32_t bufferObjectId, int32_t size, FloatBuffer *data)=0
Uploads buffer data to buffer object.
virtual void useProgram(int contextIdx, int32_t programId)=0
Use shader program.
virtual const string getShaderVersion()=0
Buffers used to transfer data between main memory to graphics board memory.