TDME2 1.9.121
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GL3Renderer Class Reference

OpenGL 3 renderer. More...

#include <tdme/engine/subsystems/renderer/GL3Renderer.h>

Inheritance diagram for GL3Renderer:
Inheritance graph
Collaboration diagram for GL3Renderer:
Collaboration graph

Public Member Functions

 GL3Renderer ()
 Public constructor. More...
 
void initialize () override
 Initialize renderer. More...
 
void initializeFrame () override
 Pre Frame Initialization. More...
 
void finishFrame () override
 Finish frame. More...
 
const string getVendor () override
 
const string getRenderer () override
 
const string getShaderVersion () override
 
bool isSupportingMultithreadedRendering () override
 
bool isBufferObjectsAvailable () override
 Checks if buffer objects is available. More...
 
bool isDepthTextureAvailable () override
 Checks if depth texture is available. More...
 
bool isUsingProgramAttributeLocation () override
 
bool isSupportingIntegerProgramAttributes () override
 
bool isSpecularMappingAvailable () override
 
bool isNormalMappingAvailable () override
 
bool isInstancedRenderingAvailable () override
 Checks if instanced rendering is available. More...
 
bool isPBRAvailable () override
 
bool isComputeShaderAvailable () override
 
bool isGLCLAvailable () override
 
bool isUsingShortIndices () override
 
bool isDeferredShadingAvailable () override
 
int32_t getTextureUnits () override
 
int32_t loadShader (int32_t type, const string &pathName, const string &fileName, const string &definitions=string(), const string &functions=string()) override
 Loads a shader. More...
 
void useProgram (int contextIdx, int32_t programId) override
 Use shader program. More...
 
int32_t createProgram (int type) override
 Creates a shader program. More...
 
void attachShaderToProgram (int32_t programId, int32_t shaderId) override
 Attaches a shader to a program. More...
 
bool linkProgram (int32_t programId) override
 Links attached shaders to a program. More...
 
int32_t getProgramUniformLocation (int32_t programId, const string &name) override
 Returns location of given uniform variable. More...
 
void setProgramUniformInteger (int contextIdx, int32_t uniformId, int32_t value) override
 Set up a integer uniform value. More...
 
void setProgramUniformFloat (int contextIdx, int32_t uniformId, float value) override
 Set up a float uniform value. More...
 
void setProgramUniformFloatMatrix3x3 (int contextIdx, int32_t uniformId, const array< float, 9 > &data) override
 Set up a float matrix 3x3 uniform value. More...
 
void setProgramUniformFloatMatrix4x4 (int contextIdx, int32_t uniformId, const array< float, 16 > &data) override
 Set up a float matrix 4x4 uniform value. More...
 
void setProgramUniformFloatMatrices4x4 (int contextIdx, int32_t uniformId, int32_t count, FloatBuffer *data) override
 Set up a float matrices 4x4 uniform values. More...
 
void setProgramUniformFloatVec4 (int contextIdx, int32_t uniformId, const array< float, 4 > &data) override
 Set up a float vec4 uniform value. More...
 
void setProgramUniformFloatVec3 (int contextIdx, int32_t uniformId, const array< float, 3 > &data) override
 Set up a float vec3 uniform value. More...
 
void setProgramUniformFloatVec2 (int contextIdx, int32_t uniformId, const array< float, 2 > &data) override
 Set up a float vec2 uniform value. More...
 
void setProgramAttributeLocation (int32_t programId, int32_t location, const string &name) override
 Bind attribute to a input location. More...
 
void setViewPort (int32_t width, int32_t height) override
 Set up viewport parameter. More...
 
void updateViewPort () override
 Update viewport. More...
 
void setClearColor (float red, float green, float blue, float alpha) override
 Set up clear color. More...
 
void enableCulling (int contextIdx) override
 Enable culling. More...
 
void disableCulling (int contextIdx) override
 Disable culling. More...
 
void setFrontFace (int contextIdx, int32_t frontFace) override
 Set up clock wise or counter clock wise faces as front face. More...
 
void setCullFace (int32_t cullFace) override
 Sets up which face will be culled. More...
 
void enableBlending () override
 Enables blending. More...
 
void enableAdditionBlending () override
 Enable blending with c = a + b. More...
 
void disableBlending () override
 Disables blending. More...
 
void enableDepthBufferWriting () override
 Enable depth buffer writing. More...
 
void disableDepthBufferWriting () override
 Disable depth buffer writing. More...
 
void disableDepthBufferTest () override
 Disable depth buffer test. More...
 
void enableDepthBufferTest () override
 Enable depth buffer test. More...
 
void setDepthFunction (int32_t depthFunction) override
 Set up depth function. More...
 
void setColorMask (bool red, bool green, bool blue, bool alpha) override
 Set up GL rendering colormask. More...
 
void clear (int32_t mask) override
 Clear render buffer with given mask. More...
 
int32_t createTexture () override
 Creates a texture. More...
 
int32_t createDepthBufferTexture (int32_t width, int32_t height, int32_t cubeMapTextureId, int32_t cubeMapTextureIndex) override
 Creates a depth buffer texture. More...
 
int32_t createColorBufferTexture (int32_t width, int32_t height, int32_t cubeMapTextureId, int32_t cubeMapTextureIndex) override
 Creates a color buffer texture. More...
 
int32_t createGBufferGeometryTexture (int32_t width, int32_t height) override
 Creates a geometry buffer geometry texture. More...
 
int32_t createGBufferColorTexture (int32_t width, int32_t height) override
 Creates a geometry buffer color RGBA texture. More...
 
void uploadTexture (int contextIdx, Texture *texture) override
 Uploads texture data to current bound texture. More...
 
void uploadCubeMapTexture (int contextIdx, Texture *textureLeft, Texture *textureRight, Texture *textureTop, Texture *textureBottom, Texture *textureFront, Texture *textureBack) override
 Uploads cube map texture data to current bound texture. More...
 
int32_t createCubeMapTexture (int contextIdx, int32_t width, int32_t height) override
 Create cube map texture from frame buffers. More...
 
void resizeDepthBufferTexture (int32_t textureId, int32_t width, int32_t height) override
 Resizes a depth texture. More...
 
void resizeColorBufferTexture (int32_t textureId, int32_t width, int32_t height) override
 Resize color buffer texture. More...
 
void resizeGBufferGeometryTexture (int32_t textureId, int32_t width, int32_t height) override
 Resizes a geometry buffer geometry texture. More...
 
void resizeGBufferColorTexture (int32_t textureId, int32_t width, int32_t height) override
 Resizes a geometry buffer color RGBA texture. More...
 
void bindTexture (int contextIdx, int32_t textureId) override
 Binds a texture with given id or unbinds when using ID_NONE. More...
 
void bindCubeMapTexture (int contextIdx, int32_t textureId) override
 Binds a cube map texture with given id or unbinds when using ID_NONE. More...
 
void disposeTexture (int32_t textureId) override
 Dispose a texture. More...
 
int32_t createFramebufferObject (int32_t depthBufferTextureId, int32_t colorBufferTextureId, int32_t cubeMapTextureId=0, int32_t cubeMapTextureIndex=0) override
 Creates a frame buffer object with depth texture attached. More...
 
int32_t createGeometryBufferObject (int32_t depthBufferTextureId, int32_t geometryBufferTextureId1, int32_t geometryBufferTextureId2, int32_t geometryBufferTextureId3, int32_t colorBufferTextureId1, int32_t colorBufferTextureId2, int32_t colorBufferTextureId3, int32_t colorBufferTextureId4, int32_t colorBufferTextureId5) override
 Creates a geometry frame buffer object. More...
 
void bindFrameBuffer (int32_t frameBufferId) override
 Enables a framebuffer to be rendered. More...
 
void disposeFrameBufferObject (int32_t frameBufferId) override
 Disposes a frame buffer object. More...
 
vector< int32_t > createBufferObjects (int32_t buffers, bool useGPUMemory, bool shared) override
 Generate buffer objects for vertex data and such. More...
 
void uploadBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, FloatBuffer *data) override
 Uploads buffer data to buffer object. More...
 
void uploadBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, ShortBuffer *data) override
 Uploads buffer data to buffer object. More...
 
void uploadBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, IntBuffer *data) override
 Uploads buffer data to buffer object. More...
 
void uploadIndicesBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, ShortBuffer *data) override
 Uploads buffer data to buffer object. More...
 
void uploadIndicesBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, IntBuffer *data) override
 Uploads buffer data to buffer object. More...
 
void bindIndicesBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind indices buffer object. More...
 
void bindTextureCoordinatesBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind texture coordinates buffer object. More...
 
void bindVerticesBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind vertices buffer object. More...
 
void bindNormalsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind normals buffer object. More...
 
void bindColorsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind colors buffer object. More...
 
void bindTangentsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind tangents buffer object. More...
 
void bindBitangentsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind bitangents buffer object. More...
 
void bindModelMatricesBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind model matrices buffer object. More...
 
void bindEffectColorMulsBufferObject (int contextIdx, int32_t bufferObjectId, int32_t divisor) override
 Bind effect color muls buffer object. More...
 
void bindEffectColorAddsBufferObject (int contextIdx, int32_t bufferObjectId, int32_t divisor) override
 Bind effect color adds buffer object. More...
 
void bindOriginsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind origins buffer object. More...
 
void bindTextureSpriteIndicesBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind texture and sprite indices buffer object. More...
 
void bindPointSizesBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind point sizes buffer object. More...
 
void bindSpriteSheetDimensionBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind sprite sheet dimension buffer object. More...
 
void drawInstancedIndexedTrianglesFromBufferObjects (int contextIdx, int32_t triangles, int32_t trianglesOffset, int32_t instances) override
 Draw instanced indexed triangles from buffer objects. More...
 
void drawIndexedTrianglesFromBufferObjects (int contextIdx, int32_t triangles, int32_t trianglesOffset) override
 Draw indexed triangles from buffer objects. More...
 
void drawInstancedTrianglesFromBufferObjects (int contextIdx, int32_t triangles, int32_t trianglesOffset, int32_t instances) override
 Draw instanced triangles from buffer objects. More...
 
void drawTrianglesFromBufferObjects (int contextIdx, int32_t triangles, int32_t trianglesOffset) override
 Draw triangles from buffer objects. More...
 
void drawPointsFromBufferObjects (int contextIdx, int32_t points, int32_t pointsOffset) override
 Draw points from buffer objects. More...
 
void setLineWidth (float lineWidth) override
 Set line width. More...
 
void drawLinesFromBufferObjects (int contextIdx, int32_t points, int32_t pointsOffset) override
 Draw lines from buffer objects. More...
 
void unbindBufferObjects (int contextIdx) override
 Unbind buffer objects. More...
 
void disposeBufferObjects (vector< int32_t > &bufferObjectIds) override
 Disposes a frame buffer object. More...
 
int32_t getTextureUnit (int contextIdx) override
 Get texture unit. More...
 
void setTextureUnit (int contextIdx, int32_t textureUnit) override
 Sets up texture unit. More...
 
float readPixelDepth (int32_t x, int32_t y) override
 Reads a pixel depth. More...
 
ByteBufferreadPixels (int32_t x, int32_t y, int32_t width, int32_t height) override
 Read pixels. More...
 
void initGuiMode () override
 Set up renderer for GUI rendering. More...
 
void doneGuiMode () override
 Set up renderer for 3d rendering. More...
 
void dispatchCompute (int contextIdx, int32_t numGroupsX, int32_t numGroupsY, int32_t numGroupsZ) override
 Dispatch compute. More...
 
void memoryBarrier () override
 Memory barrier. More...
 
void uploadSkinningBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, FloatBuffer *data) override
 Upload skinning buffer object. More...
 
void uploadSkinningBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, IntBuffer *data) override
 Upload skinning buffer object. More...
 
void bindSkinningVerticesBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind skinning vertices buffer object. More...
 
void bindSkinningNormalsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind skinning normal buffer object. More...
 
void bindSkinningVertexJointsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind skinning vertex joints buffer object. More...
 
void bindSkinningVertexJointIdxsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind skinning vertex joint indices buffer object. More...
 
void bindSkinningVertexJointWeightsBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind skinning vertex joint weights buffer object. More...
 
void bindSkinningVerticesResultBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind skinning vertices result buffer object. More...
 
void bindSkinningNormalsResultBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind skinning normals result buffer object. More...
 
void bindSkinningMatricesBufferObject (int contextIdx, int32_t bufferObjectId) override
 Bind skinning matrices result buffer object. More...
 
void setVSync (bool vSync) override
 Enable/Disable v-sync. More...
 
const Renderer_Statistics getStatistics () override
 
- Public Member Functions inherited from Renderer
 Renderer ()
 Public constructor. More...
 
virtual ~Renderer ()
 Destructor. More...
 
RendererType getRendererType ()
 
virtual bool prepareWindowSystemRendererContext (int tryIdx)=0
 Prepare window system renderer context. More...
 
virtual bool initializeWindowSystemRendererContext (GLFWwindow *glfwWindow)=0
 Initialize window system renderer context. More...
 
virtual void initialize ()=0
 Initialize renderer. More...
 
virtual void initializeFrame ()=0
 Pre Frame Initialization. More...
 
virtual void finishFrame ()=0
 Finish frame. More...
 
virtual const string getVendor ()=0
 
virtual const string getRenderer ()=0
 
virtual const string getShaderVersion ()=0
 
virtual bool isSupportingMultithreadedRendering ()=0
 
virtual bool isBufferObjectsAvailable ()=0
 Checks if buffer objects is available. More...
 
virtual bool isDepthTextureAvailable ()=0
 Checks if depth texture is available. More...
 
virtual bool isUsingProgramAttributeLocation ()=0
 
virtual bool isSupportingIntegerProgramAttributes ()=0
 
virtual bool isSpecularMappingAvailable ()=0
 
virtual bool isNormalMappingAvailable ()=0
 
virtual bool isInstancedRenderingAvailable ()=0
 Checks if instanced rendering is available. More...
 
virtual bool isPBRAvailable ()=0
 
virtual bool isComputeShaderAvailable ()=0
 
virtual bool isGLCLAvailable ()=0
 
virtual bool isUsingShortIndices ()=0
 
virtual bool isDeferredShadingAvailable ()=0
 
virtual int32_t getTextureUnits ()=0
 
int32_t getViewPortWidth ()
 
int32_t getViewPortHeight ()
 
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. More...
 
virtual void useProgram (int contextIdx, int32_t programId)=0
 Use shader program. More...
 
virtual int32_t createProgram (int type)=0
 Creates a shader program. More...
 
virtual void attachShaderToProgram (int32_t programId, int32_t shaderId)=0
 Attaches a shader to a program. More...
 
virtual bool linkProgram (int32_t programId)=0
 Links attached shaders to a program. More...
 
virtual int32_t getProgramUniformLocation (int32_t programId, const string &name)=0
 Returns location of given uniform variable. More...
 
virtual void setProgramUniformInteger (int contextIdx, int32_t uniformId, int32_t value)=0
 Set up a integer uniform value. More...
 
virtual void setProgramUniformFloat (int contextIdx, int32_t uniformId, float value)=0
 Set up a float uniform value. More...
 
virtual void setProgramUniformFloatMatrix3x3 (int contextIdx, int32_t uniformId, const array< float, 9 > &value)=0
 Set up a float matrix 3x3 uniform value. More...
 
virtual void setProgramUniformFloatMatrix4x4 (int contextIdx, int32_t uniformId, const array< float, 16 > &value)=0
 Set up a float matrix 4x4 uniform value. More...
 
virtual void setProgramUniformFloatMatrices4x4 (int contextIdx, int32_t uniformId, int32_t count, FloatBuffer *data)=0
 Set up a float matrices 4x4 uniform values. More...
 
virtual void setProgramUniformFloatVec4 (int contextIdx, int32_t uniformId, const array< float, 4 > &data)=0
 Set up a float vec4 uniform value. More...
 
virtual void setProgramUniformFloatVec3 (int contextIdx, int32_t uniformId, const array< float, 3 > &data)=0
 Set up a float vec3 uniform value. More...
 
virtual void setProgramUniformFloatVec2 (int contextIdx, int32_t uniformId, const array< float, 2 > &data)=0
 Set up a float vec2 uniform value. More...
 
virtual void setProgramAttributeLocation (int32_t programId, int32_t location, const string &name)=0
 Bind attribute to a input location. More...
 
int32_t getEffectPass ()
 Get effect pass. More...
 
void setEffectPass (int32_t effectPass)
 Set effect pass. More...
 
