This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::RenderState Class

Header:#include <UnigineRenderState.h>

RenderState Class

Members


RenderState * get()

int getBlendDestFunc()

Returns the destination blending function.

Return value

Destination blending function.

void setBlendFunc(int src, int dest)

Sets blending function (use the BLEND_* variables).

Arguments

  • int src - Source blending function.
  • int dest - Destination blending function.

int getBlendSrcFunc()

Returns the source blending function.

Return value

Source blending function.

void setBufferMask(int num, int mask)

Sets the buffer mask.

Arguments

  • int num - Buffer number.
  • int mask - Buffer mask.

int getBufferMask(int num)

Returns buffer mask.

Arguments

  • int num - Buffer number.

Return value

Buffer mask.

void setDepthFunc(int func)

Sets the depth function.

Arguments

  • int func - Depth function

int getDepthFunc()

Returns the current depth function.

Return value

The depth function (one of the DEPTH_* variables).

int getHeight()

Returns the viewport height.

Return value

Viewport height.

void setMaterial(const Ptr<Material> & material)

Sets the material.

Arguments

  • const Ptr<Material> & material - Material smart pointer..

Ptr<Material> getMaterial()

Returns the current material.

Return value

Material smart pointer.

float getPolygonBias()

Returns the polygon bias offset.

void setPolygonCull(int cull)

Sets the polygon cull mode.

Arguments

  • int cull - The polygon cull mode (one of the CULL_* variables).

int getPolygonCull()

Returns the polygon cull mode.

Return value

Polygon cull mode (one of the CULL_* variables).

void setPolygonFill(int fill)

Arguments

  • int fill - Polygon fill mode (one of the FILL_* variables).

int getPolygonFill()

Returns the polygon fill mode.

Return value

Polygon fill mode.

void setPolygonFront(int front)

Set the polygon mode to front.

Arguments

  • int front - 1 - enable the front mode; 0 - disable it.

int getPolygonFront()

Returns value indicating if the polygon front mode is set.

Return value

1 if the polygon front mode is set; otherwise - 0.

void setPolygonOffset(float bias, float offset)

Sets the polygon offset value.

Arguments

  • float bias - Polygon bias offset.
  • float offset - Polygon slope offset.

float getPolygonSlope()

Returns the polygon slope offset.

Return value

Polygon slope offset.

void setScissorTest(float x, float y, float width, float height)

Sets scissor test.

Arguments

  • float x - The X coordinate.
  • float y - The Y coordinate.
  • float width - Viewport width.
  • float height - Viewport height.

void setScissorTest(const Math::ivec4 & rectangle)

Arguments

  • const Math::ivec4 & rectangle

void setScissorTest(const Math::vec4 & rectangle)

Arguments

  • const Math::vec4 & rectangle

int getScissorTest()

Returns the scissors test status.

Return value

Scissors test status.

getScreenColorTexture()

Ptr<Texture> getScreenDepthTexture()

Returns the screen depth texture.

Return value

Texture smart pointer.

void setShader(const Ptr<Shader> & shader)

Sets the shader.

Arguments

  • const Ptr<Shader> & shader - Shader smart pointer.

Ptr<Shader> getShader()

void setStencilFunc(int func, int pass, int ref)

Sets the stencil function.

Arguments

  • int func - Stencil function.
  • int pass - Stencil operation.
  • int ref - Stencil reference value.

int getStencilFunc()

Returns the stencil function.

Return value

Stencil function.

int getStencilPass()

Returns the stencil mode.

Return value

The stencil mode (one of the STENCIL_* variables.)

int getStencilRef()

returns the stencil reference value.

Return value

Stencil reference value.

void setTexture(int binding, int num, const Ptr<Texture> & texture)

Sets the texture.

Arguments

  • int binding - Binding.
  • int num - Texture unit number.
  • const Ptr<Texture> & texture - Texture smart pointer.

Ptr<Texture> getTexture(int num)

Returns the current texture.

Arguments

  • int num

Return value

Texture smart pointer.

void setViewport(int x, int y, int width, int height)

Sets the viewport size and position.

Arguments

  • int x - The X coordinate.
  • int y - The Y coordinate.
  • int width - The width.
  • int height - The height.

int getWidth()

Returns the viewport width.

Return value

Viewport width.

void clearBuffer(int buffer, const Math::vec4 & color, float depth = 1.0f, int stencil = 0)

Clears the currently attached buffer.

Arguments

  • int buffer - Buffer mask.
  • const Math::vec4 & color - Color value to clear.
  • float depth - Depth value to clear.
  • int stencil - Stencil value to clear.

void clearStates()

Clears all states.

void clearTextures()

void flushRender()

Flushes the render.

void flushStates()

Flushes all states.

void restoreState()

void saveState()


int ALPHA_COVERAGE

int ALPHA_NONE

int BIND_ALL

int BIND_FRAGMENT

int BLEND_DEST_ALPHA

int BLEND_DEST_COLOR

int BLEND_NONE

int BLEND_ONE

int BLEND_ONE_MINUS_DEST_ALPHA

int BLEND_ONE_MINUS_DEST_COLOR

int BLEND_ONE_MINUS_SRC1_ALPHA

int BLEND_ONE_MINUS_SRC1_COLOR

int BLEND_ONE_MINUS_SRC_ALPHA

int BLEND_ONE_MINUS_SRC_COLOR

int BLEND_SRC1_ALPHA

int BLEND_SRC1_COLOR

int BLEND_SRC_ALPHA

int BLEND_SRC_COLOR

int BLEND_ZERO

int BUFFER_ALL

int BUFFER_ALPHA

int BUFFER_BLUE

int BUFFER_COLOR

int BUFFER_DEPTH

int BUFFER_DEPTH_STENCIL

int BUFFER_GREEN

int BUFFER_NONE

int BUFFER_RED

int BUFFER_STENCIL

int CULL_BACK

int CULL_FRONT

int CULL_NONE

int DEPTH_ALWAYS

int DEPTH_EQUAL

int DEPTH_GEQUAL

int DEPTH_LEQUAL

int DEPTH_NONE

int FILL_SOLID

int FILL_WIREFRAME

int FRONT_CCW

int FRONT_CW

int FRONT_INVERT

int STENCIL_ALWAYS

int STENCIL_EQUAL

int STENCIL_INCR

int STENCIL_KEEP

int STENCIL_NONE

int STENCIL_REPLACE

Last update: 2017-07-03
Build: ()