Shader Class Reference

Inheritance diagram for Shader:
Shader_Postprocess Shader_Unreal Shader_Dummy Shader_FinalPass Shader_FirstPass Shader_HDR Shader_ComplexSurface Shader_FogSurface Shader_GouraudPolygon Shader_Tile

List of all members.

Classes

struct  StateStruct

Public Member Functions

virtual bool compile (const D3D10_SHADER_MACRO *macros, DWORD shaderFlags)=0
virtual bool createRenderTargetViews (ID3D10RenderTargetView *backbuffer, const DXGI_SWAP_CHAIN_DESC &swapChainDesc, int multiSampleCount)=0
virtual void releaseRenderTargetViews ()
virtual void bind ()
virtual void apply ()
GeometryBuffergetGeometryBuffer () const
ID3D10ShaderResourceView * getResourceView () const
virtual void setFlags (int flags)

Static Public Member Functions

static bool initShaderSystem (ID3D10Device *device, const D3D10_SHADER_MACRO *macros, DWORD shaderFlags)

Protected Member Functions

bool createRenderTargetViews (DXGI_FORMAT format, DXGI_FORMAT depthFormat, float scaleX, float scaleY, int samples, const DXGI_SWAP_CHAIN_DESC &swapChainDesc)

Static Protected Member Functions

static bool checkCompileResult (HRESULT hr)

Protected Attributes

GeometryBuffergeometryBuffer
ID3D10RenderTargetView * renderTargetView
ID3D10DepthStencilView * depthStencilView
ID3D10InputLayout * vertexLayout
ID3D10ShaderResourceView * shaderResourceView
ID3D10Effect * effect
D3D10_PRIMITIVE_TOPOLOGY topology
HRESULT hr

Static Protected Attributes

static struct Shader::StateStruct states
static ID3D10Blob * blob
static ID3D10Device * device

Member Function Documentation

void Shader::apply (  )  [virtual]

Draw the shader's buffer contents.

Reimplemented in Shader_ComplexSurface, Shader_Dummy, and Shader_HDR.

bool Shader::checkCompileResult ( HRESULT  hr  )  [static, protected]

Check shader compile result and show errors if applicable.

bool Shader::createRenderTargetViews ( DXGI_FORMAT  format,
DXGI_FORMAT  depthFormat,
float  scaleX,
float  scaleY,
int  samples,
const DXGI_SWAP_CHAIN_DESC &  swapChainDesc 
) [protected]

Create render target, depth and resource views.

Parameters:
samples Desired multisample amount for these buffers (can be different than what the game is using)
Note:
If a format is null the buffer/view will be skipped.
bool Shader::initShaderSystem ( ID3D10Device *  device,
const D3D10_SHADER_MACRO *  macros,
DWORD  shaderFlags 
) [static]

Global initialization of shader subsystem

void Shader::setFlags ( int  flags  )  [virtual]

Handle flags that change depth or blend state. See polyflags.h. Only done if flag is different from current. If there's any buffered geometry, it will drawn before setting the new flags.

Parameters:
flags Unreal polyflags.
d3dflags Custom flags defined in d3d.h.
Note:
Bottleneck; make sure buffers are only rendered due to flag changes when absolutely necessary

Reimplemented in Shader_ComplexSurface.


Member Data Documentation

Shader::StateStruct Shader::states [static, protected]

Main shader class, offers housekeeping and helper functions.


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2