const string & getShaderPrefix ()
 Get shader prefix. More...
 
void setShaderPrefix (const string &shaderPrefix)
 Set shader prefix. More...
 
int32_t getLighting (int contextIdx)
 Get current lighting model. More...
 
void setLighting (int contextIdx, int32_t lighting)
 Set current lighting model. More...
 
Vector3getCameraPosition ()
 
virtual void setViewPort (int32_t width, int32_t height)=0
 Set up viewport parameter. More...
 
virtual void updateViewPort ()=0
 Update viewport. More...
 
Matrix4x4getProjectionMatrix ()
 
virtual void onUpdateProjectionMatrix (int contextIdx)=0
 Update projection matrix event. More...
 
Matrix4x4getCameraMatrix ()
 
virtual void onUpdateCameraMatrix (int contextIdx)=0
 Update camera matrix event. More...
 
Matrix4x4getModelViewMatrix ()
 
virtual void onUpdateModelViewMatrix (int contextIdx)=0
 Update model view matrix event. More...
 
Matrix4x4getViewportMatrix ()
 
Matrix2D3x3getTextureMatrix (int contextIdx)
 Get texture matrix. More...
 
virtual void onUpdateTextureMatrix (int contextIdx)=0
 Update texture matrix for active texture unit event. More...
 
virtual void setClearColor (float red, float green, float blue, float alpha)=0
 Set up clear color. More...
 
virtual void enableCulling (int contextIdx)=0
 Enable culling. More...
 
virtual void disableCulling (int contextIdx)=0
 Disable culling. More...
 
virtual void setFrontFace (int contextIdx, int32_t frontFace)=0
 Set up clock wise or counter clock wise faces as front face. More...
 
virtual void setCullFace (int32_t cullFace)=0
 Sets up which face will be culled. More...
 
virtual void enableBlending ()=0
 Enables blending. More...
 
virtual void enableAdditionBlending ()=0
 Enable blending with c = a + b. More...
 
virtual void disableBlending ()=0
 Disables blending. More...
 
virtual void enableDepthBufferWriting ()=0
 Enable depth buffer writing. More...
 
virtual void disableDepthBufferWriting ()=0
 Disable depth buffer writing. More...
 
virtual void disableDepthBufferTest ()=0
 Disable depth buffer test. More...
 
virtual void enableDepthBufferTest ()=0
 Enable depth buffer test. More...
 
virtual void setDepthFunction (int32_t depthFunction)=0
 Set up depth function. More...
 
virtual void setColorMask (bool red, bool green, bool blue, bool alpha)=0
 Set up GL rendering colormask. More...
 
virtual void clear (int32_t mask)=0
 Clear render buffer with given mask. More...
 
virtual int32_t createTexture ()=0
 Creates a texture. More...
 
virtual int32_t createDepthBufferTexture (int32_t width, int32_t height, int32_t cubeMapTextureId, int32_t cubeMapTextureIndex)=0
 Creates a depth buffer texture. More...
 
virtual int32_t createColorBufferTexture (int32_t width, int32_t height, int32_t cubeMapTextureId, int32_t cubeMapTextureIndex)=0
 Creates a color buffer texture. More...
 
virtual int32_t createGBufferGeometryTexture (int32_t width, int32_t height)=0
 Creates a geometry buffer geometry texture. More...
 
virtual int32_t createGBufferColorTexture (int32_t width, int32_t height)=0
 Creates a geometry buffer color RGBA texture. More...
 
virtual void uploadTexture (int contextIdx, Texture *texture)=0
 Uploads texture data to current bound texture. More...
 
virtual void uploadCubeMapTexture (int contextIdx, Texture *textureLeft, Texture *textureRight, Texture *textureTop, Texture *textureBottom, Texture *textureFront, Texture *textureBack)=0
 Uploads cube map texture data to current bound texture. More...
 
virtual int32_t createCubeMapTexture (int contextIdx, int32_t width, int32_t height)=0
 Create cube map texture from frame buffers. More...
 
virtual void resizeDepthBufferTexture (int32_t textureId, int32_t width, int32_t height)=0
 Resizes a depth texture. More...
 
virtual void resizeColorBufferTexture (int32_t textureId, int32_t width, int32_t height)=0
 Resize color buffer texture. More...
 
virtual void resizeGBufferGeometryTexture (int32_t textureId, int32_t width, int32_t height)=0
 Resizes a geometry buffer geometry texture. More...
 
virtual void resizeGBufferColorTexture (int32_t textureId, int32_t width, int32_t height)=0
 Resizes a geometry buffer color RGBA texture. More...
 
virtual void bindTexture (int contextIdx, int32_t textureId)=0
 Binds a texture with given id or unbinds when using ID_NONE. More...
 
virtual void bindCubeMapTexture (int contextIdx, int32_t textureId)=0
 Binds a cube map texture with given id or unbinds when using ID_NONE. More...
 
virtual void onBindTexture (int contextIdx, int32_t textureId)=0
 On bind texture event. More...
 
virtual void disposeTexture (int32_t textureId)=0
 Dispose a texture. More...
 
virtual int32_t createFramebufferObject (int32_t depthBufferTextureId, int32_t colorBufferTextureId, int32_t cubeMapTextureId=0, int32_t cubeMapTextureIndex=0)=0
 Creates a frame buffer object with depth texture attached. More...
 
virtual int32_t createGeometryBufferObject (int32_t depthBufferTextureId, int32_t geometryBufferTextureId1, int32_t geometryBufferTextureId2, int32_t geometryBufferTextureId3, int32_t colorBufferTextureId1, int32_t colorBufferTextureId2, int32_t colorBufferTextureId3, int32_t colorBufferTextureId4, int32_t colorBufferTextureId5)=0
 Creates a geometry frame buffer object. More...
 
virtual void bindFrameBuffer (int32_t frameBufferId)=0
 Enables a framebuffer to be rendered. More...
 
virtual void disposeFrameBufferObject (int32_t frameBufferId)=0
 Disposes a frame buffer object. More...
 
virtual vector< int32_t > createBufferObjects (int32_t buffers, bool useGPUMemory, bool shared)=0
 Generate buffer objects for vertex data and such. More...
 
virtual void uploadBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, FloatBuffer *data)=0
 Uploads buffer data to buffer object. More...
 
virtual void uploadBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, IntBuffer *data)=0
 Uploads buffer data to buffer object. More...
 
virtual void uploadBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, ShortBuffer *data)=0
 Uploads buffer data to buffer object. More...
 
virtual void uploadIndicesBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, ShortBuffer *data)=0
 Uploads buffer data to buffer object. More...
 
virtual void uploadIndicesBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, IntBuffer *data)=0
 Uploads buffer data to buffer object. More...
 
virtual void bindIndicesBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind indices buffer object. More...
 
virtual void bindTextureCoordinatesBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind texture coordinates buffer object. More...
 
virtual void bindVerticesBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind vertices buffer object. More...
 
virtual void bindNormalsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind normals buffer object. More...
 
virtual void bindColorsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind colors buffer object. More...
 
virtual void bindTangentsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind tangents buffer object. More...
 
virtual void bindBitangentsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind bitangents buffer object. More...
 
virtual void bindModelMatricesBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind model matrices buffer object. More...
 
virtual void bindEffectColorMulsBufferObject (int contextIdx, int32_t bufferObjectId, int32_t divisor)=0
 Bind effect color muls buffer object. More...
 
virtual void bindEffectColorAddsBufferObject (int contextIdx, int32_t bufferObjectId, int32_t divisor)=0
 Bind effect color adds buffer object. More...
 
virtual void bindOriginsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind origins buffer object. More...
 
virtual void bindTextureSpriteIndicesBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind texture and sprite indices buffer object. More...
 
virtual void bindPointSizesBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind point sizes buffer object. More...
 
virtual void bindSpriteSheetDimensionBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind sprite sheet dimension buffer object. More...
 
virtual void drawInstancedIndexedTrianglesFromBufferObjects (int contextIdx, int32_t triangles, int32_t trianglesOffset, int32_t instances)=0
 Draw instanced indexed triangles from buffer objects. More...
 
virtual void drawIndexedTrianglesFromBufferObjects (int contextIdx, int32_t triangles, int32_t trianglesOffset)=0
 Draw indexed triangles from buffer objects. More...
 
