Main Page -
Class Hierarchy -
Class List -
File List -
Class Members -
Related Pages -

Information | Reference | SourceForge Project | Author
Muli3D

Reference: Muli3D: m3dtypes.h File Reference

m3dtypes.h File Reference


Detailed Description

#include "m3dbase.h"
#include "math/m3dmath.h"

Go to the source code of this file.

Classes

struct  m3dbox
 Defines a box. Added for volume texture support. More...
struct  m3ddeviceparameters
 This structure defines the device parameters. More...
struct  m3drect
 Defines a rectangle. More...
struct  m3dtriangleinfo
struct  m3dvertexcacheentry
struct  m3dvertexelement
 Describes a vertex element. More...
struct  m3dvsinput
struct  m3dvsoutput

Defines

#define M3DVERTEXFORMATDECL(i_iStream, i_Type, i_Register)   { i_iStream, i_Type, i_Register }

Typedefs

typedef vector4 shaderreg

Enumerations

enum  m3dclippingplanes {
  m3dcp_left = 0, m3dcp_right, m3dcp_top,
  m3dcp_bottom, m3dcp_near, m3dcp_far,
  m3dcp_user0, m3dcp_user1, m3dcp_user2,
  m3dcp_user3, m3dcp_numplanes
}
enum  m3dcmpfunc {
  m3dcmp_never, m3dcmp_equal, m3dcmp_notequal,
  m3dcmp_less, m3dcmp_lessequal, m3dcmp_greaterequal,
  m3dcmp_greater, m3dcmp_always
}
enum  m3dcubefaces {
  m3dcf_positive_x = 0, m3dcf_negative_x, m3dcf_positive_y,
  m3dcf_negative_y, m3dcf_positive_z, m3dcf_negative_z
}
enum  m3dcull { m3dcull_none, m3dcull_cw, m3dcull_ccw }
enum  m3dfill { m3dfill_solid, m3dfill_wireframe }
enum  m3dformat {
  m3dfmt_r32f, m3dfmt_r32g32f, m3dfmt_r32g32b32f,
  m3dfmt_r32g32b32a32f, m3dfmt_index16, m3dfmt_index32
}
enum  m3dpixelshaderoutput { m3dpso_coloronly, m3dpso_colordepth }
enum  m3dprimitivetype { m3dpt_trianglefan, m3dpt_trianglestrip, m3dpt_trianglelist }
enum  m3drenderstate {
  m3drs_zenable = 0, m3drs_zwriteenable, m3drs_zfunc,
  m3drs_colorwriteenable, m3drs_fillmode, m3drs_cullmode,
  m3drs_subdivisionmode, m3drs_subdivisionlevels, m3drs_subdivisionpositionregister,
  m3drs_subdivisionnormalregister, m3drs_subdivisionmaxscreenarea, m3drs_subdivisionmaxinnerlevels,
  m3drs_scissortestenable, m3drs_linethickness, m3drs_numrenderstates
}
enum  m3dshaderconstant {
  m3dsc_worldmatrix = 0, m3dsc_viewmatrix = 1, m3dsc_projectionmatrix = 2,
  m3dsc_wvpmatrix = 3
}
enum  m3dshaderregtype {
  m3dsrt_unused = 0, m3dsrt_float32, m3dsrt_vector2,
  m3dsrt_vector3, m3dsrt_vector4
}
enum  m3dsubdiv {
  m3dsubdiv_none, m3dsubdiv_simple, m3dsubdiv_smooth,
  m3dsubdiv_adaptive
}
enum  m3dtexsampleinput { m3dtsi_2coords, m3dtsi_3coords, m3dtsi_vector }
enum  m3dtextureaddress { m3dta_wrap, m3dta_clamp }
enum  m3dtexturefilter { m3dtf_point, m3dtf_linear }
enum  m3dtexturesamplerstate {
  m3dtss_addressu = 0, m3dtss_addressv, m3dtss_addressw,
  m3dtss_minfilter, m3dtss_magfilter, m3dtss_mipfilter,
  m3dtss_miplodbias, m3dtss_maxmiplevel, m3dtss_numtexturesamplerstates
}
enum  m3dvertexelementtype {
  m3dvet_float32, m3dvet_vector2, m3dvet_vector3,
  m3dvet_vector4
}

