Go to the documentation of this file.
28 #ifndef __D3D11RENDERSYSTEM_H__
29 #define __D3D11RENDERSYSTEM_H__
40 class D3D11DriverList;
187 ID3D11ShaderResourceView *
pTex;
279 bool twoSidedOperation =
false);
324 void _setDepthBias(
float constantBias,
float slopeScaleBias);
327 Matrix4& dest,
bool forGpuProgram =
false);
329 Matrix4& dest,
bool forGpuProgram =
false);
331 Real farPlane,
Matrix4& dest,
bool forGpuProgram =
false);
333 Matrix4& dest,
bool forGpuProgram =
false);
362 void setScissorTest(
bool enabled,
size_t left = 0,
size_t top = 0,
size_t right = 800,
size_t bottom = 600);
365 Real depth = 1.0f,
unsigned short stencil = 0);
void initialiseFromRenderSystemCapabilities(RenderSystemCapabilities *caps, RenderTarget *primary)
See RenderSystem definition.
void preExtraThreadsStarted()
Tell the rendersystem to perform any prep tasks it needs to directly before other threads which might...
bool mPerStageConstantSupport
Per-stage constant support? (not in main caps since D3D specific & minor)
void clearFrameBuffer(unsigned int buffers, const ColourValue &colour=ColourValue::Black, Real depth=1.0f, unsigned short stencil=0)
Clears one or more frame buffers on the active render target.
unsigned int getDisplayMonitorCount() const
Gets the number of display monitors.
void _setAlphaRejectSettings(CompareFunction func, unsigned char value, bool alphaToCoverage)
Sets the global alpha rejection approach for future renders.
void bindGpuProgramParameters(GpuProgramType gptype, GpuProgramParametersSharedPtr params, uint16 mask)
See RenderSystem.
Defines the functionality of a 3D API.
void detachRenderTargetImpl(const String &name)
Factory class for D3D11 HLSL programs.
D3D_FEATURE_LEVEL mMinRequestedFeatureLevel
FilterOptions FilterMagnification[OGRE_MAX_TEXTURE_LAYERS]
IDXGIFactoryN * mpDXGIFactory
RenderSystemCapabilities * createRenderSystemCapabilities() const
Internal method for populating the capabilities structure.
Defines a plane in 3D space.
D3D11HLSLProgram * mBoundTesselationHullProgram
D3D11HLSLProgram * _getBoundTesselationHullProgram() const
An abstract class that contains a depth/stencil buffer.
D3D11Device & _getDevice()
void setStencilBufferParams(CompareFunction func=CMPF_ALWAYS_PASS, uint32 refValue=0, uint32 compareMask=0xFFFFFFFF, uint32 writeMask=0xFFFFFFFF, StencilOperation stencilFailOp=SOP_KEEP, StencilOperation depthFailOp=SOP_KEEP, StencilOperation passOp=SOP_KEEP, bool twoSidedOperation=false)
Determines if this system supports hardware accelerated stencil buffer.
This is a abstract class that that provides the interface for the query class for hardware occlusion.
Real getMinimumDepthInputValue(void)
Gets the minimum (closest) depth value to be used when rendering using identity transforms.
D3D_FEATURE_LEVEL mFeatureLevel
void determineFSAASettings(uint fsaa, const String &fsaaHint, DXGI_FORMAT format, DXGI_SAMPLE_DESC *outFSAASettings)
void _render(const RenderOperation &op)
Render something to the active viewport.
void _removeManualDepthBuffer(DepthBuffer *depthBuffer)
Reverts _addManualDepthBuffer actions.
D3D11HLSLProgram * _getBoundFragmentProgram() const
ID3D11ShaderResourceView * pTex
texture
structure holding texture unit settings for every stage
void initInputDevices(void)
DWORD _getCurrentAnisotropy(size_t unit)
return anisotropy level
void _setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy)
Sets the maximal anisotropy for the specified texture unit.
D3D11HLSLProgram * _getBoundTesselationDomainProgram() const
void refreshFSAAOptions(void)
void _setSeparateSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendFactor sourceFactorAlpha, SceneBlendFactor destFactorAlpha, SceneBlendOperation op=SBO_ADD, SceneBlendOperation alphaOp=SBO_ADD)
Sets the global blending factors for combining subsequent renders with the existing frame contents.
D3D11HLSLProgram * mBoundGeometryProgram
OGRE_D3D11_DRIVER_TYPE mDriverType
void refreshD3DSettings(void)
Manages the target rendering window.
virtual DepthBuffer * _createDepthBufferFor(RenderTarget *renderTarget)
Creates a DepthBuffer that can be attached to the specified RenderTarget.
TextureType type
the type of the texture
ConfigOptionMap & getConfigOptions(void)
Returns the details of this API's configuration options.
void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha)
Sets whether or not colour buffer writing is enabled, and for which channels.
std::map< String, ID3D11ClassInstance * > ClassInstanceMap
void _setRenderTargetViews()
With DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL flag render target views are unbound from us each Present(),...
void _setFog(FogMode mode=FOG_NONE, const ColourValue &colour=ColourValue::White, Real expDensity=1.0, Real linearStart=0.0, Real linearEnd=1.0)
Sets the fogging mode for future geometry.
Defines a program which runs on the GPU such as a vertex or fragment program.
size_t mLastVertexSourceCount
D3D11HLSLProgram * mBoundComputeProgram
void _setVertexTexture(size_t unit, const TexturePtr &tex)
Binds a texture to a vertex sampler.
void _setProjectionMatrix(const Matrix4 &m)
Sets the projection transform matrix.
void setStencilCheckEnabled(bool enabled)
Turns stencil buffer checking on or off.
void _setCullingMode(CullingMode mode)
Sets the culling mode for the render system based on the 'vertex winding'.
SecondaryWindowList mSecondaryWindows
void setVertexDeclaration(VertexDeclaration *decl)
Sets the current vertex declaration, ie the source of vertex data.
ID3D11ClassInstance * mClassInstances[6][8]
void _applyObliqueDepthProjection(Matrix4 &matrix, const Plane &plane, bool forGpuProgram)
Update a perspective projection matrix to use 'oblique depth projection'.
void _useLights(const LightList &lights, unsigned short limit)
Tells the rendersystem to use the attached set of lights (and no others) up to the number specified (...
D3D11_SAMPLER_DESC currentSamplerDesc
@ SOP_KEEP
Leave the stencil buffer unchanged.
size_t mBoundSamplerStatesCount
ClassInstanceMap mInstanceMap
Specialization of HighLevelGpuProgram to provide support for D3D11 High-Level Shader Language (HLSL).
void _setViewMatrix(const Matrix4 &m)
Sets the view transform matrix.
void convertDomainShaderCaps(RenderSystemCapabilities *rsc) const
void bindGpuProgramPassIterationParameters(GpuProgramType gptype)
See RenderSystem.
Class which manages blending of both colour and alpha components.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
ID3D11BlendState * mBoundBlendState
IDXGIFactory1 IDXGIFactoryN
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
virtual RenderTarget * detachRenderTarget(const String &name)
Detaches the render target with the passed name from the render system and returns a pointer to it.
void postExtraThreadsStarted()
bool checkVertexTextureFormats(void)
void setScissorTest(bool enabled, size_t left=0, size_t top=0, size_t right=800, size_t bottom=600)
Sets the 'scissor region' i.e.
void unbindGpuProgram(GpuProgramType gptype)
See RenderSystem.
D3D11_BLEND_DESC mBlendDesc
D3D11HLSLProgramFactory * mHLSLProgramFactory
GpuProgramType
Enumerates the types of programs which can run on the GPU.
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
ID3D11SamplerState * mBoundSamplerStates[OGRE_MAX_TEXTURE_LAYERS]
Real getHorizontalTexelOffset(void)
Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this...
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
Real getVerticalTexelOffset(void)
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this r...
void _setDepthBufferFunction(CompareFunction func=CMPF_LESS_EQUAL)
Sets the comparison function for the depth buffer check.
Class encapsulating a standard 4x4 homogeneous matrix.
A 'canvas' which can receive the results of a rendering operation.
String validateConfigOptions(void)
Validates the options set for the rendering system, returning a message if there are problems.
map< String, ConfigOption >::type ConfigOptionMap
SceneBlendFactor
Blending factors for manually blending objects with the scene.
void setClipPlane(ushort index, Real A, Real B, Real C, Real D)
void setLightingEnabled(bool enabled)
Sets whether or not dynamic lighting is enabled.
UINT mNumClassInstances[6]
PixelFormat
The pixel format used for images, textures, and render surfaces.
void _disableTextureUnit(size_t texUnit)
Turns off a texture unit.
An abstraction of a viewport, i.e.
FilterOptions FilterMinification[OGRE_MAX_TEXTURE_LAYERS]
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
void convertHullShaderCaps(RenderSystemCapabilities *rsc) const
void shutdown()
Shutdown the renderer and cleanup resources.
void setConfigOption(const String &name, const String &value)
Sets an option for this API.
size_t mBoundTexturesCount
void _setTextureCoordSet(size_t unit, size_t index)
Sets the texture coordinate set to use for a texture unit.
void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m, const Frustum *frustum=0)
Sets a method for automatically calculating texture coordinates for a stage.
VertexElementType getColourVertexElementType(void) const
Get the native VertexElementType for a compact 32-bit colour value for this rendersystem.
virtual bool hasAnisotropicMipMapFilter() const
Determines if the system has anisotropic mip map filter support.
void processInputDevices(void)
D3D11DriverList * mDriverList
List of D3D drivers installed (video cards)
bool _checkMultiSampleQuality(UINT SampleCount, UINT *outQuality, DXGI_FORMAT format)
check if a FSAA is supported
virtual void markProfileEvent(const String &eventName)
Marks an instantaneous event for graphics profilers.
struct Ogre::D3D11RenderSystem::sD3DTextureStageDesc mTexStageDesc[OGRE_MAX_TEXTURE_LAYERS]
FilterOptions
Filtering options for textures / mipmaps.
Wrapper class which indicates a given angle value is in Radians.
void setAmbientLight(float r, float g, float b)
Sets the colour & strength of the ambient (global directionless) light in the world.
void _setPolygonMode(PolygonMode level)
Sets how to rasterise triangles, as points, wireframe or solid polys.
void convertPixelShaderCaps(RenderSystemCapabilities *rsc) const
singleton class for storing the capabilities of the graphics card.
void convertGeometryShaderCaps(RenderSystemCapabilities *rsc) const
void convertVertexShaderCaps(RenderSystemCapabilities *rsc) const
D3D11_SAMPLER_DESC samplerDesc
D3D11HLSLProgram * mBoundTesselationDomainProgram
D3D11DriverList * getDirect3DDrivers(void)
structure holding texture unit settings for every stage
This class represents a render target that renders to multiple RenderTextures at once.
D3D11HLSLProgram * _getBoundGeometryProgram() const
CullingMode
Hardware culling modes based on vertex winding.
void _setTextureAddressingMode(size_t stage, const TextureUnitState::UVWAddressingMode &uvw)
Sets the texture addressing mode for a texture unit.
void destroyRenderTarget(const String &name)
Destroys a render target of any sort.
void _setViewport(Viewport *vp)
Sets the provided viewport as the active one for future rendering operations.
void setClipPlanesImpl(const PlaneList &clipPlanes)
Internal method used to set the underlying clip planes when needed.
void _convertProjectionMatrix(const Matrix4 &matrix, Matrix4 &dest, bool forGpuProgram=false)
Converts a uniform projection matrix to suitable for this render system.
HINSTANCE mhInstance
instance
int TrackVertexColourType
An enumeration describing which material properties should track the vertex colours.
void registerThread()
Register the an additional thread which may make calls to rendersystem-related objects.
vector< D3D11RenderWindowBase * >::type SecondaryWindowList
RenderWindow * _createRenderWindow(const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams=0)
Creates a new rendering window.
static const ColourValue White
ID3D11RasterizerState * mBoundRasterizer
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
void reinitialise()
Restart the renderer (normally following a change in settings).
D3D11HLSLProgram * mBoundVertexProgram
void setShadingType(ShadeOptions so)
Sets the type of light shading required (default = Gouraud).
D3D_FEATURE_LEVEL mMaxRequestedFeatureLevel
TexCoordCalcMethod autoTexCoordType
type of auto tex. calc. used
void _endFrame(void)
Ends rendering of a frame to the current viewport.
void _makeOrthoMatrix(const Radian &fovy, Real aspect, Real nearPlane, Real farPlane, Matrix4 &dest, bool forGpuProgram=false)
Builds an orthographic projection matrix suitable for this render system.
void _setTextureBorderColour(size_t stage, const ColourValue &colour)
Sets the texture border colour for a texture unit.
void _setPointSpritesEnabled(bool enabled)
Sets whether or not rendering points using OT_POINT_LIST will render point sprites (textured quads) o...
virtual void endProfileEvent(void)
Ends the currently active GPU profiling event.
std::map< String, ID3D11ClassInstance * >::iterator ClassInstanceIterator
D3D11Driver * mActiveD3DDriver
Currently active driver.
ID3D11ShaderResourceView * mBoundTextures[OGRE_MAX_TEXTURE_LAYERS]
Real getMaximumDepthInputValue(void)
Gets the maximum (farthest) depth value to be used when rendering using identity transforms.
void _setWorldMatrix(const Matrix4 &m)
Sets the world transform matrix.
DepthBuffer * _addManualDepthBuffer(ID3D11DepthStencilView *depthSurface, uint32 width, uint32 height, uint32 fsaa, uint32 fsaaQuality)
This function is meant to add Depth Buffers to the pool that aren't released when the DepthBuffer is ...
bool mSceneAlphaToCoverage
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
void convertComputeShaderCaps(RenderSystemCapabilities *rsc) const
virtual String getErrorDescription(long errorNumber) const
Returns a description of an error code.
bool _checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage)
Check whether or not filtering is supported for the precise texture format requested with the given u...
Class representing colour.
D3D11_DEPTH_STENCIL_DESC mDepthStencilDesc
void _setTextureUnitCompareEnabled(size_t unit, bool compare)
Sets whether the compare func is enabled or not for this texture unit.
void getCustomAttribute(const String &name, void *pData)
Gets a custom (maybe platform-specific) attribute.
void _setDepthBufferWriteEnabled(bool enabled=true)
Sets whether or not the depth buffer is updated after a pixel write.
void _setDepthBufferParams(bool depthTest=true, bool depthWrite=true, CompareFunction depthFunction=CMPF_LESS_EQUAL)
Sets the mode of operation for depth buffer tests from this point onwards.
D3D11HLSLProgram * _getBoundComputeProgram() const
void _setTextureBlendMode(size_t unit, const LayerBlendModeEx &bm)
Sets the texture blend modes from a TextureUnitState record.
RenderWindow * _initialise(bool autoCreateWindow, const String &windowTitle="OGRE Render Window")
Start up the renderer using the settings selected (Or the defaults if none have been selected).
D3D11GpuProgramManager * mGpuProgramManager
bool mBasicStatesInitialised
virtual MultiRenderTarget * createMultiRenderTarget(const String &name)
Create a MultiRenderTarget, which is a render target that renders to multiple RenderTextures at once.
D3D_FEATURE_LEVEL _getFeatureLevel() const
void _setDepthBufferCheckEnabled(bool enabled=true)
Sets whether or not the depth buffer check is performed before a pixel write.
virtual void initConfigOptions(void)
static const ColourValue Black
This class represents a RenderTarget that renders to a Texture.
ShadeOptions
Light shading modes.
const String & getName(void) const
Returns the name of the rendering system.
D3D11Device mDevice
Direct3D.
FilterOptions FilterMips[OGRE_MAX_TEXTURE_LAYERS]
const Frustum * frustum
Frustum, used if the above is projection.
Texture addressing mode for each texture coordinate.
void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter)
Sets a single filter for a given texture unit.
void setSubroutine(GpuProgramType gptype, unsigned int slotIndex, const String &subroutineName)
void setVertexBufferBinding(VertexBufferBinding *binding)
Sets the current vertex buffer binding state.
float Real
Software floating point type.
D3D11HardwareBufferManagerBase as a Singleton.
TextureType
Enum identifying the texture type.
Implementation of DirectX11 as a rendering system.
D3D11_RASTERIZER_DESC mRasterizerDesc
void bindGpuProgram(GpuProgram *prg)
See RenderSystem.
virtual void beginProfileEvent(const String &eventName)
This marks the beginning of an event for GPU profiling.
D3D11HLSLProgram * _getBoundVertexProgram() const
void _setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendOperation op=SBO_ADD)
Sets the global blending factors for combining subsequent renders with the existing frame contents.
HardwareOcclusionQuery * createHardwareOcclusionQuery(void)
Create an object for performing hardware occlusion queries.
bool mRenderSystemWasInited
unsigned char mSceneAlphaRejectValue
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
LayerBlendModeEx layerBlendMode
void _beginFrame(void)
Signifies the beginning of a frame, i.e.
void _setPointParameters(Real size, bool attenuationEnabled, Real constant, Real linear, Real quadratic, Real minSize, Real maxSize)
Sets the size of points and how they are attenuated with distance.
void _setTexture(size_t unit, bool enabled, const TexturePtr &texPtr)
Sets the texture to bind to a given texture unit.
RenderTexture * createRenderTexture(const String &name, unsigned int width, unsigned int height, TextureType texType=TEX_TYPE_2D, PixelFormat internalFormat=PF_X8R8G8B8, const NameValuePairList *miscParams=0)
@ PF_X8R8G8B8
32-bit pixel format, 8 bits for red, 8 bits for green, 8 bits for blue like PF_A8R8G8B8,...
void _setRenderTarget(RenderTarget *target)
Set current render target to target, enabling its GL context if needed.
@ TEX_TYPE_2D
2D texture, used in combination with 2D texture coordinates (default)
void _setTextureMatrix(size_t unit, const Matrix4 &xform)
Sets the texture coordinate transformation matrix for a texture unit.
D3D11HardwareBufferManager * mHardwareBufferManager
CompareFunction mSceneAlphaRejectFunc
void _setSurfaceParams(const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess, TrackVertexColourType tracking)
Sets the surface properties to be used for future rendering.
vector< Plane >::type PlaneList
PolygonMode
The polygon mode to use when rasterising.
bool mUseNVPerfHUD
NVPerfHUD allowed?
void _setTextureUnitCompareFunction(size_t unit, CompareFunction function)
Sets the compare function to use for a given texture unit.
bool _getDepthBufferCheckEnabled(void)
'New' rendering operation using vertex buffers.
void unregisterThread()
Unregister an additional thread which may make calls to rendersystem-related objects.
void _setTextureMipmapBias(size_t unit, float bias)
Sets the mipmap bias value for a given texture unit.
size_t coordIndex
which texCoordIndex to use
void _setDepthBias(float constantBias, float slopeScaleBias)
Sets the depth bias, NB you should use the Material version of this.
ID3D11DepthStencilState * mBoundDepthStencilState
void setNormaliseNormals(bool normalise)
Sets whether or not normals are to be automatically normalised.
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
void enableClipPlane(ushort index, bool enable)
void _makeProjectionMatrix(const Radian &fovy, Real aspect, Real nearPlane, Real farPlane, Matrix4 &dest, bool forGpuProgram=false)
Builds a perspective projection matrix suitable for this render system.
D3D11HLSLProgram * mBoundFragmentProgram
D3D11RenderWindowBase * mPrimaryWindow
Primary window, the one used to create the device.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15