virtual void drawInstancedTrianglesFromBufferObjects (int contextIdx, int32_t triangles, int32_t trianglesOffset, int32_t instances)=0
 Draw instanced triangles from buffer objects. More...
 
virtual void drawTrianglesFromBufferObjects (int contextIdx, int32_t triangles, int32_t trianglesOffset)=0
 Draw triangles from buffer objects. More...
 
virtual void drawPointsFromBufferObjects (int contextIdx, int32_t points, int32_t pointsOffset)=0
 Draw points from buffer objects. More...
 
virtual void setLineWidth (float lineWidth)=0
 Set line width. More...
 
virtual void drawLinesFromBufferObjects (int contextIdx, int32_t points, int32_t pointsOffset)=0
 Draw lines from buffer objects. More...
 
virtual void unbindBufferObjects (int contextIdx)=0
 Unbind buffer objects. More...
 
virtual void disposeBufferObjects (vector< int32_t > &bufferObjectIds)=0
 Disposes a frame buffer object. More...
 
virtual int32_t getTextureUnit (int contextIdx)=0
 Get texture unit. More...
 
virtual void setTextureUnit (int contextIdx, int32_t textureUnit)=0
 Sets up texture unit. More...
 
Renderer_LightgetLight (int contextIdx, int32_t lightIdx)
 Get light. More...
 
virtual void onUpdateLight (int contextIdx, int32_t lightId)=0
 Update light. More...
 
array< float, 4 > & getEffectColorMul (int contextIdx)
 Get effect color mul. More...
 
array< float, 4 > & getEffectColorAdd (int contextIdx)
 Get effect color add. More...
 
virtual void onUpdateEffect (int contextIdx)=0
 Update material. More...
 
Renderer_SpecularMaterialgetSpecularMaterial (int contextIdx)
 Get specular material. More...
 
Renderer_PBRMaterialgetPBRMaterial (int contextIdx)
 Get PBR material. More...
 
virtual void onUpdateMaterial (int contextIdx)=0
 On update material. More...
 
const string & getShader (int contextIdx)
 Get shader. More...
 
void setShader (int contextIdx, const string &id)
 Set shader. More...
 
virtual void onUpdateShader (int contextIdx)=0
 On update shader. More...
 
const EntityShaderParametersgetShaderParameters (int contextIdx)
 Get shader parameters. More...
 
void setShaderParameters (int contextIdx, const EntityShaderParameters &parameters)
 Set shader parameters. More...
 
virtual void onUpdateShaderParameters (int contextIdx)=0
 On update shader parameters. More...
 
virtual float readPixelDepth (int32_t x, int32_t y)=0
 Reads a pixel depth. More...
 
virtual ByteBufferreadPixels (int32_t x, int32_t y, int32_t width, int32_t height)=0
 Read pixels. More...
 
virtual void dispatchCompute (int contextIdx, int32_t numGroupsX, int32_t numGroupsY, int32_t numGroupsZ)=0
 Dispatch compute. More...
 
virtual void memoryBarrier ()=0
 Memory barrier. More...
 
virtual void uploadSkinningBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, FloatBuffer *data)=0
 Upload skinning buffer object. More...
 
virtual void uploadSkinningBufferObject (int contextIdx, int32_t bufferObjectId, int32_t size, IntBuffer *data)=0
 Upload skinning buffer object. More...
 
virtual void bindSkinningVerticesBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind skinning vertices buffer object. More...
 
virtual void bindSkinningNormalsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind skinning normal buffer object. More...
 
virtual void bindSkinningVertexJointsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind skinning vertex joints buffer object. More...
 
virtual void bindSkinningVertexJointIdxsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind skinning vertex joint indices buffer object. More...
 
virtual void bindSkinningVertexJointWeightsBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind skinning vertex joint weights buffer object. More...
 
virtual void bindSkinningVerticesResultBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind skinning vertices result buffer object. More...
 
virtual void bindSkinningNormalsResultBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind skinning normals result buffer object. More...
 
virtual void bindSkinningMatricesBufferObject (int contextIdx, int32_t bufferObjectId)=0
 Bind skinning matrices result buffer object. More...
 
float getMaskMaxValue (int contextIdx)
 Get mask max value. More...
 
void setMaskMaxValue (int contextIdx, float maskMaxValue)
 Set mask max value. More...
 
array< float, 3 > & getEnvironmentMappingCubeMapPosition (int contextIdx)
 Get environment mapping cube map position. More...
 
void setEnvironmentMappingCubeMapPosition (int contextIdx, array< float, 3 > &position)
 Set environment mapping cube map position. More...
 
virtual void initGuiMode ()=0
 Set up renderer for GUI rendering. More...
 
virtual void doneGuiMode ()=0
 Set up renderer for 3d rendering. More...
 
virtual void setVSync (bool vSync)=0
 Enable/Disable v-sync. More...
 
virtual const Renderer_Statistics getStatistics ()=0
 
TexturegenerateMipMap (const string &id, Texture *texture, int32_t level, int32_t atlasBorderSize)
 Generate mip map for atlas texture currently. More...
 

Private Member Functions

void checkGLError (int line)
 Checks if GL error did occour. More...
 

Private Attributes

uint32_t engineVAO
 
map< uint32_t, int32_t > vbosUsage
 
int activeTextureUnit
 
bool deferredShadingAvailable
 

Additional Inherited Members

- Public Types inherited from Renderer
enum  RendererType { RENDERERTYPE_NONE , RENDERERTYPE_OPENGLES , RENDERERTYPE_OPENGL , RENDERERTYPE_VULKAN }
 
- Public Attributes inherited from Renderer
RendererType rendererType { RENDERERTYPE_NONE }
 
int32_t CONTEXTINDEX_DEFAULT
 
int32_t ID_NONE
 
int32_t CLEAR_DEPTH_BUFFER_BIT
 
int32_t CLEAR_COLOR_BUFFER_BIT
 
int32_t CULLFACE_FRONT
 
int32_t CULLFACE_BACK
 
int32_t TEXTUREUNITS_MAX
 
int32_t PROGRAM_OBJECTS
 
int32_t PROGRAM_POINTS
 
int32_t PROGRAM_LINES
 
int32_t PROGRAM_COMPUTE
 
int32_t SHADER_FRAGMENT_SHADER
 
int32_t SHADER_VERTEX_SHADER
 
int32_t SHADER_COMPUTE_SHADER
 
int32_t DEPTHFUNCTION_ALWAYS
 
int32_t DEPTHFUNCTION_EQUAL
 
int32_t DEPTHFUNCTION_LESSEQUAL
 
int32_t DEPTHFUNCTION_GREATEREQUAL
 
int32_t FRAMEBUFFER_DEFAULT
 
int32_t FRONTFACE_CW
 
int32_t FRONTFACE_CCW
 
int32_t CUBEMAPTEXTUREINDEX_NEGATIVE_X
 
int32_t CUBEMAPTEXTUREINDEX_POSITIVE_X
 
int32_t CUBEMAPTEXTUREINDEX_POSITIVE_Y
 
int32_t CUBEMAPTEXTUREINDEX_NEGATIVE_Y
 
int32_t CUBEMAPTEXTUREINDEX_POSITIVE_Z
 
int32_t CUBEMAPTEXTUREINDEX_NEGATIVE_Z
 
int32_t LIGHTING_NONE
 
int32_t LIGHTING_SPECULAR
 
int32_t LIGHTING_PBR
 
int32_t UNIFORM_CL_SKINNING_VERTEX_COUNT
 
int32_t UNIFORM_CL_SKINNING_MATRIX_COUNT
 
int32_t UNIFORM_CL_SKINNING_INSTANCE_COUNT
 
- Protected Attributes inherited from Renderer
int32_t viewPortWidth
 
int32_t viewPortHeight
 
Renderer_Statistics statistics
 
Vector3 cameraPosition
 
Matrix4x4 projectionMatrix
 
Matrix4x4 cameraMatrix
 
Matrix4x4 modelViewMatrix
 
Matrix4x4 viewportMatrix
 
int32_t effectPass
 
string shaderPrefix
 
vector< Renderer_ContextrendererContexts
 

Detailed Description

OpenGL 3 renderer.

Author
Andreas Drewke
Version
$Id$

Definition at line 36 of file GL3Renderer.h.

Constructor & Destructor Documentation

◆ GL3Renderer()

Public constructor.

Definition at line 64 of file GL3Renderer.cpp.

