OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreD3D11RenderSystem.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __D3D11RENDERSYSTEM_H__
29 #define __D3D11RENDERSYSTEM_H__
30 
31 #include "OgreD3D11Prerequisites.h"
32 #include "OgreRenderSystem.h"
33 #include "OgreD3D11Device.h"
34 #include "OgreD3D11Mappings.h"
35 
36 namespace Ogre
37 {
38 #define MAX_LIGHTS 8
39 
40  class D3D11DriverList;
41  class D3D11Driver;
42 
47  {
48  private:
49 
50  // an enum to define the driver type of d3d11
52  {
53  DT_HARDWARE, // GPU based
54  DT_SOFTWARE, // microsoft original (slow) software driver
55  DT_WARP // microsoft new (faster) software driver - (Windows Advanced Rasterization Platform) - http://msdn.microsoft.com/en-us/library/dd285359.aspx
56 
57  };
58 
59  OGRE_D3D11_DRIVER_TYPE mDriverType; // d3d11 driver type
60  D3D_FEATURE_LEVEL mFeatureLevel;
61  D3D_FEATURE_LEVEL mMinRequestedFeatureLevel;
62  D3D_FEATURE_LEVEL mMaxRequestedFeatureLevel;
64  //int mpD3D;
67 
68  // Stored options
70 
72  HINSTANCE mhInstance;
73 
82 
84 
85 
87  void refreshD3DSettings(void);
88  void refreshFSAAOptions(void);
89  void freeDevice(void);
90 
91 // inline bool compareDecls( D3DVERTEXELEMENT9* pDecl1, D3DVERTEXELEMENT9* pDecl2, size_t size );
92 
93 
94  void initInputDevices(void);
95  void processInputDevices(void);
96 
98  DWORD _getCurrentAnisotropy(size_t unit);
100  bool _checkMultiSampleQuality(UINT SampleCount, UINT *outQuality, DXGI_FORMAT format);
101 
105 
107 
112 
119 
120  bool checkVertexTextureFormats(void);
121  void detachRenderTargetImpl(const String& name);
122 
123  CompareFunction mSceneAlphaRejectFunc; // should be merged with - mBlendDesc
124  unsigned char mSceneAlphaRejectValue; // should be merged with - mBlendDesc
126 
127  D3D11_BLEND_DESC mBlendDesc;
128 
129  D3D11_RASTERIZER_DESC mRasterizerDesc;
130 
132  D3D11_DEPTH_STENCIL_DESC mDepthStencilDesc;
133 
135 
140 
141  D3D11_RECT mScissorRect;
142 
144 
151 
153 
154  ID3D11ShaderResourceView* mDSTResView;
155  ID3D11BlendState * mBoundBlendState;
156  ID3D11RasterizerState * mBoundRasterizer;
157  ID3D11DepthStencilState * mBoundDepthStencilState;
160 
161  ID3D11ShaderResourceView * mBoundTextures[OGRE_MAX_TEXTURE_LAYERS];
163 
164  // List of class instances per shader stage
165  ID3D11ClassInstance* mClassInstances[6][8];
166 
167  // Number of class instances per shader stage
169 
170  // Store created shader subroutines, to prevent creation and destruction every frame
171  typedef std::map<String, ID3D11ClassInstance*> ClassInstanceMap;
172  typedef std::map<String, ID3D11ClassInstance*>::iterator ClassInstanceIterator;
174 
177  {
179  //D3D11Mappings::eD3DTexType texType;
182  size_t coordIndex;
186  const Frustum *frustum;
187 
189 
191  ID3D11ShaderResourceView *pTex;
192  D3D11_SAMPLER_DESC samplerDesc;
193  D3D11_SAMPLER_DESC currentSamplerDesc;
194  //ID3D11SamplerState * pSampler;
195  bool used;
197 
198 
199  // What follows is a set of duplicated lists just to make it
200  // easier to deal with lost devices
201 
204 
206  // List of additional windows after the first (swap chains)
208 
210 
212 
214  protected:
215  void setClipPlanesImpl(const PlaneList& clipPlanes);
216 
221  void _setRenderTargetViews();
222 
223  public:
224  // constructor
226 
227  // destructor
229 
230 
231  void initRenderSystem();
232 
233  virtual void initConfigOptions(void);
234 
235  // Overridden RenderSystem functions
238  RenderWindow* _initialise( bool autoCreateWindow, const String& windowTitle = "OGRE Render Window" );
240  RenderWindow* _createRenderWindow(const String &name, unsigned int width, unsigned int height,
241  bool fullScreen, const NameValuePairList *miscParams = 0);
242 
244  RenderTexture * createRenderTexture( const String & name, unsigned int width, unsigned int height,
245  TextureType texType = TEX_TYPE_2D, PixelFormat internalFormat = PF_X8R8G8B8,
246  const NameValuePairList *miscParams = 0 );
247 
249  virtual MultiRenderTarget * createMultiRenderTarget(const String & name);
250 
251  virtual DepthBuffer* _createDepthBufferFor( RenderTarget *renderTarget );
252 
258  DepthBuffer* _addManualDepthBuffer( ID3D11DepthStencilView *depthSurface,
259  uint32 width, uint32 height, uint32 fsaa, uint32 fsaaQuality );
260 
262  void _removeManualDepthBuffer(DepthBuffer *depthBuffer);
264  virtual RenderTarget * detachRenderTarget(const String &name);
265 
266  const String& getName(void) const;
267  void getCustomAttribute(const String& name, void* pData);
268  // Low-level overridden members
269  void setConfigOption( const String &name, const String &value );
270  void reinitialise();
271  void shutdown();
272  void setAmbientLight( float r, float g, float b );
273  void setShadingType( ShadeOptions so );
274  void setLightingEnabled( bool enabled );
275  void destroyRenderTarget(const String& name);
277  void setStencilCheckEnabled(bool enabled);
279  uint32 refValue = 0, uint32 compareMask = 0xFFFFFFFF, uint32 writeMask = 0xFFFFFFFF,
280  StencilOperation stencilFailOp = SOP_KEEP,
281  StencilOperation depthFailOp = SOP_KEEP,
282  StencilOperation passOp = SOP_KEEP,
283  bool twoSidedOperation = false,
284  bool readBackAsTexture = false);
285  void setNormaliseNormals(bool normalise);
286 
287  virtual String getErrorDescription(long errorNumber) const;
288 
289  // Low-level overridden members, mainly for internal use
296  void _useLights(const LightList& lights, unsigned short limit);
297  void _setWorldMatrix( const Matrix4 &m );
298  void _setViewMatrix( const Matrix4 &m );
299  void _setProjectionMatrix( const Matrix4 &m );
300  void _setSurfaceParams( const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess, TrackVertexColourType tracking );
301  void _setPointSpritesEnabled(bool enabled);
302  void _setPointParameters(Real size, bool attenuationEnabled,
303  Real constant, Real linear, Real quadratic, Real minSize, Real maxSize);
304  void _setTexture(size_t unit, bool enabled, const TexturePtr &texPtr);
306  void _setVertexTexture(size_t unit, const TexturePtr& tex);
307  void _setGeometryTexture(size_t unit, const TexturePtr& tex);
308  void _setComputeTexture(size_t unit, const TexturePtr& tex);
309  void _setTessellationHullTexture(size_t unit, const TexturePtr& tex);
310  void _setTessellationDomainTexture(size_t unit, const TexturePtr& tex);
311  void _disableTextureUnit(size_t texUnit);
312  void _setTextureCoordSet( size_t unit, size_t index );
313  void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m,
314  const Frustum* frustum = 0);
315  void _setTextureBlendMode( size_t unit, const LayerBlendModeEx& bm );
316  void _setTextureAddressingMode(size_t stage, const TextureUnitState::UVWAddressingMode& uvw);
317  void _setTextureBorderColour(size_t stage, const ColourValue& colour);
318  void _setTextureMipmapBias(size_t unit, float bias);
319  void _setTextureMatrix( size_t unit, const Matrix4 &xform );
321  void _setSeparateSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendFactor sourceFactorAlpha,
322  SceneBlendFactor destFactorAlpha, SceneBlendOperation op = SBO_ADD, SceneBlendOperation alphaOp = SBO_ADD);
323  void _setAlphaRejectSettings( CompareFunction func, unsigned char value, bool alphaToCoverage );
324  void _setViewport( Viewport *vp );
325  void _beginFrame(void);
326  void _endFrame(void);
327  void _setCullingMode( CullingMode mode );
328  void _setDepthBufferParams( bool depthTest = true, bool depthWrite = true, CompareFunction depthFunction = CMPF_LESS_EQUAL );
329  void _setDepthBufferCheckEnabled( bool enabled = true );
330  bool _getDepthBufferCheckEnabled( void );
331  void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha);
332  void _setDepthBufferWriteEnabled(bool enabled = true);
334  void _setDepthBias(float constantBias, float slopeScaleBias);
335  void _setFog( FogMode mode = FOG_NONE, const ColourValue& colour = ColourValue::White, Real expDensity = 1.0, Real linearStart = 0.0, Real linearEnd = 1.0 );
336  void _convertProjectionMatrix(const Matrix4& matrix,
337  Matrix4& dest, bool forGpuProgram = false);
338  void _makeProjectionMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane,
339  Matrix4& dest, bool forGpuProgram = false);
340  void _makeProjectionMatrix(Real left, Real right, Real bottom, Real top, Real nearPlane,
341  Real farPlane, Matrix4& dest, bool forGpuProgram = false);
342  void _makeOrthoMatrix(const Radian& fovy, Real aspect, Real nearPlane, Real farPlane,
343  Matrix4& dest, bool forGpuProgram = false);
344  void _applyObliqueDepthProjection(Matrix4& matrix, const Plane& plane,
345  bool forGpuProgram);
346  void _setPolygonMode(PolygonMode level);
347  void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter);
348  void _setTextureUnitCompareFunction(size_t unit, CompareFunction function);
349  void _setTextureUnitCompareEnabled(size_t unit, bool compare);
350  void _setTextureLayerAnisotropy(size_t unit, unsigned int maxAnisotropy);
354  void _renderUsingReadBackAsTexture(unsigned int passNr, Ogre::String variableName,unsigned int StartSlot);
355  void _render(const RenderOperation& op);
359  void bindGpuProgram(GpuProgram* prg);
363  void unbindGpuProgram(GpuProgramType gptype);
372 
373  void setScissorTest(bool enabled, size_t left = 0, size_t top = 0, size_t right = 800, size_t bottom = 600);
374  void clearFrameBuffer(unsigned int buffers,
375  const ColourValue& colour = ColourValue::Black,
376  Real depth = 1.0f, unsigned short stencil = 0);
377  void setClipPlane (ushort index, Real A, Real B, Real C, Real D);
378  void enableClipPlane (ushort index, bool enable);
384  void registerThread();
385  void unregisterThread();
386  void preExtraThreadsStarted();
388 
392  void _setRenderTarget(RenderTarget *target);
393 
397  bool _checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage);
398 
399  void determineFSAASettings(uint fsaa, const String& fsaaHint, DXGI_FORMAT format, DXGI_SAMPLE_DESC* outFSAASettings);
400 
402  unsigned int getDisplayMonitorCount() const {return 1;} //todo
403 
405  virtual bool hasAnisotropicMipMapFilter() const { return true; }
406 
408 
409 
410  D3D_FEATURE_LEVEL _getFeatureLevel() const { return mFeatureLevel; }
411 
413  void setSubroutine(GpuProgramType gptype, unsigned int slotIndex, const String& subroutineName);
414 
416  void setSubroutine(GpuProgramType gptype, const String& slotName, const String& subroutineName);
417 
419  virtual void beginProfileEvent( const String &eventName );
420 
422  virtual void endProfileEvent( void );
423 
425  virtual void markProfileEvent( const String &eventName );
426  };
427 }
428 #endif
Leave the stencil buffer unchanged.
Definition: OgreCommon.h:90
Manages the target rendering window.
OGRE_D3D11_DRIVER_TYPE mDriverType
unsigned int getDisplayMonitorCount() const
Gets the number of display monitors.
TextureUnitState::BindingType mBindingType
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 depth-stencil buffer checking on or off.
D3D11HLSLProgram * _getBoundTessellationHullProgram() const
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.
std::map< String, ID3D11ClassInstance * > ClassInstanceMap
D3D11Device mDevice
Direct3D.
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
void setClipPlane(ushort index, Real A, Real B, Real C, Real D)
float Real
Software floating point type.
void _setComputeTexture(size_t unit, const TexturePtr &tex)
unsigned int uint32
Definition: OgrePlatform.h:420
void _removeManualDepthBuffer(DepthBuffer *depthBuffer)
Reverts _addManualDepthBuffer actions.
VertexElementType getColourVertexElementType(void) const
Get the native VertexElementType for a compact 32-bit colour value for this rendersystem.
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, bool readBackAsTexture=false)
Determines if this system supports hardware accelerated stencil buffer.
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]
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)
Definition: OgreCommon.h:580
Defines a plane in 3D space.
Definition: OgrePlane.h:61
FogMode
Fog modes.
Definition: OgreCommon.h:152
bool checkVertexTextureFormats(void)
DWORD _getCurrentAnisotropy(size_t unit)
return anisotropy level
std::map< String, ID3D11ClassInstance * >::iterator ClassInstanceIterator
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...
Definition: OgreFrustum.h:84
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.
void _setTextureUnitCompareEnabled(size_t unit, bool compare)
Sets whether the compare func is enabled or not for this texture unit.
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
void getCustomAttribute(const String &name, void *pData)
Gets a custom (maybe platform-specific) attribute.
ID3D11ShaderResourceView * mBoundTextures[OGRE_MAX_TEXTURE_LAYERS]
void _setTessellationDomainTexture(size_t unit, const TexturePtr &tex)
ID3D11ClassInstance * mClassInstances[6][8]
void _setAlphaRejectSettings(CompareFunction func, unsigned char value, bool alphaToCoverage)
Sets the global alpha rejection approach for future renders.
FilterType
Definition: OgreCommon.h:121
void refreshFSAAOptions(void)
virtual void beginProfileEvent(const String &eventName)
This marks the beginning of an event for GPU profiling.
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...
D3D11HLSLProgram * _getBoundTessellationDomainProgram() const
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...
ID3D11ShaderResourceView * mDSTResView
void convertComputeShaderCaps(RenderSystemCapabilities *rsc) const
SceneBlendFactor
Blending factors for manually blending objects with the scene.
BindingType
The type of unit to bind the texture settings to.
Real getVerticalTexelOffset(void)
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this r...
virtual void endProfileEvent(void)
Ends the currently active GPU profiling event.
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.
virtual DepthBuffer * _createDepthBufferFor(RenderTarget *renderTarget)
Creates a DepthBuffer that can be attached to the specified RenderTarget.
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.
Definition: OgreCommon.h:166
const String & getName(void) const
Returns the name of the rendering system.
No fog. Duh.
Definition: OgreCommon.h:155
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
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.
void _setDepthBufferWriteEnabled(bool enabled=true)
Sets whether or not the depth buffer is updated after a pixel write.
virtual RenderTarget * detachRenderTarget(const String &name)
Detaches the render target with the passed name from the render system and returns a pointer to it...
vector< Plane >::type PlaneList
Definition: OgrePlane.h:160
D3D11HLSLProgram * mBoundComputeProgram
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
Definition: OgreConfig.h:72
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.
An abstract class that contains a depth/stencil buffer.
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).
ShadeOptions
Light shading modes.
Definition: OgreCommon.h:144
D3D11DriverList * mDriverList
List of D3D drivers installed (video cards)
D3D11HLSLProgram * _getBoundComputeProgram() const
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 (...
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.
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.
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 ...
map< String, ConfigOption >::type ConfigOptionMap
vector< D3D11RenderWindowBase * >::type SecondaryWindowList
HardwareOcclusionQuery * createHardwareOcclusionQuery(void)
Create an object for performing hardware occlusion queries.
void _setRenderTargetViews()
With DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL flag render target views are unbound from us each Present()...
void setNormaliseNormals(bool normalise)
Sets whether or not normals are to be automatically normalised.
D3D_FEATURE_LEVEL mMinRequestedFeatureLevel
void _setTextureUnitCompareFunction(size_t unit, CompareFunction function)
Sets the compare function to use for a given texture unit.
SecondaryWindowList mSecondaryWindows
void _setPointSpritesEnabled(bool enabled)
Sets whether or not rendering points using OT_POINT_LIST will render point sprites (textured quads) o...
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
void _setViewMatrix(const Matrix4 &m)
Sets the view transform matrix.
D3D_FEATURE_LEVEL mMaxRequestedFeatureLevel
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[OGRE_MAX_TEXTURE_LAYERS]
D3D11HardwareBufferManagerBase as a Singleton.
FilterOptions FilterMips[OGRE_MAX_TEXTURE_LAYERS]
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' i.e.
D3D11RenderWindowBase * mPrimaryWindow
Primary window, the one used to create the device.
virtual void markProfileEvent(const String &eventName)
Marks an instantaneous event for graphics profilers.
void _setBindingType(TextureUnitState::BindingType bindingType)
Set texture unit binding type.
HINSTANCE mhInstance
instance
void _setPolygonMode(PolygonMode level)
Sets how to rasterise triangles, as points, wireframe or solid polys.
void convertHullShaderCaps(RenderSystemCapabilities *rsc) const
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.
D3D_FEATURE_LEVEL mFeatureLevel
void _setWorldMatrix(const Matrix4 &m)
Sets the world transform matrix.
unsigned short ushort
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
Definition: OgreCommon.h:87
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 detachRenderTargetImpl(const String &name)
void preExtraThreadsStarted()
Tell the rendersystem to perform any prep tasks it needs to directly before other threads which might...
D3D11HLSLProgram * _getBoundVertexProgram() const
void _setVertexTexture(size_t unit, const TexturePtr &tex)
Binds a texture to a vertex, geometry, compute, tessellation hull or tessellation domain sampler...
void _renderUsingReadBackAsTexture(unsigned int passNr, Ogre::String variableName, unsigned int StartSlot)
void convertGeometryShaderCaps(RenderSystemCapabilities *rsc) const
D3D11_DEPTH_STENCIL_DESC mDepthStencilDesc
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:56
'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)
D3D11HLSLProgram * _getBoundFragmentProgram() const
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)
void convertDomainShaderCaps(RenderSystemCapabilities *rsc) const
void setSubroutine(GpuProgramType gptype, unsigned int slotIndex, const String &subroutineName)
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:49
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.
Definition: OgreTexture.h:76
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.
Definition: OgreCommon.h:210
D3D_FEATURE_LEVEL _getFeatureLevel() const
void setVertexBufferBinding(VertexBufferBinding *binding)
Sets the current vertex buffer binding state.
void setAmbientLight(float r, float g, float b)
Sets the colour & strength of the ambient (global directionless) light in the world.
IDXGIFactory1 IDXGIFactoryN
FilterOptions FilterMinification[OGRE_MAX_TEXTURE_LAYERS]
static const ColourValue Black
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
D3D11Driver * mActiveD3DDriver
Currently active driver.
virtual bool hasAnisotropicMipMapFilter() const
Determines if the system has anisotropic mip map filter support.
void _applyObliqueDepthProjection(Matrix4 &matrix, const Plane &plane, bool forGpuProgram)
Update a perspective projection matrix to use 'oblique depth projection'.
Implementation of DirectX11 as a rendering system.
2D texture, used in combination with 2D texture coordinates (default)
Definition: OgreTexture.h:81
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.
_StringBase String
Definition: OgreCommon.h:53
bool _getDepthBufferCheckEnabled(void)
unsigned short uint16
Definition: OgrePlatform.h:421
FilterOptions
Filtering options for textures / mipmaps.
Definition: OgreCommon.h:131
void _setTextureMatrix(size_t unit, const Matrix4 &xform)
Sets the texture coordinate transformation matrix for a texture unit.
void convertPixelShaderCaps(RenderSystemCapabilities *rsc) const
void _setTessellationHullTexture(size_t unit, const TexturePtr &tex)
void _setGeometryTexture(size_t unit, const TexturePtr &tex)
Defines the functionality of a 3D API.
D3D11HLSLProgram * mBoundTessellationHullProgram
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:74
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.
Definition: OgreCommon.h:221
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.
TextureType type
the type of the texture
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
D3D11HLSLProgram * mBoundTessellationDomainProgram
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)...
D3D11HLSLProgram * _getBoundGeometryProgram() const
unsigned int uint
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.