Variables

const uint32 c_iMaxTextureSamplers = 16
const uint32 c_iMaxVertexStreams = 8
const uint32 c_iNumShaderConstants = 32
const uint32 c_iPixelShaderRegisters = 8
const uint32 c_iVertexCacheSize = 32
const uint32 c_iVertexShaderRegisters = 8


Define Documentation

#define M3DVERTEXFORMATDECL i_iStream,
i_Type,
i_Register   )     { i_iStream, i_Type, i_Register }
 

Helper-macro for vertex format declaration.


Typedef Documentation

typedef vector4 shaderreg
 

A shader register is 128-bits wide and is divided into four floating-point-values.


Enumeration Type Documentation

enum m3dclippingplanes
 

Enumeration values:
m3dcp_left  Left frustum clipping plane.
m3dcp_right  Right frustum clipping plane.
m3dcp_top  Top frustum clipping plane.
m3dcp_bottom  Bottom frustum clipping plane.
m3dcp_near  Near frustum clipping plane.
m3dcp_far  Far frustum clipping plane.
m3dcp_user0  User specified clipping planes.

enum m3dcmpfunc
 

Defines the supported compare functions.

Enumeration values:
m3dcmp_never  Compares will never pass.
m3dcmp_equal  Compares of two values will pass if they are equal.
m3dcmp_notequal  Compares of two values will pass if they are not equal.
m3dcmp_less  Compares of two values a and b will pass if a < b.
m3dcmp_lessequal  Compares of two values a and b will pass if a <= b.
m3dcmp_greaterequal  Compares of two values a and b will pass if a >= b.
m3dcmp_greater  Compares of two values a and b will pass if a > b.
m3dcmp_always  Compares will always pass.

enum m3dcubefaces
 

Specifies indices for the 6 cubemap faces.

Enumeration values:
m3dcf_positive_x  face +x
m3dcf_negative_x  face -x
m3dcf_positive_y  face +y
m3dcf_negative_y  face -y
m3dcf_positive_z  face +z
m3dcf_negative_z  face -z

enum m3dcull
 

Defines the supported culling modes.

Enumeration values:
m3dcull_none  Back faces won't be culled.
m3dcull_cw  Culls faces with clockwise vertices.
m3dcull_ccw  Culls faces with counterclockwise vertices (default).

enum m3dfill
 

Defines the supported fill modes.

Enumeration values:
m3dfill_solid  Triangles are filled during rasterization (default).
m3dfill_wireframe  Only triangle's edges are drawn.

enum m3dformat
 

Defines the supported texture and buffer formats. The default value for formats that contain undefined channels is 1.0f for the undefined alpha channel and 0.0f for undefined color channels. E.g. m3dfmt_r32g32b32f doesn't define the alpha channel, which is therefore set to 1.0f.

Enumeration values:
m3dfmt_r32f  32-bit texture format, one float mapped to the red channel.
m3dfmt_r32g32f  64-bit texture format, two floats mapped to the red and green channel.
m3dfmt_r32g32b32f  96-bit texture format, three floats mapped to the three color channel.
m3dfmt_r32g32b32a32f  128-bit texture format, four floats mapped to the three color channel plus the alpha channel.
m3dfmt_index16  16-bit indexbuffer format, indices are shorts.
m3dfmt_index32  32-bit indexbuffer format, indices are integers.

enum m3dpixelshaderoutput
 

Specifies the supported pixelshader types.

Enumeration values:
m3dpso_coloronly  Specifies that a given pixelshader only outputs color (default). A pixel's depth values will be automatically computed by the rasterizer through interpolation of depth values of a triangle's vertices.
m3dpso_colordepth  Specifies that a given pixelshader outputs both color and depth. If you want to output only depth use renderstate m3drs_colorwriteenable to disable writing color.

enum m3dprimitivetype
 

Defines the supported primitive types.

Enumeration values:
m3dpt_trianglefan  Triangle fan.
m3dpt_trianglestrip  Triangle strip.
m3dpt_trianglelist  Triangle lists.