Member Function Documentation

◆ attachShaderToProgram()

void attachShaderToProgram ( int32_t  programId,
int32_t  shaderId 
)
overridevirtual

Attaches a shader to a program.

Parameters
programIdprogram id
shaderIdshader id

Implements Renderer.

Definition at line 353 of file GL3Renderer.cpp.

◆ bindBitangentsBufferObject()

void bindBitangentsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind bitangents buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1047 of file GL3Renderer.cpp.

◆ bindColorsBufferObject()

void bindColorsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind colors buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1033 of file GL3Renderer.cpp.

◆ bindCubeMapTexture()

void bindCubeMapTexture ( int  contextIdx,
int32_t  textureId 
)
overridevirtual

Binds a cube map texture with given id or unbinds when using ID_NONE.

Parameters
contextIdxcontext index
textureIdtextureId

Implements Renderer.

Definition at line 842 of file GL3Renderer.cpp.

◆ bindEffectColorAddsBufferObject()

void bindEffectColorAddsBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  divisor 
)
overridevirtual

Bind effect color adds buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
divisordivisor

Implements Renderer.

Definition at line 1077 of file GL3Renderer.cpp.

◆ bindEffectColorMulsBufferObject()

void bindEffectColorMulsBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  divisor 
)
overridevirtual

Bind effect color muls buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
divisordivisor

Implements Renderer.

Definition at line 1070 of file GL3Renderer.cpp.

◆ bindFrameBuffer()

void bindFrameBuffer ( int32_t  frameBufferId)
overridevirtual

Enables a framebuffer to be rendered.

Parameters
frameBufferIdframeBufferId

Implements Renderer.

Definition at line 951 of file GL3Renderer.cpp.

◆ bindIndicesBufferObject()

void bindIndicesBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind indices buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1007 of file GL3Renderer.cpp.

◆ bindModelMatricesBufferObject()

void bindModelMatricesBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind model matrices buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1054 of file GL3Renderer.cpp.

◆ bindNormalsBufferObject()

void bindNormalsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind normals buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1026 of file GL3Renderer.cpp.

◆ bindOriginsBufferObject()

void bindOriginsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind origins buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1084 of file GL3Renderer.cpp.

◆ bindPointSizesBufferObject()

void bindPointSizesBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind point sizes buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1096 of file GL3Renderer.cpp.

◆ bindSkinningMatricesBufferObject()

void bindSkinningMatricesBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind skinning matrices result buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1370 of file GL3Renderer.cpp.

◆ bindSkinningNormalsBufferObject()

void bindSkinningNormalsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind skinning normal buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1322 of file GL3Renderer.cpp.

◆ bindSkinningNormalsResultBufferObject()

void bindSkinningNormalsResultBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind skinning normals result buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1362 of file GL3Renderer.cpp.

◆ bindSkinningVertexJointIdxsBufferObject()

void bindSkinningVertexJointIdxsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind skinning vertex joint indices buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1338 of file GL3Renderer.cpp.

◆ bindSkinningVertexJointsBufferObject()

void bindSkinningVertexJointsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind skinning vertex joints buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1330 of file GL3Renderer.cpp.

◆ bindSkinningVertexJointWeightsBufferObject()

void bindSkinningVertexJointWeightsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind skinning vertex joint weights buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1346 of file GL3Renderer.cpp.

◆ bindSkinningVerticesBufferObject()

void bindSkinningVerticesBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind skinning vertices buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1314 of file GL3Renderer.cpp.

◆ bindSkinningVerticesResultBufferObject()

void bindSkinningVerticesResultBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind skinning vertices result buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1354 of file GL3Renderer.cpp.

◆ bindSpriteSheetDimensionBufferObject()

void bindSpriteSheetDimensionBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind sprite sheet dimension buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1102 of file GL3Renderer.cpp.

◆ bindTangentsBufferObject()

void bindTangentsBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind tangents buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1040 of file GL3Renderer.cpp.

◆ bindTexture()

void bindTexture ( int  contextIdx,
int32_t  textureId 
)
overridevirtual

Binds a texture with given id or unbinds when using ID_NONE.

Parameters
contextIdxcontext index
textureIdtextureId

Implements Renderer.

Definition at line 836 of file GL3Renderer.cpp.

◆ bindTextureCoordinatesBufferObject()

void bindTextureCoordinatesBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind texture coordinates buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1012 of file GL3Renderer.cpp.

◆ bindTextureSpriteIndicesBufferObject()

void bindTextureSpriteIndicesBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind texture and sprite indices buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1090 of file GL3Renderer.cpp.

◆ bindVerticesBufferObject()

void bindVerticesBufferObject ( int  contextIdx,
int32_t  bufferObjectId 
)
overridevirtual

Bind vertices buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id

Implements Renderer.

Definition at line 1019 of file GL3Renderer.cpp.

◆ checkGLError()

void checkGLError ( int  line)
private

Checks if GL error did occour.

Definition at line 1234 of file GL3Renderer.cpp.

◆ clear()

void clear ( int32_t  mask)
overridevirtual

Clear render buffer with given mask.

Parameters
maskmask

Implements Renderer.

Definition at line 536 of file GL3Renderer.cpp.

◆ createBufferObjects()

vector< int32_t > createBufferObjects ( int32_t  buffers,
bool  useGPUMemory,
bool  shared 
)
overridevirtual

Generate buffer objects for vertex data and such.

Parameters
buffersbuffers
useGPUMemoryuse GPU memory
sharedshared between different threads
Returns
ids

Implements Renderer.

Definition at line 961 of file GL3Renderer.cpp.

◆ createColorBufferTexture()

int32_t createColorBufferTexture ( int32_t  width,
int32_t  height,
int32_t  cubeMapTextureId,
int32_t  cubeMapTextureIndex 
)
overridevirtual

Creates a color buffer texture.

Parameters
widthwidth
heightheight @oaram cubeMapTextureId cube map texture id
cubeMapTextureIndexcube map texture index
Returns
color buffer texture id

Implements Renderer.

Definition at line 568 of file GL3Renderer.cpp.

◆ createCubeMapTexture()

int32_t createCubeMapTexture ( int  contextIdx,
int32_t  width,
int32_t  height 
)
overridevirtual

Create cube map texture from frame buffers.

Parameters
contextIdxcontext index
widthwidth
heightheight
Returns
texture id

Implements Renderer.

Definition at line 730 of file GL3Renderer.cpp.

◆ createDepthBufferTexture()

int32_t createDepthBufferTexture ( int32_t  width,
int32_t  height,
int32_t  cubeMapTextureId,
int32_t  cubeMapTextureIndex 
)
overridevirtual

Creates a depth buffer texture.

Parameters
widthwidth
heightheight @oaram cubeMapTextureId cube map texture id
cubeMapTextureIndexcube map texture index
Returns
depth texture id

Implements Renderer.

Definition at line 550 of file GL3Renderer.cpp.

◆ createFramebufferObject()

int32_t createFramebufferObject ( int32_t  depthBufferTextureId,
int32_t  colorBufferTextureId,
int32_t  cubeMapTextureId = 0,
int32_t  cubeMapTextureIndex = 0 
)
overridevirtual

Creates a frame buffer object with depth texture attached.

Parameters
depthBufferTextureIddepth buffer texture id
colorBufferTextureIdcolor buffer texture id
cubeMapTextureIdcube map texture id
cubeMapTextureIndexcube map texture index
Returns
frame buffer object id

Implements Renderer.

Definition at line 853 of file GL3Renderer.cpp.

◆ createGBufferColorTexture()

int32_t createGBufferColorTexture ( int32_t  width,
int32_t  height 
)
overridevirtual

Creates a geometry buffer color RGBA texture.

Parameters
widthwidth
heightheight
Returns
geometry buffer color RGBA texture id

Implements Renderer.

Definition at line 597 of file GL3Renderer.cpp.

◆ createGBufferGeometryTexture()

int32_t createGBufferGeometryTexture ( int32_t  width,
int32_t  height 
)
overridevirtual

Creates a geometry buffer geometry texture.

Parameters
widthwidth
heightheight
Returns
geometry buffer geometry texture id

Implements Renderer.

Definition at line 586 of file GL3Renderer.cpp.

◆ createGeometryBufferObject()

