OGRE 2.1
Object-Oriented Graphics Rendering Engine
|
Implementation of GL 3 as a rendering system. More...
#include <OgreGL3PlusRenderSystem.h>
Public Types | |
typedef MapIterator< Ogre::RenderTargetMap > | RenderTargetIterator |
Iterator over RenderTargets. | |
Static Public Member Functions | |
static Listener * | getSharedListener (void) |
Retrieve a pointer to the current shared render system listener. | |
static void | setSharedListener (Listener *listener) |
Sets shared listener. | |
Friends | |
class | ShaderGeneratorTechniqueResolverListener |
Implementation of GL 3 as a rendering system.
Iterator over RenderTargets.
Ogre::GL3PlusRenderSystem::GL3PlusRenderSystem | ( | ) |
Ogre::GL3PlusRenderSystem::~GL3PlusRenderSystem | ( | ) |
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
Signifies the beginning of the main frame.
i.e. will only be called once per frame, not per viewport
Reimplemented in Ogre::MetalRenderSystem.
The RenderSystem will keep a count of tris rendered, this resets the count.
|
virtual |
Binds an UAV texture to a Compute Shader.
OpenGL however, does not make this distinction. Hence once we switch back to 3D rendering, we need to restore UAVs set via queueBindUAV.
Implements Ogre::RenderSystem.
Removes all depth buffers.
Should be called on device lost and shutdown
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtual |
Creates a DepthBuffer that can be attached to the specified RenderTarget.
Implements Ogre::RenderSystem.
|
virtual |
Creates a new rendering window.
name | The name of the window. Used in other methods later like setRenderTarget and getRenderTarget. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
width | The width of the new window. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
height | The height of the new window. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fullScreen | Specify true to make the window full screen without borders, title bar or menu bar. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
miscParams | A NameValuePairList describing the other parameters for the new rendering window. Options are case sensitive. Unrecognised parameters will be ignored silently. These values might be platform dependent, but these are present for all platforms unless indicated otherwise:
|
Implements Ogre::RenderSystem.
|
virtual |
Creates multiple rendering windows.
renderWindowDescriptions | Array of structures containing the descriptions of each render window. The structure's members are the same as the parameters of _createRenderWindow: name width height fullScreen miscParams See _createRenderWindow for details about each member. |
createdWindows | This array will hold the created render windows. |
Reimplemented from Ogre::RenderSystem.
|
virtualinherited |
Turns off a texture unit.
Reimplemented in Ogre::D3D11RenderSystem, and Ogre::D3D9RenderSystem.
Disables all texture units from the given unit upwards.
|
virtual |
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
Called once per frame, regardless of how many active workspaces there are.
Gets called AFTER all RenderWindows have been swapped.
Reimplemented in Ogre::MetalRenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
Reports the number of batches rendered since the last _beginGeometryCount call.
|
virtualinherited |
Returns the default material scheme used by the render system.
Systems that use the RTSS to emulate a fixed function pipeline (e.g. OpenGL ES 2, GL3+, DX11) need to override this function to return the default material scheme of the RTSS ShaderGenerator.
This is currently only used to set the default material scheme for viewports. It is a necessary step on these render systems for render textures to be rendered into properly.
void Ogre::GL3PlusRenderSystem::_getDepthStencilFormatFor | ( | GLenum | internalColourFormat, |
GLenum * | depthFormat, | ||
GLenum * | stencilFormat | ||
) |
Mimics D3D9RenderSystem::_getDepthStencilFormatFor, if no FBO RTT manager, outputs GL_NONE.
Reports the number of tris rendered since the last _beginGeometryCount call.
|
inline |
Returns the main context.
Reports the number of vertices passed to the renderer since the last _beginGeometryCount call.
Get the current active viewport for rendering.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
Reimplemented from Ogre::RenderSystem.
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
Utility method for initialising all render targets attached to this rendering system.
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
inlinevirtualinherited |
This function was created because of Metal.
The Metal API doesn't have a 'device->clear( texture )' function. Instead we must specify we want to start rendering to a cleared surface. This allows mobile TBDR GPUs to begin rendering without having to load any data from memory (saves a lot of bandwidth and battery).
Ogre will first issue a clear, then begin executing the shadow node (which switches to the shadow map) then switch back to the original rtt to resume regular rendinering. In this common case we want to delay the clear, but _setRenderTarget is clearly not an trusted indication (we would get many false positives).
previousRenderTarget | RenderTarget that was being used (and we should clear if we have to). |
Reimplemented in Ogre::MetalRenderSystem.
void Ogre::GL3PlusRenderSystem::_oneTimeContextInitialization | ( | ) |
One time initialization for the RenderState of a context.
Things that only need to be set once, like the LightingModel can be defined here.
|
virtualinherited |
Pause rendering for a frame.
This has to be called after _beginFrame and before _endFrame. Will usually be called by the SceneManager, don't use this manually unless you know what you are doing.
Reimplemented in Ogre::D3D9RenderSystem.
|
virtual |
Renders the VAO. Assumes _setVertexArrayObject has already been called.
Implements Ogre::RenderSystem.
|
virtual |
Implements Ogre::RenderSystem.
|
virtual |
Renders a V1 RenderOperation. Assumes _setRenderOperation has already been called.
Implements Ogre::RenderSystem.
|
virtual |
Implements Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
|
virtual |
Implements Ogre::RenderSystem.
|
virtual |
Implements Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtualinherited |
Reimplemented in Ogre::D3D11RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtual |
Reimplemented from Ogre::RenderSystem.
|
virtualinherited |
Resume rendering for a frame.
This has to be called after a _pauseFrame call Will usually be called by the SceneManager, don't use this manually unless you know what you are doing.
context | the render system context, as returned by _pauseFrame |
Reimplemented in Ogre::D3D9RenderSystem.
|
virtualinherited |
Set texture unit binding type.
Reimplemented in Ogre::D3D11RenderSystem.
|
virtual |
Unlike _setPipelineStateObject, the RenderSystem will check if the PSO has changed to avoid redundant state changes (since it's hard to do it at Hlms level)
Implements Ogre::RenderSystem.
See RenderSystem.
|
virtual |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
void Ogre::GL3PlusRenderSystem::_setHlmsBlendblock | ( | const HlmsBlendblock * | blendblock, |
const GL3PlusHlmsPso * | pso | ||
) |
void Ogre::GL3PlusRenderSystem::_setHlmsMacroblock | ( | const HlmsMacroblock * | macroblock, |
const GL3PlusHlmsPso * | pso | ||
) |
|
virtual |
@See HlmsSamplerblock.
This function MUST be called after _setTexture, not before. Otherwise not all APIs may see the change.
Implements Ogre::RenderSystem.
|
virtual |
Implements Ogre::RenderSystem.
|
virtual |
Implements Ogre::RenderSystem.
@See HlmsPso
Reimplemented from Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtual |
Implements Ogre::RenderSystem.
|
virtual |
Set current render target to target, enabling its GL context if needed.
Implements Ogre::RenderSystem.
void Ogre::GL3PlusRenderSystem::_setSceneBlending | ( | SceneBlendFactor | sourceFactor, |
SceneBlendFactor | destFactor, | ||
SceneBlendOperation | op | ||
) |
void Ogre::GL3PlusRenderSystem::_setSceneBlendingOperation | ( | SceneBlendOperation | op | ) |
void Ogre::GL3PlusRenderSystem::_setSeparateSceneBlending | ( | SceneBlendFactor | sourceFactor, |
SceneBlendFactor | destFactor, | ||
SceneBlendFactor | sourceFactorAlpha, | ||
SceneBlendFactor | destFactorAlpha, | ||
SceneBlendOperation | op, | ||
SceneBlendOperation | alphaOp | ||
) |
void Ogre::GL3PlusRenderSystem::_setSeparateSceneBlendingOperation | ( | SceneBlendOperation | op, |
SceneBlendOperation | alphaOp | ||
) |
|
inlinevirtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
|
virtualinherited |
Sets the texture to bind to a given texture unit.
User processes would not normally call this direct unless rendering primitives themselves.
unit | The index of the texture unit to modify. Multitexturing hardware can support multiple units (see RenderSystemCapabilites::getNumTextureUnits) |
enabled | Boolean to turn the unit on/off |
texname | The name of the texture to use - this should have already been loaded with TextureManager::load. |
See RenderSystem.
Implements Ogre::RenderSystem.
|
inlinevirtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
inlinevirtual |
See RenderSystem.
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtual |
Binds a regular texture to a Compute Shader.
Implements Ogre::RenderSystem.
|
inlinevirtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtualinherited |
Notify the rendersystem that it should adjust texture projection to be relative to a different origin.
|
virtualinherited |
Utility function for setting all the properties of a texture unit at once.
This method is also worth using over the individual texture unit settings because it only sets those settings which are different from the current settings for this unit, thus minimising render state changes.
|
virtual |
Part of the low level rendering interface.
Tells the RS which VAO will be bound now. (i.e. Vertex Formats, buffers being bound, etc.) You don't need to rebind if the VAO's mRenderQueueId is the same as previous call.
Implements Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtualinherited |
Sets multiple world matrices (vertex blending).
See RenderSystem.
Implements Ogre::RenderSystem.
May override the current VertexArrayObject!
Reimplemented from Ogre::RenderSystem.
void Ogre::GL3PlusRenderSystem::_switchContext | ( | GL3PlusContext * | context | ) |
Switch GL context, dealing with involved internal cached states too.
void Ogre::GL3PlusRenderSystem::_unregisterContext | ( | GL3PlusContext * | context | ) |
Unregister a render target->context mapping.
If the context of target is the current context, change the context to the main context so it can be destroyed safely.
Called once per frame, regardless of how many active workspaces there are.
|
inlinevirtual |
See RenderSystem.
Implements Ogre::RenderSystem.
Add a user clipping plane.
Add a user clipping plane.
Adds a listener to the custom events that this render system can raise.
|
inlinevirtual |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
|
virtualinherited |
Attaches the passed render target to the render system.
|
virtual |
Implements Ogre::RenderSystem.
This marks the beginning of an event for GPU profiling.
Implements Ogre::RenderSystem.
|
virtual |
Bind Gpu program parameters.
gptype | The type of program to bind the parameters to |
params | The parameters to bind |
variabilityMask | A mask of GpuParamVariability identifying which params need binding |
Implements Ogre::RenderSystem.
|
virtual |
Only binds Gpu program parameters used for passes that have more than one iteration rendering.
Implements Ogre::RenderSystem.
|
virtual |
Clears one or more frame buffers on the active render target.
buffers | Combination of one or more elements of FrameBufferType denoting which buffers are to be cleared |
colour | The colour to clear the colour buffer with, if enabled |
depth | The value to initialise the depth buffer with, if enabled |
stencil | The value to initialise the stencil buffer with, if enabled. |
Implements Ogre::RenderSystem.
By default queueBindUAV will keep all other slots intact.
Calling this function will unset all bound UAVs. Will take effect after flushUAVs or setting a new RT.
Implements Ogre::RenderSystem.
|
virtualinherited |
See RenderSystem::updateCompositorManager.
Reimplemented in Ogre::MetalRenderSystem.
|
virtualinherited |
See RenderSystem::updateCompositorManager.
Reimplemented in Ogre::MetalRenderSystem.
|
virtualinherited |
See RenderSystem::updateCompositorManager.
Reimplemented in Ogre::MetalRenderSystem.
|
virtualinherited |
Generates a packed data version of the passed in ColourValue suitable for use as with this RenderSystem.
colour | The colour to convert |
pDest | Pointer to location to put the result. |
GLint Ogre::GL3PlusRenderSystem::convertCompareFunction | ( | CompareFunction | func | ) | const |
GLint Ogre::GL3PlusRenderSystem::convertStencilOp | ( | StencilOperation | op | ) | const |
|
virtual |
Create an object for performing hardware occlusion queries.
Implements Ogre::RenderSystem.
|
virtual |
Create a MultiRenderTarget, which is a render target that renders to multiple RenderTextures at once.
Surfaces can be bound and unbound at will. This fails if mCapabilities->getNumMultiRenderTargets() is smaller than 2.
Implements Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtualinherited |
Implements Ogre::RenderSystem.
|
virtualinherited |
Destroy a hardware occlusion query object.
Destroys a render target of any sort.
Reimplemented in Ogre::D3D11RenderSystem, and Ogre::D3D9RenderSystem.
Destroys a render texture.
Destroys a render window.
void Ogre::GL3PlusRenderSystem::destroyRenderWindow | ( | RenderWindow * | pWin | ) |
See RenderSystem.
|
virtualinherited |
Detaches the render target with the passed name from the render system and returns a pointer to it.
Reimplemented in Ogre::D3D11RenderSystem, and Ogre::D3D9RenderSystem.
Instructs the viewport to 'discard' the buffers.
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
Ends the currently active GPU profiling event.
Implements Ogre::RenderSystem.
Forces to take effect all the queued UAV binding requests.
Implements Ogre::RenderSystem.
|
inlineinherited |
Gets the capabilities of the render system.
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtualinherited |
Gets a custom (maybe platform-specific) attribute.
name | The name of the attribute. |
pData | Pointer to memory of the right kind of structure to receive the info. |
Reimplemented in Ogre::D3D11RenderSystem.
Gets the number of display monitors.
Implements Ogre::RenderSystem.
|
inlinevirtualinherited |
Returns the driver version.
See RenderSystem.
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
|
inherited |
Returns the global instance vertex buffer.
|
inherited |
Gets vertex declaration for the global vertex buffer for the global instancing.
|
inherited |
Gets the global number of instances.
|
inline |
Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this rendersystem.
Implements Ogre::RenderSystem.
Indicates whether or not the vertex windings set will be inverted for the current render (e.g.
reflections)
Gets the maximum (farthest) depth value to be used when rendering using identity transforms.
Implements Ogre::RenderSystem.
Gets the minimum (closest) depth value to be used when rendering using identity transforms.
Implements Ogre::RenderSystem.
|
inlineinherited |
Get a pointer to the current capabilities being used by the RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
|
inlineinherited |
Gets the native shading language version for this render system.
Formatted so that it can be used within a shading program. For example, OpenGL 3.2 would return 150, while 3.3 would return 330
|
inlinevirtualinherited |
Gets a list of the rendersystem specific events that this rendersystem can raise.
|
virtualinherited |
Returns a pointer to the render target with the passed name, or NULL if that render target cannot be found.
|
inlinevirtualinherited |
Returns a specialised MapIterator over all render targets attached to the RenderSystem.
OpenGL depth is in range [-1;1] so it returns 2.0f; D3D11 & Metal are in range [0;1] so it returns 1.0f;.
Reimplemented in Ogre::D3D11RenderSystem, and Ogre::MetalRenderSystem.
Retrieve a pointer to the current shared render system listener.
|
inlineinherited |
|
inlineinherited |
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this rendersystem.
Implements Ogre::RenderSystem.
Returns true if the renderer will try to use W-buffers when available.
Determines if the system has anisotropic mip map filter support.
Implements Ogre::RenderSystem.
Implements Ogre::RenderSystem.
void Ogre::GL3PlusRenderSystem::initialiseContext | ( | RenderWindow * | primary | ) |
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
virtualinherited |
Returns whether or not a Gpu program of the given type is currently bound.
Reimplemented in Ogre::D3D9RenderSystem.
Marks an instantaneous event for graphics profilers.
This is equivalent to calling
Implements Ogre::RenderSystem.
Ogre::GL3PlusRenderSystem::OGRE_MUTEX | ( | mThreadInitMutex | ) |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
|
virtual |
Implements Ogre::RenderSystem.
|
virtual |
Tell the rendersystem to perform any prep tasks it needs to directly before other threads which might access the rendering API are registered.
Implements Ogre::RenderSystem.
|
virtual |
Queues the binding of an UAV to the binding point/slot.
It won't actually take effect until you flush the UAVs or set another RTT.
bindPoint | The buffer binding location for shader access. For OpenGL this must be unique and is not related to the texture binding point. |
access | The texture access privileges given to the shader. |
mipmapLevel | The texture mipmap level to use. |
textureArrayIndex | The index of the texture array to use. If texture is not a texture array, set to 0. |
format | Texture format to be read in by shader. This may be different than the bound texture format. Will be the same is left as PF_UNKNOWN |
Implements Ogre::RenderSystem.
|
virtual |
See other overload.
The slots are shared with the textures'
offset | Offset to bind, in bytes |
sizeBytes | Size to bind, in bytes. Use 0 to bind until the end of the buffer. |
Implements Ogre::RenderSystem.
|
virtual |
Register the an additional thread which may make calls to rendersystem-related objects.
Implements Ogre::RenderSystem.
See RenderSystem.
Implements Ogre::RenderSystem.
Remove a listener to the custom events that this render system can raise.
Clears the user clipping region.
See RenderSystem.
Sets the user clipping region.
|
virtual |
Internal method used to set the underlying clip planes when needed.
Implements Ogre::RenderSystem.
|
virtual |
See RenderSystem.
Implements Ogre::RenderSystem.
|
inlinevirtualinherited |
set the current multi pass count value.
This must be set prior to calling _render() if multiple renderings of the same pass state are required.
count | Number of times to render the current state. |
Instructs the RenderSystem to compile shaders without optimizations and with debug information, for easier debugging on APIs that support it.
Default is true if OGRE_DEBUG_MODE >= OGRE_DEBUG_HIGH, else false
This setting takes effect for shaders compiled afterwards. Already compiled shaders won't change unless you manually rebuild them.
It is highly recommended you disable the Microcode cache before changing the default, or else debug shaders may contaminate your cache, or alternatively a shader from the cache may be used which may have been compiled with a different setting.
|
virtualinherited |
Retrieves an existing DepthBuffer or creates a new one suited for the given RenderTarget and sets it.
|
inlinevirtualinherited |
Tell the render system whether to derive a depth bias on its own based on the values passed to it in setCurrentPassIterationCount.
The depth bias set will be baseValue + iteration * multiplier
derive | True to tell the RS to derive this automatically |
baseValue | The base value to which the multiplier should be added |
multiplier | The amount of depth bias to apply per iteration |
slopeScale | The constant slope scale bias for completeness |
|
inherited |
Sets the global instance vertex buffer.
|
inherited |
Sets vertex declaration for the global vertex buffer for the global instancing.
Sets the global number of instances.
Sets whether or not vertex windings set should be inverted; this can be important for rendering reflections.
Sets shared listener.
|
virtual |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
In Direct3D11, UAV & RenderTargets share the same slots.
Because of this, we enforce the same behavior on all RenderSystems. An unfortunate consequence is that if you attach an MRT consisting of 3 RTs; the UAV needs to set at slot 3; not slot 0. This setting lets you tell Ogre the starting slot; so queueBindUAV( 0, ... ) can goes to slot 3 if you call setUavStartingSlot( 3 )
startingSlot | Default value: 1. |
Reimplemented from Ogre::RenderSystem.
Sets whether or not W-buffers are enabled if they are available for this renderer.
enabled | If true and the renderer supports them W-buffers will be used. If false W-buffers will not be used even if available. W-buffers are enabled by default for 16bit depth buffers and disabled for all other depths. |
See RenderSystem.
Reimplemented from Ogre::RenderSystem.
|
virtual |
Unregister an additional thread which may make calls to rendersystem-related objects.
Implements Ogre::RenderSystem.
|
virtualinherited |
This gives the renderer a chance to perform the compositor update in a special way.
When the render system is ready to perform the actual update it should just compositorManager->_updateImplementation.
Reimplemented in Ogre::MetalRenderSystem.
|
virtualinherited |
Force the render system to use the special capabilities.
Can only be called before the render system has been fully initializer (before createWindow is called)
capabilities | has to be a subset of the real capabilities and the caller is responsible for deallocating capabilities. |
See RenderSystem.
Implements Ogre::RenderSystem.