enum m3drenderstate
 

Defines the available renderstates.

Enumeration values:
m3drs_zenable  Set this to true to enable depth-buffering or to false to disable it.
m3drs_zwriteenable  Set this to true(default) to enable writing to the depth-buffer during rasterization. If no depth-buffer is available or has been disabled by setting m3drs_zenable to false, this renderstate has no effect.
m3drs_zfunc  Compare-function used for depth-buffer. Set this renderstate to a member of the enumeration m3dcmpfunc. Default: m3dcmp_less.
m3drs_colorwriteenable  Set this to true(default) to enable writing to the color-buffer during rasteriation. If no color-buffer is available this renderstate has no effect.
m3drs_fillmode  Fillmode. Set this renderstate to a member of the enumeration m3dfill. Default: m3dfill_solid.
m3drs_cullmode  Cullmode. Set this renderstate to a member of the enumeration m3dcull. Default: m3dcull_ccw.
m3drs_subdivisionmode  Subdivisionmode. Set this renderstate to a member of the enumeration m3dsubdiv. Default: m3dsubdiv_none.
m3drs_subdivisionlevels  This renderstate specifies the number of recursive subdivision when using simple or smooth subdivision. It specifies the maximum number of recursive subdivisions of triangles' edges when using adaptive subdivision. In case subdivision has been disabled, this renderstate has no effect. Valid values are integers > 0 - if this renderstate has been set to 0, DrawPrimitive()-calls will fail. Default: 1.
m3drs_subdivisionpositionregister  This renderstate is only used when using smooth subdivision. It specifies the vertex shader input register which holds position-data. Make sure vertex positions have been homogenized (w=1)! In case subdivision has been disabled, this renderstate has no effect. Valid values are integers e [0,c_iVertexShaderRegisters[. Default: 0.
m3drs_subdivisionnormalregister  This renderstate is only used when using smooth subdivision. It specifies the vertex shader input register which holds normal-data. For best results make sure that the normals have been normalized. In case subdivision has been disabled, this renderstate has no effect. Valid values are integers e [0,c_iVertexShaderRegisters[. Default: 1.
m3drs_subdivisionmaxscreenarea  This renderstate is only used when using adaptive subdivision. Triangles, which cover more than the set area in screenspace (rendertarget's viewport is respected), are recursivly subdividied. In case subdivision has been disabled, this renderstate has no effect. Valid values are floats > 0.0f - if this renderstate has been set to 0.0f, DrawPrimitive()-calls will fail. Default: 1.0f.
m3drs_subdivisionmaxinnerlevels  This renderstate is only used when using adaptive subdivision. It specifies the maximum number of recursive subdivisions of triangles. In case subdivision has been disabled, this renderstate has no effect. Valid values are integers > 0 - if this renderstate has been set to 0, DrawPrimitive()-calls will fail. Default: 1.
m3drs_scissortestenable  Set this to true to enable scissor testing. Make sure that a scissor rect has been set before calling DrawPrimitive()-functions. Set this to false(default) to disable scissor testing.
m3drs_linethickness  Controls the thickness of rendered lines Valid values are integers >= 1. Default: 1.

enum m3dshaderconstant
 

Specifies indices for commonly used shader constants.

Enumeration values:
m3dsc_worldmatrix  World matrix for vertex transformation.
m3dsc_viewmatrix  View matrix for vertex transformation.
m3dsc_projectionmatrix  Projection matrix for vertex transformation.
m3dsc_wvpmatrix  Concatenated world, view and projection matrix for vertex transformation.

enum m3dshaderregtype
 

Specifies the type of a particular shader register.

Enumeration values:
m3dsrt_unused  Specifies that the register is unused.
m3dsrt_float32  Specifies that the register should be treated as a single float.
m3dsrt_vector2  Specifies that the register should be treated as a 2-dimensional vector.
m3dsrt_vector3  Specifies that the register should be treated as a 3-dimensional vector.
m3dsrt_vector4  Specifies that the register should be treated as a 4-dimensional vector.

enum m3dsubdiv
 

Specifies the supported subdivision modes.

Enumeration values:
m3dsubdiv_none  Triangle subdivision is disabled.
m3dsubdiv_simple  This subdivision mode simply subdivides each triangle an user specified number of times recursively.
m3dsubdiv_smooth  This subdivision mode is a simplified implementation of ATI's TruForm: It subdivides each triangle an user specified number of times recursively and attempts to generate a smooth triangle-surface using vertex normals as a base. This subdivision mode requires access to vertex position and normal. (For best results make sure that normal-vectors are normalized.).
m3dsubdiv_adaptive  This subdivision mode splits each triangle's edges an user specified number of times recursively. The triangle is then subdivided until its sub-triangles cover no more than a user specified area in clipping space.

enum m3dtexsampleinput
 

Specifies the available types of vectors used for sampling different textures.

Enumeration values:
m3dtsi_2coords  2 floating point coordinates used for standard 2d texture-sampling.
m3dtsi_3coords  3 floating point coordinates used for volume texture-sampling.
m3dtsi_vector  3-dimensional vector used for cubemap-sampling.

enum m3dtextureaddress
 

Defines the supported texture adressing-modes.

enum m3dtexturefilter
 

Defines the supported texturefilters.

Enumeration values:
m3dtf_point  Specifies nearest point sampling.
m3dtf_linear  Specifies linear filtering.

enum m3dtexturesamplerstate
 

Defines the available texturesamplerstates.

Enumeration values:
m3dtss_addressu  Texture addressing mode for the u-coordinate. Set this renderstate to a member of the enumeration m3dta. Default: m3dta_wrap.
m3dtss_addressv  Texture addressing mode for the v-coordinate. Set this renderstate to a member of the enumeration m3dta. Default: m3dta_wrap.
m3dtss_addressw  Texture addressing mode for the w-coordinate. Set this renderstate to a member of the enumeration m3dta. Default: m3dta_wrap.
m3dtss_minfilter  Texture minification filtering mode. Set this renderstate to a member of the enumeration m3dtf. Default: m3dtf_linear.
m3dtss_magfilter  Texture magnification filtering mode. Set this renderstate to a member of the enumeration m3dtf. Default: m3dtf_linear.
m3dtss_mipfilter  Mipmap filtering mode. Set this renderstate to a member of the enumeration m3dtf. Default: m3dtf_point.
m3dtss_miplodbias  Floating point value added to the mip-level when sampling textures. Default: 0.0f.
m3dtss_maxmiplevel  Floating point value which specifies the smallest mip-level to be used, e.g. 3.0f would mean that the third mip-level is the smallest to be used. Set this to 0.0f to force the use of the largest mip-level. default: 16.0f.

enum m3dvertexelementtype
 

Defines the supported vertex elements.

Enumeration values:
m3dvet_float32  Specifies a single float. The vertex element is expanded to vector4( float, 0, 0, 1 ) and mapped to a vertex shader input register.
m3dvet_vector2  Specifies two floats. The vertex element is expanded to vector4( float, float, 0, 1 ) and mapped to a vertex shader input register.
m3dvet_vector3  Specifies three floats. The vertex element is expanded to vector4( float, float, float, 1 ) and mapped to a vertex shader input register.
m3dvet_vector4  Specifies four floats. The vertex element is directly mapped to a vertex shader input register.


Variable Documentation

const uint32 c_iMaxTextureSamplers = 16
 

Specifies the amount of available texture samplers.

const uint32 c_iMaxVertexStreams = 8
 

Specifies the amount of available vertex streams.

const uint32 c_iNumShaderConstants = 32
 

Specifies the amount of available shader constants-registers for both vertex and pixel shaders.

const uint32 c_iPixelShaderRegisters = 8
 

Specifies the amount of available vertex shader output registers, which are simulateously used as pixel shader input registers.

const uint32 c_iVertexCacheSize = 32
 

Specifies the size of the vertex cache. Minimum is 3!

const uint32 c_iVertexShaderRegisters = 8
 

Specifies the amount of available vertex shader input registers.

Documentation created with doxygen SourceForge.net Logo