int32_t createGeometryBufferObject ( int32_t  depthBufferTextureId,
int32_t  geometryBufferTextureId1,
int32_t  geometryBufferTextureId2,
int32_t  geometryBufferTextureId3,
int32_t  colorBufferTextureId1,
int32_t  colorBufferTextureId2,
int32_t  colorBufferTextureId3,
int32_t  colorBufferTextureId4,
int32_t  colorBufferTextureId5 
)
overridevirtual

Creates a geometry frame buffer object.

Parameters
depthBufferTextureIddepth buffer texture id
geometryBufferTextureId1geometry texture id 1
geometryBufferTextureId2geometry texture id 2
geometryBufferTextureId3geometry texture id 3
colorBufferTextureId1color buffer texture id 1
colorBufferTextureId2color buffer texture id 2
colorBufferTextureId3color buffer texture id 3
colorBufferTextureId4color buffer texture id 4
colorBufferTextureId5color buffer texture id 5
Returns
frame buffer object id

Implements Renderer.

Definition at line 885 of file GL3Renderer.cpp.

◆ createProgram()

int32_t createProgram ( int  type)
overridevirtual

Creates a shader program.

Parameters
typetype
Returns
int

Implements Renderer.

Definition at line 347 of file GL3Renderer.cpp.

◆ createTexture()

int32_t createTexture ( )
overridevirtual

Creates a texture.

Returns
texture id

Implements Renderer.

Definition at line 542 of file GL3Renderer.cpp.

◆ disableBlending()

void disableBlending ( )
overridevirtual

Disables blending.

Implements Renderer.

Definition at line 500 of file GL3Renderer.cpp.

◆ disableCulling()

void disableCulling ( int  contextIdx)
overridevirtual

Disable culling.

Parameters
contextIdxcontext index

Implements Renderer.

Definition at line 474 of file GL3Renderer.cpp.

◆ disableDepthBufferTest()

void disableDepthBufferTest ( )
overridevirtual

Disable depth buffer test.

Implements Renderer.

Definition at line 515 of file GL3Renderer.cpp.

◆ disableDepthBufferWriting()

void disableDepthBufferWriting ( )
overridevirtual

Disable depth buffer writing.

Implements Renderer.

Definition at line 510 of file GL3Renderer.cpp.

◆ dispatchCompute()

void dispatchCompute ( int  contextIdx,
int32_t  numGroupsX,
int32_t  numGroupsY,
int32_t  numGroupsZ 
)
overridevirtual

Dispatch compute.

Parameters
contextIdxcontext index
numGroupsXnum groups x
numGroupsYnum groups y
numGroupsZnum groups z

Implements Renderer.

Definition at line 1242 of file GL3Renderer.cpp.

◆ disposeBufferObjects()

void disposeBufferObjects ( vector< int32_t > &  bufferObjectIds)
overridevirtual

Disposes a frame buffer object.

Parameters
bufferObjectIdsframe buffer id

Implements Renderer.

Definition at line 1180 of file GL3Renderer.cpp.

◆ disposeFrameBufferObject()

void disposeFrameBufferObject ( int32_t  frameBufferId)
overridevirtual

Disposes a frame buffer object.

Parameters
frameBufferIdframe buffer id

Implements Renderer.

Definition at line 956 of file GL3Renderer.cpp.

◆ disposeTexture()

void disposeTexture ( int32_t  textureId)
overridevirtual

Dispose a texture.

Parameters
textureIdtexture id

Implements Renderer.

Definition at line 847 of file GL3Renderer.cpp.

◆ doneGuiMode()

void doneGuiMode ( )
overridevirtual

Set up renderer for 3d rendering.

Implements Renderer.

Definition at line 1225 of file GL3Renderer.cpp.

◆ drawIndexedTrianglesFromBufferObjects()

void drawIndexedTrianglesFromBufferObjects ( int  contextIdx,
int32_t  triangles,
int32_t  trianglesOffset 
)
overridevirtual

Draw indexed triangles from buffer objects.

Parameters
contextIdxcontext index
trianglestriangles
trianglesOffsettriangles offset

Implements Renderer.

Definition at line 1118 of file GL3Renderer.cpp.

◆ drawInstancedIndexedTrianglesFromBufferObjects()

void drawInstancedIndexedTrianglesFromBufferObjects ( int  contextIdx,
int32_t  triangles,
int32_t  trianglesOffset,
int32_t  instances 
)
overridevirtual

Draw instanced indexed triangles from buffer objects.

Parameters
contextIdxcontext index
trianglestriangles
trianglesOffsettriangles offset
instancesinstances

Implements Renderer.

Definition at line 1109 of file GL3Renderer.cpp.

◆ drawInstancedTrianglesFromBufferObjects()

void drawInstancedTrianglesFromBufferObjects ( int  contextIdx,
int32_t  triangles,
int32_t  trianglesOffset,
int32_t  instances 
)
overridevirtual

Draw instanced triangles from buffer objects.

Parameters
contextIdxcontext index
trianglestriangles
trianglesOffsettriangles offset
instancesinstances

Implements Renderer.

Definition at line 1127 of file GL3Renderer.cpp.

◆ drawLinesFromBufferObjects()

void drawLinesFromBufferObjects ( int  contextIdx,
int32_t  points,
int32_t  pointsOffset 
)
overridevirtual

Draw lines from buffer objects.

Parameters
contextIdxcontext index
pointspoints
pointsOffsetpoints offset

Implements Renderer.

Definition at line 1154 of file GL3Renderer.cpp.

◆ drawPointsFromBufferObjects()

void drawPointsFromBufferObjects ( int  contextIdx,
int32_t  points,
int32_t  pointsOffset 
)
overridevirtual

Draw points from buffer objects.

Parameters
contextIdxcontext index
pointspoints
pointsOffsetpoints offset

Implements Renderer.

Definition at line 1142 of file GL3Renderer.cpp.

◆ drawTrianglesFromBufferObjects()

void drawTrianglesFromBufferObjects ( int  contextIdx,
int32_t  triangles,
int32_t  trianglesOffset 
)
overridevirtual

Draw triangles from buffer objects.

Parameters
contextIdxcontext index
trianglestriangles
trianglesOffsettriangles offset

Implements Renderer.

Definition at line 1134 of file GL3Renderer.cpp.

◆ enableAdditionBlending()

void enableAdditionBlending ( )
overridevirtual

Enable blending with c = a + b.

Implements Renderer.

Definition at line 495 of file GL3Renderer.cpp.

◆ enableBlending()

void enableBlending ( )
overridevirtual

Enables blending.

Implements Renderer.

Definition at line 489 of file GL3Renderer.cpp.

◆ enableCulling()

void enableCulling ( int  contextIdx)
overridevirtual

Enable culling.

Parameters
contextIdxcontext index

Implements Renderer.

Definition at line 469 of file GL3Renderer.cpp.

◆ enableDepthBufferTest()

void enableDepthBufferTest ( )
overridevirtual

Enable depth buffer test.

Implements Renderer.

Definition at line 520 of file GL3Renderer.cpp.

◆ enableDepthBufferWriting()

void enableDepthBufferWriting ( )
overridevirtual

Enable depth buffer writing.

Implements Renderer.

Definition at line 505 of file GL3Renderer.cpp.

◆ finishFrame()

void finishFrame ( )
overridevirtual

Finish frame.

Implements Renderer.

Definition at line 205 of file GL3Renderer.cpp.

◆ getProgramUniformLocation()

int32_t getProgramUniformLocation ( int32_t  programId,
const string &  name 
)
overridevirtual

Returns location of given uniform variable.

Parameters
programIdprogram id
nameuniform name
Returns

Implements Renderer.

Definition at line 388 of file GL3Renderer.cpp.

◆ getRenderer()

const string getRenderer ( )
overridevirtual
Returns
renderer

Implements Renderer.

Definition at line 105 of file GL3Renderer.cpp.

◆ getShaderVersion()

const string getShaderVersion ( )
overridevirtual
Returns
shader version e.g. gl2, gl3 or gles2

Implements Renderer.

Definition at line 110 of file GL3Renderer.cpp.

◆ getStatistics()

const Renderer::Renderer_Statistics getStatistics ( )
overridevirtual
Returns
renderer statistics

Implements Renderer.

Definition at line 1382 of file GL3Renderer.cpp.

◆ getTextureUnit()

int32_t getTextureUnit ( int  contextIdx)
overridevirtual

