3ds Max C++ API Reference
RasterizerState Class Reference

This class encapsulates a complete rasterizer state, like fill mode, cull mode, point size, etc. More...

#include <RenderStates.h>

+ Inheritance diagram for RasterizerState:

Classes

union  DepthBias
 The z buffer depth bias value Default value is 0. More...
 

Public Member Functions

 RasterizerState ()
 
virtual ~RasterizerState ()
 
virtual void SetFillMode (FillMode value)
 Set the raster fill mode. More...
 
virtual FillMode GetFillMode () const
 Get the raster fill mode /return the fill mode. More...
 
virtual void SetCullMode (CullMode value)
 Set culling mode, front face or back face. More...
 
virtual CullMode GetCullMode () const
 Get culling mode /return the culling mode. More...
 
virtual void SetColorInterpolationEnable (bool value)
 Sets whether color registers are interpolated between vertices. More...
 
virtual bool GetColorInterpolationEnable () const
 Gets whether color registers are interpolated between vertices. More...
 
virtual void SetDepthBias (float value)
 Set z buffer depth bias value by float /param value float depth bias. More...
 
virtual void SetDepthBias (int value)
 Set z buffer depth bias value by int /param value int depth bias. More...
 
virtual bool IsFloatDepthBias ()
 Get depth bias is float or int /return true if using float depth bias, false if it's int. More...
 
virtual float GetDepthBiasFloat () const
 Get float depth bias /return depth bias. More...
 
virtual int GetDepthBiasInt () const
 Get int depth bias /return depth bias. More...
 
virtual void SetDepthBiasClamp (float value)
 Set the z buffer depth bias clamp value. More...
 
virtual float GetDepthBiasClamp () const
 get the depth bias clamp value /return depth bias clamp More...
 
virtual void SetSlopeScaledDepthBias (float value)
 Set the slope scaled depth bias value. More...
 
virtual float GetSlopeScaledDepthBias () const
 Get the slope scaled depth bias value /return slope scaled depth bias value. More...
 
virtual void SetDepthClipEnabled (bool value)
 Set if depth clipping is enabled. More...
 
virtual bool GetDepthClipEnabled () const
 Get if depth clipping is enabled /return true if enabled, false if not. More...
 
virtual void SetScissorEnabled (bool value)
 Set scissor clipping state. More...
 
virtual bool GetScissorEnabled () const
 Get scissor clipping state. More...
 
virtual void SetMultiSampleEnabled (bool value)
 MultiSample state. More...
 
virtual bool GetMultiSampleEnabled () const
 Get MultiSample State /return true if multi-sample enabled, false if not. More...
 
virtual void SetPointSize (float value)
 Set vertex point size. More...
 
virtual float GetPointSize () const
 Get vertex point size. More...
 

Protected Attributes

FillMode mFillMode
 The raster fill mode. More...
 
CullMode mCullMode
 The culling mode, front face or back face. More...
 
bool mColorInterpolationEnabled
 Sets whether color registers are interpolated between vertices. More...
 
bool mIsFloatDepthBias
 The z buffer depth bias type: float or int. More...
 
float mDepthBiasClamp
 the z buffer depth bias clamp value. More...
 
float mSlopeScaledDepthBias
 the slope scaled depth bias value. More...
 
bool mDepthClipEnabled
 Indicate if depth clipping is enabled. More...
 
bool mScissorEnabled
 scissor clipping state Default value is false More...
 
bool mMultiSampleEnabled
 Multisample state Default value is false. More...
 
float mPointSize
 Vertex point size Note this property only works for DirectX9 device Default value is 1.0. More...
 
DepthBias mDepthBias
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

This class encapsulates a complete rasterizer state, like fill mode, cull mode, point size, etc.

Constructor & Destructor Documentation

◆ RasterizerState()

◆ ~RasterizerState()

virtual ~RasterizerState ( )
inlinevirtual
29 {}

Member Function Documentation

◆ SetFillMode()

virtual void SetFillMode ( FillMode  value)
virtual

Set the raster fill mode.

Default value is FillSolid /param value new mode

◆ GetFillMode()

virtual FillMode GetFillMode ( ) const
virtual

Get the raster fill mode /return the fill mode.

◆ SetCullMode()

virtual void SetCullMode ( CullMode  value)
virtual

Set culling mode, front face or back face.

Default value is CullModeCCW /param value new cull mode

◆ GetCullMode()

virtual CullMode GetCullMode ( ) const
virtual

Get culling mode /return the culling mode.

◆ SetColorInterpolationEnable()

virtual void SetColorInterpolationEnable ( bool  value)
virtual

Sets whether color registers are interpolated between vertices.

If disabled, this will provide flat shading for effects that use the color registers; otherwise Gouraud (smooth) shading is performed. Default value is true. /param value true to enable color interpolation, false to disable

◆ GetColorInterpolationEnable()

virtual bool GetColorInterpolationEnable ( ) const
virtual

Gets whether color registers are interpolated between vertices.

/return true if the color interpolation is enabled, false if disabled.

◆ SetDepthBias() [1/2]

virtual void SetDepthBias ( float  value)
virtual

