28 #ifndef __D3D11RENDERSYSTEM_H__
29 #define __D3D11RENDERSYSTEM_H__
43 class D3D11DriverList;
181 ID3D11ShaderResourceView *
pTex;
245 bool twoSidedOperation =
false);
283 void _setDepthBias(
float constantBias,
float slopeScaleBias);
286 Matrix4& dest,
bool forGpuProgram =
false);
288 Matrix4& dest,
bool forGpuProgram =
false);
290 Real farPlane,
Matrix4& dest,
bool forGpuProgram =
false);
292 Matrix4& dest,
bool forGpuProgram =
false);
318 void setScissorTest(
bool enabled,
size_t left = 0,
size_t top = 0,
size_t right = 800,
size_t bottom = 600);
321 Real depth = 1.0f,
unsigned short stencil = 0);
Manages the target rendering window.
OGRE_D3D11_DRIVER_TYPE mDriverType
unsigned int getDisplayMonitorCount() const
Gets the number of display monitors.
void _endFrame(void)
Ends rendering of a frame to the current viewport.
A 'canvas' which can receive the results of a rendering operation.
void setStencilCheckEnabled(bool enabled)
Turns stencil buffer checking on or off.
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.
D3D11Device mDevice
Direct3D.
Class encapsulating a standard 4x4 homogeneous matrix.
void setClipPlane(ushort index, Real A, Real B, Real C, Real D)
float Real
Software floating point type.
VertexElementType getColourVertexElementType(void) const
Get the native VertexElementType for a compact 32-bit colour value for this rendersystem.
void _setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy)
Sets the maximal anisotropy for the specified texture unit.
struct Ogre::D3D11RenderSystem::sD3DTextureStageDesc mTexStageDesc[OGRE_MAX_TEXTURE_LAYERS]
unsigned char mSceneAlphaRejectValue
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Defines a plane in 3D space.
bool checkVertexTextureFormats(void)
Leave the stencil buffer unchanged.
FixedFuncEmuShaderManager mFixedFuncEmuShaderManager
DWORD _getCurrentAnisotropy(size_t unit)
return anisotropy level
void refreshD3DSettings(void)
void unregisterThread()
Unregister an additional thread which may make calls to rendersystem-related objects.
void _convertProjectionMatrix(const Matrix4 &matrix, Matrix4 &dest, bool forGpuProgram=false)
Converts a uniform projection matrix to suitable for this render system.
This class represents a RenderTarget that renders to a Texture.
Class representing colour.
GpuProgramType
Enumerates the types of programs which can run on the GPU.
void _setTextureMipmapBias(size_t unit, float bias)
Sets the mipmap bias value for a given texture unit.
static const ColourValue White
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.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
D3D11_SAMPLER_DESC samplerDesc
D3D11_RASTERIZER_DESC mRasterizerDesc
void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter)
Sets a single filter for a given texture unit.
void _setRenderTarget(RenderTarget *target)
Set current render target to target, enabling its GL context if needed.
void registerThread()
Register the an additional thread which may make calls to rendersystem-related objects.
Defines a program which runs on the GPU such as a vertex or fragment program.
bool mUseNVPerfHUD
NVPerfHUD allowed?
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
bool mPerStageConstantSupport
Per-stage constant support? (not in main caps since D3D specific & minor)
D3D11HLSLProgramFactory * mHLSLProgramFactory
D3D11RenderWindow * mPrimaryWindow
Primary window, the one used to create the device.
ID3D11ShaderResourceView * mBoundTextures[OGRE_MAX_TEXTURE_LAYERS]
void _setAlphaRejectSettings(CompareFunction func, unsigned char value, bool alphaToCoverage)
Sets the global alpha rejection approach for future renders.
void refreshFSAAOptions(void)
void bindGpuProgram(GpuProgram *prg)
See RenderSystem.
D3D11GpuProgramManager * mGpuProgramManager
void convertVertexShaderCaps(RenderSystemCapabilities *rsc) const
virtual String getErrorDescription(long errorNumber) const
Returns a description of an error code.
virtual MultiRenderTarget * createMultiRenderTarget(const String &name)
Create a MultiRenderTarget, which is a render target that renders to multiple RenderTextures at once...
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...
SceneBlendFactor
Blending factors for manually blending objects with the scene.
Real getVerticalTexelOffset(void)
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this r...
Real getMaximumDepthInputValue(void)
Gets the maximum (farthest) depth value to be used when rendering using identity transforms.
ID3D11DepthStencilState * mBoundDepthStencilState
void determineFSAASettings(uint fsaa, const String &fsaaHint, DXGI_FORMAT format, DXGI_SAMPLE_DESC *outFSAASettings)
ID3D11RasterizerState * mBoundRasterizer
void bindGpuProgramPassIterationParameters(GpuProgramType gptype)
See RenderSystem.
String validateConfigOptions(void)
Validates the options set for the rendering system, returning a message if there are problems...
CullingMode
Hardware culling modes based on vertex winding.
void setStencilBufferParams(CompareFunction func=CMPF_ALWAYS_PASS, uint32 refValue=0, uint32 mask=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.
const String & getName(void) const
Returns the name of the rendering system.
This class represents a render target that renders to multiple RenderTextures at once.
void unbindGpuProgram(GpuProgramType gptype)
See RenderSystem.
ID3D11SamplerState * mBoundSamplerStates[OGRE_MAX_TEXTURE_LAYERS]
size_t coordIndex
which texCoordIndex to use
D3D11_BLEND_DESC mBlendDesc
This is a abstract class that that provides the interface for the query class for hardware occlusion...
void _setTextureBlendMode(size_t unit, const LayerBlendModeEx &bm)
Sets the texture blend modes from a TextureUnitState record.
size_t mBoundSamplerStatesCount
void _setDepthBufferWriteEnabled(bool enabled=true)
Sets whether or not the depth buffer is updated after a pixel write.
bool mBasicStatesInitialised
vector< Plane >::type PlaneList
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
RenderSystemCapabilities * createRenderSystemCapabilities() const
Internal method for populating the capabilities structure.
ID3D11BlendState * mBoundBlendState
void setConfigOption(const String &name, const String &value)
Sets an option for this API.
void _setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendOperation op=SBO_ADD)
Sets the global blending factors for combining subsequent renders with the existing frame contents...
void reinitialise()
Restart the renderer (normally following a change in settings).
IDXGIFactory1 * mpDXGIFactory
ShadeOptions
Light shading modes.
D3D11DriverList * mDriverList
List of D3D drivers installed (video cards)
void _setTexture(size_t unit, bool enabled, const TexturePtr &texPtr)
Sets the texture to bind to a given texture unit.
bool _checkMultiSampleQuality(UINT SampleCount, UINT *outQuality, DXGI_FORMAT format)
check if a FSAA is supported
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 (...
FixedFuncPrograms::FixedFuncProgramsParameters mFixedFuncProgramsParameters
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.
Class defining a fixed function state.
PixelFormat
The pixel format used for images, textures, and render surfaces.
32-bit pixel format, 8 bits for red, 8 bits for green, 8 bits for blue like PF_A8R8G8B8, but alpha will get discarded
void _render(const RenderOperation &op)
Render something to the active viewport.
void _setCullingMode(CullingMode mode)
Sets the culling mode for the render system based on the 'vertex winding'.
Texture addressing mode for each texture coordinate.
map< String, ConfigOption >::type ConfigOptionMap
HardwareOcclusionQuery * createHardwareOcclusionQuery(void)
Create an object for performing hardware occlusion queries.
size_t mLastVertexSourceCount
LayerBlendModeEx layerBlendMode
FilterOptions FilterMinification
void setNormaliseNormals(bool normalise)
Sets whether or not normals are to be automatically normalised.
void postExtraThreadsStarted()
SecondaryWindowList mSecondaryWindows
void _setPointSpritesEnabled(bool enabled)
Sets whether or not rendering points using OT_POINT_LIST will render point sprites (textured quads) o...
FixedFuncState mFixedFuncState
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...
void _disableTextureUnit(size_t texUnit)
Turns off a texture unit.
TexCoordCalcMethod autoTexCoordType
type of auto tex. calc. used
Specialisation of SharedPtr to allow SharedPtr to be assigned to TexturePtr.
void _setViewMatrix(const Matrix4 &m)
Sets the view transform matrix.
void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m, const Frustum *frustum=0)
Sets a method for automatically calculating texture coordinates for a stage.
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.
void _setProjectionMatrix(const Matrix4 &m)
Sets the projection transform matrix.
FilterOptions FilterMagnification
ID3D11ShaderResourceView * pTex
texture
D3D11HardwareBufferManagerBase as a Singleton.
void setClipPlanesImpl(const PlaneList &clipPlanes)
Internal method used to set the underlying clip planes when needed.
void setScissorTest(bool enabled, size_t left=0, size_t top=0, size_t right=800, size_t bottom=600)
Sets the 'scissor region' ie the region of the target in which rendering can take place...
HINSTANCE mhInstance
instance
void _setPolygonMode(PolygonMode level)
Sets how to rasterise triangles, as points, wireframe or solid polys.
void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha)
Sets whether or not colour buffer writing is enabled, and for which channels.
const Frustum * frustum
Frustum, used if the above is projection.
void _setWorldMatrix(const Matrix4 &m)
Sets the world transform matrix.
void setLightingEnabled(bool enabled)
Sets whether or not dynamic lighting is enabled.
void setShadingType(ShadeOptions so)
Sets the type of light shading required (default = Gouraud).
void preExtraThreadsStarted()
Tell the rendersystem to perform any prep tasks it needs to directly before other threads which might...
void _setVertexTexture(size_t unit, const TexturePtr &tex)
Binds a texture to a vertex sampler.
void convertGeometryShaderCaps(RenderSystemCapabilities *rsc) const
D3D11_DEPTH_STENCIL_DESC mDepthStencilDesc
An abstraction of a viewport, i.e.
'New' rendering operation using vertex buffers.
void shutdown()
Shutdown the renderer and cleanup resources.
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
structure holding texture unit settings for every stage
D3D11HLSLProgram * mBoundVertexProgram
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.
void _setTextureAddressingMode(size_t stage, const TextureUnitState::UVWAddressingMode &uvw)
Sets the texture addressing mode for a texture unit.
ConfigOptionMap & getConfigOptions(void)
Returns the details of this API's configuration options.
virtual void initConfigOptions(void)
void enableClipPlane(ushort index, bool enable)
void _setDepthBufferFunction(CompareFunction func=CMPF_LESS_EQUAL)
Sets the comparison function for the depth buffer check.
void processInputDevices(void)
vector< D3D11RenderWindow * >::type SecondaryWindowList
Wrapper class which indicates a given angle value is in Radians.
D3D11RenderSystem(HINSTANCE hInstance)
void _setDepthBufferCheckEnabled(bool enabled=true)
Sets whether or not the depth buffer check is performed before a pixel write.
void initialiseFromRenderSystemCapabilities(RenderSystemCapabilities *caps, RenderTarget *primary)
See RenderSystem definition.
TextureType
Enum identifying the texture type.
D3D11HardwareBufferManager * mHardwareBufferManager
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.
PolygonMode
The polygon mode to use when rasterising.
size_t mBoundTexturesCount
void setVertexBufferBinding(VertexBufferBinding *binding)
Sets the current vertex buffer binding state.
void initInputDevices(void)
void setAmbientLight(float r, float g, float b)
Sets the colour & strength of the ambient (global directionless) light in the world.
static const ColourValue Black
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
D3D11Driver * mActiveD3DDriver
Currently active driver.
void _applyObliqueDepthProjection(Matrix4 &matrix, const Plane &plane, bool forGpuProgram)
Update a perspective projection matrix to use 'oblique depth projection'.
Implementation of DirectX9 as a rendering system.
2D texture, used in combination with 2D texture coordinates (default)
void _setTextureCoordSet(size_t unit, size_t index)
Sets the texture coordinate set to use for a texture unit.
singleton class for storing the capabilities of the graphics card.
void _beginFrame(void)
Signifies the beginning of a frame, i.e.
void _setViewport(Viewport *vp)
Sets the provided viewport as the active one for future rendering operations.
void _setDepthBias(float constantBias, float slopeScaleBias)
Sets the depth bias, NB you should use the Material version of this.
StencilOperation
Enum describing the various actions which can be taken onthe stencil buffer.
FilterOptions
Filtering options for textures / mipmaps.
void _setTextureMatrix(size_t unit, const Matrix4 &xform)
Sets the texture coordinate transformation matrix for a texture unit.
void convertPixelShaderCaps(RenderSystemCapabilities *rsc) const
Defines the functionality of a 3D API.
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
void _setTextureBorderColour(size_t stage, const ColourValue &colour)
Sets the texture border colour for a texture unit.
int TrackVertexColourType
An enumeration describing which material properties should track the vertex colours.
Real getMinimumDepthInputValue(void)
Gets the minimum (closest) depth value to be used when rendering using identity transforms.
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
Class which manages blending of both colour and alpha components.
void bindGpuProgramParameters(GpuProgramType gptype, GpuProgramParametersSharedPtr params, uint16 mask)
See RenderSystem.
bool mSceneAlphaToCoverage
TextureType type
the type of the texture
Hlsl4FixedFuncEmuShaderGenerator mHlslFixedFuncEmuShaderGenerator
D3D11DriverList * getDirect3DDrivers(void)
structure holding texture unit settings for every stage
Specialization of HighLevelGpuProgram to provide support for D3D11 High-Level Shader Language (HLSL)...
RenderTexture * createRenderTexture(const String &name, unsigned int width, unsigned int height, TextureType texType=TEX_TYPE_2D, PixelFormat internalFormat=PF_X8R8G8B8, const NameValuePairList *miscParams=0)
D3D11HLSLProgram * mBoundGeometryProgram
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)...
D3D11_SAMPLER_DESC currentSamplerDesc
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.
Factory class for D3D11 HLSL programs.
void setVertexDeclaration(VertexDeclaration *decl)
Sets the current vertex declaration, ie the source of vertex data.
void destroyRenderTarget(const String &name)
Destroys a render target of any sort.
CompareFunction mSceneAlphaRejectFunc
RenderWindow * _createRenderWindow(const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams=0)
Creates a new rendering window.