Get texture unit.

Parameters
contextIdxcontext index
Returns
active texture unit

Implements Renderer.

Definition at line 1187 of file GL3Renderer.cpp.

◆ getTextureUnits()

int32_t getTextureUnits ( )
overridevirtual
Returns
number of texture units

Implements Renderer.

Definition at line 276 of file GL3Renderer.cpp.

◆ getVendor()

const string getVendor ( )
overridevirtual
Returns
vendor

Implements Renderer.

Definition at line 100 of file GL3Renderer.cpp.

◆ initGuiMode()

void initGuiMode ( )
overridevirtual

Set up renderer for GUI rendering.

Implements Renderer.

Definition at line 1213 of file GL3Renderer.cpp.

◆ initialize()

void initialize ( )
overridevirtual

Initialize renderer.

Implements Renderer.

Definition at line 125 of file GL3Renderer.cpp.

◆ initializeFrame()

void initializeFrame ( )
overridevirtual

Pre Frame Initialization.

Implements Renderer.

Definition at line 201 of file GL3Renderer.cpp.

◆ isBufferObjectsAvailable()

bool isBufferObjectsAvailable ( )
overridevirtual

Checks if buffer objects is available.

Returns
buffer objects availability

Implements Renderer.

Definition at line 209 of file GL3Renderer.cpp.

◆ isComputeShaderAvailable()

bool isComputeShaderAvailable ( )
overridevirtual
Returns
if compute shaders are available

Implements Renderer.

Definition at line 247 of file GL3Renderer.cpp.

◆ isDeferredShadingAvailable()

bool isDeferredShadingAvailable ( )
overridevirtual
Returns
If deferred shading is available

Implements Renderer.

Definition at line 272 of file GL3Renderer.cpp.

◆ isDepthTextureAvailable()

bool isDepthTextureAvailable ( )
overridevirtual

Checks if depth texture is available.

Returns
depth texture is available

Implements Renderer.

Definition at line 214 of file GL3Renderer.cpp.

◆ isGLCLAvailable()

bool isGLCLAvailable ( )
overridevirtual
Returns
if OpenGL+CL is available

Implements Renderer.

Definition at line 260 of file GL3Renderer.cpp.

◆ isInstancedRenderingAvailable()

bool isInstancedRenderingAvailable ( )
overridevirtual

Checks if instanced rendering is available.

Returns
instance rendering availability

Implements Renderer.

Definition at line 238 of file GL3Renderer.cpp.

◆ isNormalMappingAvailable()

bool isNormalMappingAvailable ( )
overridevirtual
Returns
if normal mapping is supported

Implements Renderer.

Definition at line 233 of file GL3Renderer.cpp.

◆ isPBRAvailable()

bool isPBRAvailable ( )
overridevirtual
Returns
if PBR lighting is supported

Implements Renderer.

Definition at line 242 of file GL3Renderer.cpp.

◆ isSpecularMappingAvailable()

bool isSpecularMappingAvailable ( )
overridevirtual
Returns
if specular mapping is supported

Implements Renderer.

Definition at line 228 of file GL3Renderer.cpp.

◆ isSupportingIntegerProgramAttributes()

bool isSupportingIntegerProgramAttributes ( )
overridevirtual
Returns
is supporting integer program attributes

Implements Renderer.

Definition at line 224 of file GL3Renderer.cpp.

◆ isSupportingMultithreadedRendering()

bool isSupportingMultithreadedRendering ( )
overridevirtual
Returns
if renderer is supporting multi threaded rendering

Implements Renderer.

Definition at line 115 of file GL3Renderer.cpp.

◆ isUsingProgramAttributeLocation()

bool isUsingProgramAttributeLocation ( )
overridevirtual
Returns
requires program attribute location

Implements Renderer.

Definition at line 219 of file GL3Renderer.cpp.

◆ isUsingShortIndices()

bool isUsingShortIndices ( )
overridevirtual
Returns
Returns if renderer is using short indices, otherwise it uses int indices

Implements Renderer.

Definition at line 268 of file GL3Renderer.cpp.

◆ linkProgram()

bool linkProgram ( int32_t  programId)
overridevirtual

Links attached shaders to a program.

Parameters
programIdprogram id
Returns
success

Implements Renderer.

Definition at line 358 of file GL3Renderer.cpp.

◆ loadShader()

int32_t loadShader ( int32_t  type,
const string &  pathName,
const string &  fileName,
const string &  definitions = string(),
const string &  functions = string() 
)
overridevirtual

Loads a shader.

Parameters
typetype
pathNamepath name
fileNamefile name
definitionspreprocessor definitions
functionsincluded functions
Returns
shader handle

Implements Renderer.

Definition at line 281 of file GL3Renderer.cpp.

◆ memoryBarrier()

void memoryBarrier ( )
overridevirtual

Memory barrier.

Implements Renderer.

Definition at line 1270 of file GL3Renderer.cpp.

◆ readPixelDepth()

float readPixelDepth ( int32_t  x,
int32_t  y 
)
overridevirtual

Reads a pixel depth.

Parameters
xx
yy
Returns
depth 0.0f..1.0f

Implements Renderer.

Definition at line 1198 of file GL3Renderer.cpp.

◆ readPixels()

ByteBuffer * readPixels ( int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height 
)
overridevirtual

Read pixels.

Parameters
xx
yy
widthwidth
heightheight
Returns
byte buffer

Implements Renderer.

Definition at line 1205 of file GL3Renderer.cpp.

◆ resizeColorBufferTexture()

void resizeColorBufferTexture ( int32_t  textureId,
int32_t  width,
int32_t  height 
)
overridevirtual

Resize color buffer texture.

Parameters
textureIdtexture id
widthwidth
heightheight

Implements Renderer.

Definition at line 817 of file GL3Renderer.cpp.

◆ resizeDepthBufferTexture()

void resizeDepthBufferTexture ( int32_t  textureId,
int32_t  width,
int32_t  height 
)
overridevirtual

Resizes a depth texture.

Parameters
textureIdtexture id
widthwidth
heightheight

Implements Renderer.

Definition at line 810 of file GL3Renderer.cpp.

◆ resizeGBufferColorTexture()

void resizeGBufferColorTexture ( int32_t  textureId,
int32_t  width,
int32_t  height 
)
overridevirtual

Resizes a geometry buffer color RGBA texture.

Parameters
textureIdtexture id
widthwidth
heightheight
Returns
geometry buffer color RGBA texture id

Implements Renderer.

Definition at line 830 of file GL3Renderer.cpp.

◆ resizeGBufferGeometryTexture()

void resizeGBufferGeometryTexture ( int32_t  textureId,
int32_t  width,
int32_t  height 
)
overridevirtual

Resizes a geometry buffer geometry texture.

Parameters
textureIdtexture id
widthwidth
heightheight
Returns
geometry buffer geometry texture id

Implements Renderer.

Definition at line 824 of file GL3Renderer.cpp.

◆ setClearColor()

void setClearColor ( float  red,
float  green,
float  blue,
float  alpha 
)
overridevirtual

Set up clear color.

Parameters
redred
greengreen
blueblue
alphaalpha

Implements Renderer.

Definition at line 464 of file GL3Renderer.cpp.

◆ setColorMask()

void setColorMask ( bool  red,
bool  green,
bool  blue,
bool  alpha 
)
overridevirtual

Set up GL rendering colormask.

Parameters
redred
greengreen
blueblue
alphaalpha

Implements Renderer.

Definition at line 531 of file GL3Renderer.cpp.

◆ setCullFace()

void setCullFace ( int32_t  cullFace)
overridevirtual

Sets up which face will be culled.

Parameters
cullFacecull face

Implements Renderer.

Definition at line 484 of file GL3Renderer.cpp.

◆ setDepthFunction()

void setDepthFunction ( int32_t  depthFunction)
overridevirtual

Set up depth function.

Parameters
depthFunctiondepth function

Implements Renderer.

Definition at line 525 of file GL3Renderer.cpp.

◆ setFrontFace()

void setFrontFace ( int  contextIdx,
int32_t  frontFace 
)
overridevirtual

Set up clock wise or counter clock wise faces as front face.

Parameters
contextIdxcontext index
frontFacefrontFace

Implements Renderer.

Definition at line 479 of file GL3Renderer.cpp.

◆ setLineWidth()

void setLineWidth ( float  lineWidth)
overridevirtual