Set z buffer depth bias value by float /param value float depth bias.

◆ SetDepthBias() [2/2]

virtual void SetDepthBias ( int  value)
virtual

Set z buffer depth bias value by int /param value int depth bias.

◆ IsFloatDepthBias()

virtual bool IsFloatDepthBias ( )
virtual

Get depth bias is float or int /return true if using float depth bias, false if it's int.

◆ GetDepthBiasFloat()

virtual float GetDepthBiasFloat ( ) const
virtual

Get float depth bias /return depth bias.

◆ GetDepthBiasInt()

virtual int GetDepthBiasInt ( ) const
virtual

Get int depth bias /return depth bias.

◆ SetDepthBiasClamp()

virtual void SetDepthBiasClamp ( float  value)
virtual

Set the z buffer depth bias clamp value.

Default value is 0 /param value depth bias clamp

◆ GetDepthBiasClamp()

virtual float GetDepthBiasClamp ( ) const
virtual

get the depth bias clamp value /return depth bias clamp

◆ SetSlopeScaledDepthBias()

virtual void SetSlopeScaledDepthBias ( float  value)
virtual

Set the slope scaled depth bias value.

Default value is 0 /param value scaled depth bias value

◆ GetSlopeScaledDepthBias()

virtual float GetSlopeScaledDepthBias ( ) const
virtual

Get the slope scaled depth bias value /return slope scaled depth bias value.

◆ SetDepthClipEnabled()

virtual void SetDepthClipEnabled ( bool  value)
virtual

Set if depth clipping is enabled.

Default value is true. If enabled, depth values out of the 0-1 range are clipped. If false, the GPU will first clamp the depth value to 0-1, then clip any values where the w < 0. This is mostly used by shadow volume techniques to avoid near and far clipping problems. It could also be used by a renderer where one object is behind everything (e.g. an environment hemisphere) that would normally be clipped by the far clip plane; turning off clipping would instead clamp the z-depth of this object to 1.0 and so display it behind everything. In summary, this value should very rarely be set to false. /param value true to enable depth clipe, false to disable.

◆ GetDepthClipEnabled()

virtual bool GetDepthClipEnabled ( ) const
virtual

Get if depth clipping is enabled /return true if enabled, false if not.

◆ SetScissorEnabled()

virtual void SetScissorEnabled ( bool  value)
virtual

Set scissor clipping state.

Default value is false /param value true to enable scissor clipping, false to disable

◆ GetScissorEnabled()

virtual bool GetScissorEnabled ( ) const
virtual

Get scissor clipping state.

/return true if scissor is enabled, false if not.

◆ SetMultiSampleEnabled()

virtual void SetMultiSampleEnabled ( bool  value)
virtual

MultiSample state.

Default value is false /param value true to enable multi-sample, false to disable

◆ GetMultiSampleEnabled()

virtual bool GetMultiSampleEnabled ( ) const
virtual

Get MultiSample State /return true if multi-sample enabled, false if not.

◆ SetPointSize()

virtual void SetPointSize ( float  value)
virtual

Set vertex point size.

Default value is 1.0 Note this property only works for DirectX9 device /param value the point size.

◆ GetPointSize()

virtual float GetPointSize ( ) const
virtual

Get vertex point size.

/return vertex point size

Member Data Documentation

◆ mFillMode

FillMode mFillMode
protected

The raster fill mode.

Default value is FillSolid

◆ mCullMode

CullMode mCullMode
protected

The culling mode, front face or back face.

Default value is CullModeCCW

◆ mColorInterpolationEnabled

bool mColorInterpolationEnabled
protected

Sets whether color registers are interpolated between vertices.

If disabled, this will provide flat shading for effects that use the color registers; otherwise Gouraud (smooth) shading is performed. Default value is true.

◆ mIsFloatDepthBias

bool mIsFloatDepthBias
protected

The z buffer depth bias type: float or int.

Default value is false

◆ mDepthBiasClamp

float mDepthBiasClamp
protected

the z buffer depth bias clamp value.

Default value is 0

◆ mSlopeScaledDepthBias

float mSlopeScaledDepthBias
protected

the slope scaled depth bias value.

Default value is 0

◆ mDepthClipEnabled

bool mDepthClipEnabled
protected

Indicate if depth clipping is enabled.

If enabled, depth values out of the 0-1 range are clipped. If false, the GPU will first clamp the depth value to 0-1, then clip any values where the w < 0. This is mostly used by shadow volume techniques to avoid near and far clipping problems. It could also be used by a renderer where one object is behind everything (e.g. an environment hemisphere) that would normally be clipped by the far clip plane; turning off clipping would instead clamp the z-depth of this object to 1.0 and so display it behind everything. In summary, this value should very rarely be set to false.

◆ mScissorEnabled

bool mScissorEnabled
protected

scissor clipping state Default value is false

◆ mMultiSampleEnabled

bool mMultiSampleEnabled
protected

Multisample state Default value is false.

◆ mPointSize

float mPointSize
protected

Vertex point size Note this property only works for DirectX9 device Default value is 1.0.

◆ mDepthBias

DepthBias mDepthBias
protected