29 #ifndef __GL3PlusRenderSystem_H__
30 #define __GL3PlusRenderSystem_H__
41 class GL3PlusRTTManager;
42 class GL3PlusGpuProgramManager;
43 class GLSLProgramFactory;
45 class GLSLLinkProgram;
46 class HardwareBufferManager;
84 void initConfigOptions(
void);
95 GLfloat mAutoTextureMatrix[16];
143 GLint getCombinedMinMipFilter(
void)
const;
155 bool activateGLTextureUnit(
size_t unit);
157 const size_t vertexStart,
167 friend class ShaderGeneratorTechniqueResolverListener;
175 const String& getName(
void)
const;
183 void setConfigOption(
const String &name,
const String &value);
187 String validateConfigOptions(
void);
191 RenderWindow* _initialise(
bool autoCreateWindow,
const String& windowTitle =
"OGRE Render Window");
203 void reinitialise(
void);
222 RenderWindow* _createRenderWindow(
const String &name,
unsigned int width,
unsigned int height,
233 void _getDepthStencilFormatFor( GLenum internalColourFormat, GLenum *depthFormat,
234 GLenum *stencilFormat );
246 String getErrorDescription(
long errorNumber)
const;
270 void _setWorldMatrix(
const Matrix4 &m);
274 void _setViewMatrix(
const Matrix4 &m);
278 void _setProjectionMatrix(
const Matrix4 &m);
289 void _setPointParameters(
Real size,
bool attenuationEnabled,
294 void _setPointSpritesEnabled(
bool enabled);
298 void _setTexture(
size_t unit,
bool enabled,
const TexturePtr &tex);
302 void _setTextureCoordSet(
size_t stage,
size_t index);
307 const Frustum* frustum = 0) { };
319 void _setTextureBorderColour(
size_t stage,
const ColourValue& colour);
323 void _setTextureMipmapBias(
size_t unit,
float bias);
335 void _beginFrame(
void);
339 void _endFrame(
void);
351 void _setDepthBufferCheckEnabled(
bool enabled =
true);
355 void _setDepthBufferWriteEnabled(
bool enabled =
true);
363 void _setDepthBias(
float constantBias,
float slopeScaleBias);
367 void _setColourBufferWriteEnabled(
bool red,
bool green,
bool blue,
bool alpha);
375 void _convertProjectionMatrix(
const Matrix4& matrix,
376 Matrix4& dest,
bool forGpuProgram =
false);
380 void _makeProjectionMatrix(
const Radian& fovy,
Real aspect,
Real nearPlane,
Real farPlane,
381 Matrix4& dest,
bool forGpuProgram =
false);
386 Real nearPlane,
Real farPlane,
Matrix4& dest,
bool forGpuProgram =
false);
391 Matrix4& dest,
bool forGpuProgram =
false);
395 void _applyObliqueDepthProjection(
Matrix4& matrix,
const Plane& plane,
404 void enableClipPlane (
ushort index,
bool enable);
412 void setStencilCheckEnabled(
bool enabled);
421 bool twoSidedOperation =
false);
429 void _setTextureUnitCompareFunction(
size_t unit,
CompareFunction function);
433 void _setTextureUnitCompareEnabled(
size_t unit,
bool compare);
437 void _setTextureLayerAnisotropy(
size_t unit,
unsigned int maxAnisotropy);
457 void setScissorTest(
bool enabled,
size_t left = 0,
size_t top = 0,
size_t right = 800,
size_t bottom = 600);
459 void clearFrameBuffer(
unsigned int buffers,
461 Real depth = 1.0f,
unsigned short stencil = 0);
468 void registerThread();
469 void unregisterThread();
470 void preExtraThreadsStarted();
471 void postExtraThreadsStarted();
493 void _oneTimeContextInitialization();
506 void bindGpuProgramPassIterationParameters(
GpuProgramType gptype);
513 void _setAlphaRejectSettings(
CompareFunction func,
unsigned char value,
bool alphaToCoverage );
515 unsigned int getDisplayMonitorCount()
const;
518 GLfloat _getCurrentAnisotropy(
size_t unit);
528 virtual void beginProfileEvent(
const String &eventName );
531 virtual void endProfileEvent(
void );
534 virtual void markProfileEvent(
const String &eventName );
vector< Plane >::type PlaneList
HashMap< GLenum, GLuint > BindBufferMap
A 'canvas' which can receive the results of a rendering operation.
Factory class for GLSL programs.
void setAmbientLight(float r, float g, float b)
See RenderSystem.
bool mGLInitialised
Check if the GL system has already been initialised.
GL3PlusRTTManager * mRTTManager
Manager object for creating render textures.
void setVertexDeclaration(VertexDeclaration *decl, VertexBufferBinding *binding)
See RenderSystem.
FilterOptions mMinFilter
Last min & mip filtering options, so we can combine them.
Texture addressing mode for each texture coordinate.
GLSLProgramFactory * mGLSLProgramFactory
Real getMaximumDepthInputValue(void)
Gets the maximum (farthest) depth value to be used when rendering using identity transforms.
bool mUseAutoTextureMatrix
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
Real getVerticalTexelOffset(void)
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this r...
bool mStopRendering
Rendering loop control.
Leave the stencil buffer unchanged.
GLenum mActiveTextureUnit
These variables are used for caching RenderSystem state.
virtual bool hasAnisotropicMipMapFilter() const
Determines if the system has anisotropic mip map filter support.
Class representing colour.
Class that encapsulates an GL context.
float Real
Software floating point type.
static const ColourValue Black
BindBufferMap mActiveBufferMap
vector< RenderWindowDescription >::type RenderWindowDescriptionList
Render window creation parameters container.
GL3PlusGpuProgram * mCurrentDomainProgram
Singleton wrapper for hardware buffer manager.
GL3PlusGpuProgram * mCurrentHullProgram
void _setTextureBlendMode(size_t stage, const LayerBlendModeEx &bm)
See RenderSystem.
An abstraction of a viewport, i.e.
void setShadingType(ShadeOptions so)
See RenderSystem.
bool mDepthWrite
Store last depth write state.
GL3PlusContextList mBackgroundContextList
List of background thread contexts.
GLenum _getPolygonMode(void)
Implementation of GL 3 as a rendering system.
Defines a plane in 3D space.
GL3PlusGpuProgram * mCurrentGeometryProgram
vector< RenderWindow * >::type RenderWindowList
Render window container.
GLenum mPolygonMode
Cache the polygon mode value.
Class encapsulating a standard 4x4 homogeneous matrix.
Matrix4 mViewMatrix
View matrix to set world against.
HardwareBufferManager * mHardwareBufferManager
Manager/factory for RenderTextures.
Generalised low-level GL program, can be applied to multiple types (eg ARB and NV) ...
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
Shared pointer implementation used to share vertex buffers.
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
Real getMinimumDepthInputValue(void)
Gets the minimum (closest) depth value to be used when rendering using identity transforms.
CullingMode
Hardware culling modes based on vertex winding.
GL3PlusContext * mCurrentContext
void setVertexDeclaration(VertexDeclaration *decl)
See RenderSystem.
#define _OgreGL3PlusExport
int TrackVertexColourType
An enumeration describing which material properties should track the vertex colours.
GL3PlusGpuProgramManager * mGpuProgramManager
Class which manages blending of both colour and alpha components.
void setLightingEnabled(bool enabled)
See RenderSystem.
Defines the functionality of a 3D API.
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
void _setSurfaceParams(const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess, TrackVertexColourType tracking)
See RenderSystem.
map< String, ConfigOption >::type ConfigOptionMap
GL3PlusGpuProgram * mCurrentVertexProgram
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
bool areFixedFunctionLightsInViewSpace() const
See RenderSystem.
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
GL3PlusContext * _getMainContext()
Returns the main context.
unsigned short mFixedFunctionTextureUnits
Number of fixed-function texture units.
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
vector< GLuint >::type mRenderAttribsBound
void _setTextureCoordCalculation(size_t stage, TexCoordCalcMethod m, const Frustum *frustum=0)
See RenderSystem.
An abstract class that contains a depth/stencil buffer.
void setNormaliseNormals(bool normalise)
See RenderSystem.
Real getHorizontalTexelOffset(void)
Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this...
GpuProgramType
Enumerates the types of programs which can run on the GPU.
singleton class for storing the capabilities of the graphics card.
GL3PlusGpuProgram * mCurrentComputeProgram
vector< GLuint >::type mRenderInstanceAttribsBound
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
This class declares the usage of a single vertex buffer as a component of a complete VertexDeclaratio...
uint32 mStencilWriteMask
Store last stencil mask state.
void _useLights(const LightList &lights, unsigned short limit)
See RenderSystem.
Defines a program which runs on the GPU such as a vertex or fragment program.
SceneBlendFactor
Blending factors for manually blending objects with the scene.
FilterOptions
Filtering options for textures / mipmaps.
Manages the target rendering window.
This is a abstract class that that provides the interface for the query class for hardware occlusion...
void setVertexBufferBinding(VertexBufferBinding *binding)
See RenderSystem.
list< GL3PlusContext * >::type GL3PlusContextList
GL3PlusContext * mMainContext
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
bool mTextureCompareEnabled
'New' rendering operation using vertex buffers.
ShadeOptions
Light shading modes.
PolygonMode
The polygon mode to use when rasterising.
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
This class represents a render target that renders to multiple RenderTextures at once.
size_t mTextureMipmapCount
Used to store the number of mipmaps in the currently bound texture.
void _setTextureMatrix(size_t stage, const Matrix4 &xform)
See RenderSystem.
GL3PlusGpuProgram * mCurrentFragmentProgram
GL3PlusSupport * mGLSupport
GL support class, used for creating windows etc.
Wrapper class which indicates a given angle value is in Radians.