Set line width.

Parameters
lineWidthline width

Implements Renderer.

Definition at line 1149 of file GL3Renderer.cpp.

◆ setProgramAttributeLocation()

void setProgramAttributeLocation ( int32_t  programId,
int32_t  location,
const string &  name 
)
overridevirtual

Bind attribute to a input location.

Parameters
programIdprogram id
locationlocation
nameattribute name

Implements Renderer.

Definition at line 448 of file GL3Renderer.cpp.

◆ setProgramUniformFloat()

void setProgramUniformFloat ( int  contextIdx,
int32_t  uniformId,
float  value 
)
overridevirtual

Set up a float uniform value.

Parameters
contextIdxcontext index
uniformIduniform id
valuevalue

Implements Renderer.

Definition at line 413 of file GL3Renderer.cpp.

◆ setProgramUniformFloatMatrices4x4()

void setProgramUniformFloatMatrices4x4 ( int  contextIdx,
int32_t  uniformId,
int32_t  count,
FloatBuffer data 
)
overridevirtual

Set up a float matrices 4x4 uniform values.

Parameters
contextIdxcontext index
uniformIduniform id
countcount
datadata

Implements Renderer.

Definition at line 428 of file GL3Renderer.cpp.

◆ setProgramUniformFloatMatrix3x3()

void setProgramUniformFloatMatrix3x3 ( int  contextIdx,
int32_t  uniformId,
const array< float, 9 > &  value 
)
overridevirtual

Set up a float matrix 3x3 uniform value.

Parameters
contextIdxcontext index
uniformIduniform id
valuevalue

Implements Renderer.

Definition at line 418 of file GL3Renderer.cpp.

◆ setProgramUniformFloatMatrix4x4()

void setProgramUniformFloatMatrix4x4 ( int  contextIdx,
int32_t  uniformId,
const array< float, 16 > &  value 
)
overridevirtual

Set up a float matrix 4x4 uniform value.

Parameters
contextIdxcontext index
uniformIduniform id
valuevalue

Implements Renderer.

Definition at line 423 of file GL3Renderer.cpp.

◆ setProgramUniformFloatVec2()

void setProgramUniformFloatVec2 ( int  contextIdx,
int32_t  uniformId,
const array< float, 2 > &  data 
)
overridevirtual

Set up a float vec2 uniform value.

Parameters
contextIdxcontext index
uniformIduniform id
datadata

Implements Renderer.

Definition at line 443 of file GL3Renderer.cpp.

◆ setProgramUniformFloatVec3()

void setProgramUniformFloatVec3 ( int  contextIdx,
int32_t  uniformId,
const array< float, 3 > &  data 
)
overridevirtual

Set up a float vec3 uniform value.

Parameters
contextIdxcontext index
uniformIduniform id
datadata

Implements Renderer.

Definition at line 438 of file GL3Renderer.cpp.

◆ setProgramUniformFloatVec4()

void setProgramUniformFloatVec4 ( int  contextIdx,
int32_t  uniformId,
const array< float, 4 > &  data 
)
overridevirtual

Set up a float vec4 uniform value.

Parameters
contextIdxcontext index
uniformIduniform id
datadata

Implements Renderer.

Definition at line 433 of file GL3Renderer.cpp.

◆ setProgramUniformInteger()

void setProgramUniformInteger ( int  contextIdx,
int32_t  uniformId,
int32_t  value 
)
overridevirtual

Set up a integer uniform value.

Parameters
contextIdxcontext index
uniformIduniform id
valuevalue

Implements Renderer.

Definition at line 394 of file GL3Renderer.cpp.

◆ setTextureUnit()

void setTextureUnit ( int  contextIdx,
int32_t  textureUnit 
)
overridevirtual

Sets up texture unit.

Parameters
contextIdxcontext index
textureUnittexture unit

Implements Renderer.

Definition at line 1192 of file GL3Renderer.cpp.

◆ setViewPort()

void setViewPort ( int32_t  width,
int32_t  height 
)
overridevirtual

Set up viewport parameter.

Parameters
widthwidth
heightheight

Implements Renderer.

Definition at line 453 of file GL3Renderer.cpp.

◆ setVSync()

void setVSync ( bool  vSync)
overridevirtual

Enable/Disable v-sync.

Parameters
vSyncV-sync enabled

Implements Renderer.

Definition at line 1378 of file GL3Renderer.cpp.

◆ unbindBufferObjects()

void unbindBufferObjects ( int  contextIdx)
overridevirtual

Unbind buffer objects.

Parameters
contextIdxcontext index

Implements Renderer.

Definition at line 1161 of file GL3Renderer.cpp.

◆ updateViewPort()

void updateViewPort ( )
overridevirtual

Update viewport.

Implements Renderer.

Definition at line 459 of file GL3Renderer.cpp.

◆ uploadBufferObject() [1/3]

void uploadBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  size,
FloatBuffer data 
)
overridevirtual

Uploads buffer data to buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
sizesize
datadata

Implements Renderer.

Definition at line 970 of file GL3Renderer.cpp.

◆ uploadBufferObject() [2/3]

void uploadBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  size,
IntBuffer data 
)
overridevirtual

Uploads buffer data to buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
sizesize
datadata

Implements Renderer.

Definition at line 986 of file GL3Renderer.cpp.

◆ uploadBufferObject() [3/3]

void uploadBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  size,
ShortBuffer data 
)
overridevirtual

Uploads buffer data to buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
sizesize
datadata

Implements Renderer.

Definition at line 978 of file GL3Renderer.cpp.

◆ uploadCubeMapTexture()

void uploadCubeMapTexture ( int  contextIdx,
Texture textureLeft,
Texture textureRight,
Texture textureTop,
Texture textureBottom,
Texture textureFront,
Texture textureBack 
)
overridevirtual

Uploads cube map texture data to current bound texture.

Parameters
contextIdxcontext index
textureLefttexture left
textureRighttexture right
textureToptexture top
textureBottomtexture bottom
textureFronttexture front
textureBacktexture back

Implements Renderer.

Definition at line 655 of file GL3Renderer.cpp.

◆ uploadIndicesBufferObject() [1/2]

void uploadIndicesBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  size,
IntBuffer data 
)
overridevirtual

Uploads buffer data to buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
sizesize
datadata

Implements Renderer.

Definition at line 999 of file GL3Renderer.cpp.

◆ uploadIndicesBufferObject() [2/2]

void uploadIndicesBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  size,
ShortBuffer data 
)
overridevirtual

Uploads buffer data to buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
sizesize
datadata

Implements Renderer.

Definition at line 994 of file GL3Renderer.cpp.

◆ uploadSkinningBufferObject() [1/2]

void uploadSkinningBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  size,
FloatBuffer data 
)
overridevirtual

Upload skinning buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
sizesize
datadata

Implements Renderer.

Definition at line 1279 of file GL3Renderer.cpp.

◆ uploadSkinningBufferObject() [2/2]

void uploadSkinningBufferObject ( int  contextIdx,
int32_t  bufferObjectId,
int32_t  size,
IntBuffer data 
)
overridevirtual

Upload skinning buffer object.

Parameters
contextIdxcontext index
bufferObjectIdbuffer object id
sizesize
datadata

Implements Renderer.

Definition at line 1293 of file GL3Renderer.cpp.

◆ uploadTexture()

void uploadTexture ( int  contextIdx,
Texture texture 
)
overridevirtual

Uploads texture data to current bound texture.

Parameters
contextIdxcontext index
texturetexture

Implements Renderer.

Definition at line 608 of file GL3Renderer.cpp.

◆ useProgram()

void useProgram ( int  contextIdx,
int32_t  programId 
)
overridevirtual

Use shader program.

Parameters
contextIdxcontext index
programIdprogramId

Implements Renderer.

Definition at line 342 of file GL3Renderer.cpp.

Member Data Documentation

◆ activeTextureUnit

int activeTextureUnit
private

Definition at line 41 of file GL3Renderer.h.

◆ deferredShadingAvailable

bool deferredShadingAvailable
private

Definition at line 76 of file GL3Renderer.h.

◆ engineVAO

uint32_t engineVAO
private

Definition at line 39 of file GL3Renderer.h.

◆ vbosUsage

map<uint32_t, int32_t> vbosUsage
private

Definition at line 40 of file GL3Renderer.h.


The documentation for this class was generated from the following files: