Classes | Defines

include/VR3Lib.h File Reference

VRlib base header file. More...

#include <VR3Config.h>
#include <GL/glew.h>
Include dependency graph for VR3Lib.h:

Go to the source code of this file.

Classes

struct  VR3Globals
 Global static variables struct. More...

Defines

#define VR3EM_NONE   0x0000
 Environment mapping disabled.
#define VR3EM_DIFFUSE   0x0001
 Environment mapping performed only with diffuse component.
#define VR3EM_SPECULAR   0x0002
 Environment mapping performed only with diffuse component.
#define VR3EM_FULL   0x0003
 Full environemnt mapping (recommended when using IBL)
#define VR3MAT_NOSUB   -2
 submaterial identifier that stands for a non-sub material
OpenGL Version
#define VR3_GL_VERSION_MAJOR   "3"
 opengl major version to be used (at least 3, version 3.0, is expected)
#define VR3_GL_VERSION_MINOR   "3"
 opengl minor version to be used
GLSL Version
#define VR3_GLSL_VERSION_MAJOR   "3"
 GLSL major version to be used (at least 3, version 3.30, is expected)
#define VR3_GLSL_VERSION_MINOR   "30"
 opengl minor version to be used
Scene Begin flags
#define VR3BEGFL_KEEPCOLORS   0x0001
 Keep current color buffer.
#define VR3BEGFL_KEEPLIGHTS   0x0002
 Keep current scene light uniform parameters for shaders.
#define VR3BEGFL_KEEPMATRICES   0x0004
 Keep current matrices uniform parameters for shaders.
#define VR3BEGFL_KEEPSHADOWMAPS   0x0008
 Keep current shadow maps in shaders.
#define VR3BEGFL_KEEPPHYSICS   0x0010
 Keep current physics results.
Objects and Meshes User-Unavailable Draw Flags
#define VR3DRAWFL_SHADOWMAP   0x0001
 Draw the shadow map.
#define VR3DRAWFL_RECEIVESHADOWS   0x0002
 Receive shadows while rendering.
#define VR3DRAWFL_NOSIMULATE   0x0004
 Avoid simulation data flag.
Scene Features
#define VR3SC_LIGHT   0
 Identifies one of the scene lights.
#define VR3SC_VF_CULLING   1
 View frustum culling flag.
#define VR3SC_FACE_CULLING   2
 Backface culling flag.
Camera Modes
#define VR3CAM_FREE   0
 Free mode.
#define VR3CAM_LOOKAT   1
 Lookat mode.
Light Constants
#define VR3LIGHT_AMBIENT   0
 Ambient light color.
#define VR3LIGHT_DIFFUSE   1
 Diffuse light color.
#define VR3LIGHT_SPECULAR   2
 Specular light color.
Scene Constants
#define VR3SC_NUM_CAMERAS   8
 maximum number of active cameras
#define VR3SC_NUM_LIGHTS   16
 maximum number of active lights
#define VR3SC_DEF_ZNEAR   0.1f
 default near clipping distance
#define VR3SC_DEF_ZFAR   1000.0f
 default far clipping distance
Object Constants
#define VR3OBJ_NUM_LODS   10
 Maximum number of different level of details for an object.
Mesh Constants
#define VR3MESH_MAX_VER_ATTRIBS   6
 Maximum number attributes per vertex.
#define VR3MESH_VER_POS_INDEX   0
 Constant VBO index for vertex positions.
#define VR3MESH_NORM_INDEX   1
 Constant VBO index for normals.
#define VR3MESH_DIFF_COORD_INDEX   2
 Constant VBO index for diffuse texture coordinates.
#define VR3MESH_LIGHT_COORD_INDEX   3
 Constant VBO index for light map coordinates.
#define VR3MESH_NORM_COORD_INDEX   4
 Constant VBO index for normal map coordinates.
#define VR3MESH_DISP_COORD_INDEX   5
 Constant VBO index for displacement map coordinates.
#define VR3MESH_DEF_BI   0.0f
 Default bias for displacement mapping.
#define VR3MESH_DEF_SC   1.0f
 Default scale for displacement mapping.
#define VR3MESH_DEF_TF   4
 Default tessellation factor for displacement mapping.
#define VR3MESH_MIN_TF   2
 Minimum valid tessellation factor for displacement mapping.
Background Constants
#define VR3BG_VER_POS_INDEX   0
 Constant VBO index for vertex positions.
Text Constants
#define VR3TEXT_VER_POS_INDEX   0
 Constant VBO index for vertex positions.
#define VR3TEXT_DEF_RESY   32
 Default resolution for loaded text glyphs.
#define VR3TEXT_DEF_FONT   "Times New Roman"
 Default font name.
#define VR3TEXT_DEF_CHARSET   ANSI_CHARSET
 Default character set.
#define VR3TEXT_ZDISPLACEMENT   0.0001f
 Displacement along the local Z axis of subsequent characters.
Texture Units Constants

During rendering, many different texture image are accessed in order to obtain color information or something else. We statically bind to a given sampler a certain texture unit. When rendering, the desired proper image will be bound to the unit referenced by the sampler. We require a minimum of VR3TEX_RESERVED_UNITS different units in the GL implementation, more available units may be used for shadow mapping (to a maximum of the implementation limit).

#define VR3TEX_RESERVED_UNITS   6
 Number of different texture image units required by the VR3Lib.
#define VR3TEXUNIT_DIFFUSE   GL_TEXTURE0
 Texture image unit reserved for Diffuse Mapping.
#define VR3TEXUNIT_LIGHT   GL_TEXTURE1
 Texture image unit reserved for Light Mapping.
#define VR3TEXUNIT_NORMAL   GL_TEXTURE2
 Texture image unit reserved for Normal Mapping.
#define VR3TEXUNIT_DISPLACEMENT   GL_TEXTURE3
 Texture image unit reserved for Displacement Mapping.
#define VR3TEXUNIT_ENVDIFF   GL_TEXTURE4
 Texture image unit reserved for Environment Mapping (diffuse component)
#define VR3TEXUNIT_ENVSPEC   GL_TEXTURE5
 Texture image unit reserved for Environment Mapping (specular component)
#define VR3TEXUNIT_BACKGROUND   GL_TEXTURE0
 Texture image unit reserved for the background texture.
#define VR3TEXUNIT_BASE_SHADOW   (GL_TEXTURE0+VR3TEX_RESERVED_UNITS)
 Base texture image unit reserved for shadow mapping.
#define VR3TEXUNIT_BLUR   GL_TEXTURE0
 Texture image unit reserved for blurring.
#define VR3TEXUNIT_TEXT   GL_TEXTURE0
 Texture image unit reserved for text rendering.
Texture Types
#define VR3TEX_2D   GL_TEXTURE_2D
 Standard 2D texture.
#define VR3TEX_CUBE_MAP   GL_TEXTURE_CUBE_MAP
 Cube map.
Material Texture Types
#define VR3TEX_DIFFUSE   0
 Diffuse texture.
#define VR3TEX_LIGHT   1
 Light map.
#define VR3TEX_NORMAL   2
 Normal map.
#define VR3TEX_DISPLACEMENT   3
 Displacement map.
Shadow Mapping Constants
#define VR3SDOW_NUM_SOURCES   16
 Number of shadow sources (inactive by default)
#define VR3SDOW_DEF_DEPTHSCALE   40.0f
 Default value for the depth scale algorithm parameter.
#define VR3SDOW_DEF_MINVARIANCE   0.00001f
 Default value for the minimum variance algorithm parameter.
#define VR3SDOW_DEF_INTENSITY   0.4f
 Default value for the shadow intensity algorithm parameter.
#define VR3SDOW_DEF_BLEEDREDUCTION   0.0f
 Default value for the bleeding reduction factor algorithm parameter.
#define VR3SDOW_DEF_FILTERSIZE   3
 Default value for the filter size algorithm parameter.
#define VR3SDOW_MAX_DEPTHSCALE   40.0f
 Maximum value for the depth scale algorithm parameter.
#define VR3SDOW_MAX_FILTERSIZE   10
 Maximum value for the filter size algorithm parameter.
#define VR3SDOW_MIN_FILTERSIZE   1
 Minimum value for the filter size algorithm parameter.
Shadow Controller Features
#define VR3SDOW_SOURCE   0
 Identifies one of the shadow sources in the controller.
#define VR3SDOW_VF_CULLING   1
 Shadow view frustum culling flag.
#define VR3SDOW_FACE_CULLING   2
 Backface culling during shadow map rendering flag.
#define VR3SDOW_SOURCE_CULLING   3
 Shadow source culling during shadow map rendering flag.
Shadow Controller Modes
#define VR3SDOWCTRL_AUTOMATIC   0
 Automatic object sets management mode.
#define VR3SDOWCTRL_MANUAL   1
 Manual object sets management mode.
Shadow Controller Constants
#define VR3SDOWCTRL_BLUR_VER_POS_INDEX   0
 Constant VBO index for vertex positions.
User Defined FBOs constants
#define VR3FBO_MAX_IMAGES   16
 Maximum number of color images attached.
Standard Shaders Uniform Identifiers

The following list of integer identifiers will be used as names to identify specific uniform variables in the standard shaders. Those integer names are mapped on uniform locations using the uniform map VR3ShaderManager::ms_std_uniforms. The location of a specific uniform variable may change when considering different shader programs. Notice that the identifiers MUST be used as array indices (for maximum performance) and for this reason they must be integer numbers increasing from 0. Order is not significant.

#define VR3_NUM_STD_UNIFORMS   39
 Total number of uniform identifiers for standard rendering shaders.
#define VR3UNI_transformMatrix   0
 Projection*ModelView transformation matrix.
#define VR3UNI_eyePosObj   1
 Eye position in object coordinates.
#define VR3UNI_modelMatrix   2
 Modeling transformation matrix.
#define VR3UNI_viewMatrix   3
 Viewing transformation matrix.
#define VR3UNI_projMatrix   4
 Projection transformation matrix.
#define VR3UNI_normalMatrix   5
 Transformation matrix to use to bring normals to the world space.
#define VR3UNI_matEmission   6
 Material emission.
#define VR3UNI_matAmbient   7
 Material ambient.
#define VR3UNI_matDiffuse   8
 Material diffuse.
#define VR3UNI_matSpecular   9
 Material specular.
#define VR3UNI_matOpacity   10
 Material opacity.
#define VR3UNI_matShininess   11
 Material shininess.
#define VR3UNI_lightAmbient   12
 Lights ambient array.
#define VR3UNI_lightDiffuse   13
 Lights diffuse array.
#define VR3UNI_lightSpecular   14
 Lights specular array.
#define VR3UNI_lightPosObj   15
 Lights position in object coordinates array.
#define VR3UNI_numActiveLights   16
 Number of active lights.
#define VR3UNI_lightPos   17
 Lights position in world coordinates array.
#define VR3UNI_diffMatrix   18
 Diffuse texture coordinates transformation.
#define VR3UNI_diffFlag   19
 Diffuse texture flag (used in external shader programs)
#define VR3UNI_lightMatrix   20
 Light map coordinates transformation.
#define VR3UNI_lightFlag   21
 Light map flag (used in external shader programs)
#define VR3UNI_normMatrix   22
 Normal map coordinates transformation.
#define VR3UNI_normFlag   23
 Normal map flag (used in external shader programs)
#define VR3UNI_dispMatrix   24
 Displacement map coordinates transformation.
#define VR3UNI_dispFlag   25
 Displacement map flag (used in external shader programs)
#define VR3UNI_dispBI   26
 Displacement map bias value.
#define VR3UNI_dispSC   27
 Displacement map scale value.
#define VR3UNI_dispTF   28
 Displacement map tessellation factor.
#define VR3UNI_envMode   29
 Environment mapping mode (same as VR3Scene::m_env_mode)
#define VR3UNI_shaNumActiveSources   30
 Number of active shadow sources in the current shadow controller.
#define VR3UNI_shaModelView   31
 Shadow source modelview array of matrices.
#define VR3UNI_shaProj   32
 Shadow source projection array of matrices (corrected for shadow map lookup)
#define VR3UNI_shaMinVariance   33
 Array of minimum variances.
#define VR3UNI_shaIntensity   34
 Array of shadow intensities.
#define VR3UNI_shaBleedRedFactor   35
 Array of light bleeding reduction factors.
#define VR3UNI_shaDepthScale   36
 Array of depth scales.
#define VR3UNI_shazFar   37
 Array of far clipping distance values.
#define VR3UNI_shazNear   38
 Array of near clipping distance values.
Background Shaders Uniform Identifiers

The following list of integer identifiers will be used as names to identify specific uniform variables in the background shaders. Those integer names are mapped on uniform locations using the uniform map VR3ShaderManager::ms_bg_uniforms. The location of a specific uniform variable may change when considering different shader programs. Notice that the identifiers MUST be used as array indices (for maximum performance) and for this reason they must be integer numbers increasing from 0. Order is not significant.

#define VR3_NUM_BG_UNIFORMS   1
 Total number of uniform identifiers.
#define VR3UNI_bg_transformMatrix   0
 Projection*View transformation matrix (a modified viewing matrix is used - no translation)
Shadow Map Shader Uniform Identifiers

The following list of integer identifiers will be used as names to identify specific uniform variables in the shadow map shader. Those integer names are mapped on uniform locations using the array VR3ShaderManager::ms_shad_uniforms. Notice that the identifiers MUST be used as array indices (for maximum performance) and for this reason they must be integer numbers increasing from 0. Order is not significant.

#define VR3_NUM_SHAD_UNIFORMS   5
 Total number of uniform identifiers.
#define VR3UNI_shad_modelViewMatrix   0
 Shadow source viewing and modeling matrix.
#define VR3UNI_shad_projMatrix   1
 Shadow source projection matrix.
#define VR3UNI_shad_depthScale   2
 Depth scale algorithm parameter.
#define VR3UNI_shad_zFar   3
 Far clipping distance shadow source parameter.
#define VR3UNI_shad_zNear   4
 Near clipping distance shadow source parameter.
Blurring Shaders Uniforms Identifiers

The following list of integer identifiers will be used as names to identify specific uniform variables in the blurring shaders. Those integer names are mapped on uniform locations using the arrays VR3ShaderManager::ms_blur_uniforms. Notice that the identifiers MUST be used as array indices (for maximum performance) and for this reason they must be integer numbers increasing from 0. Order is not significant.

#define VR3_NUM_BLUR_UNIFORMS   2
 Total number of uniform identifiers.
#define VR3UNI_blur_texSize   0
 Shadow map width or height depending on the particular shader program.
#define VR3UNI_blur_filterSize   1
 Gaussian blur filter width (1 to 10, in pixels)
Text Shader Uniforms Identifiers

The following list of integer identifiers will be used as names to identify specific uniform variables in the text string shaders. Those integer names are mapped on uniform locations using the arrays VR3ShaderManager::ms_text_uniforms. Notice that the identifiers MUST be used as array indices (for maximum performance) and for this reason they must be integer numbers increasing from 0. Order is not significant.

#define VR3_NUM_TEXT_UNIFORMS   3
 Total number of uniform identifiers.
#define VR3UNI_text_transformMatrix   0
 Projection*ModelView transformation matrix.
#define VR3UNI_text_offset   1
 Offset along the axes before applying the transformation matrix.
#define VR3UNI_text_color   2
 Color of the text string.
Standard Shaders Constants
#define VR3SH_GS_COMPONENTS_PER_VERTEX_DIFF   11
 number of output components per vertex with diffuse texture
#define VR3SH_GS_COMPONENTS_PER_VERTEX_NODIFF   9
 number of output components per vertex without diffuse texture
Notification Service Constants
#define VR3_MAX_NOTIFICATION_LENGTH   256
 number of maximum characters in a predefined notification message
Physical Mesh types (for simulation)
#define VR3PHYMESH_DYNAMIC   0
 Dynamic mesh type identifier.
#define VR3PHYMESH_STATIC   1
 Static mesh type identifier.
#define VR3PHYMESH_KINEMATIC   2
 Kinematic mesh type identifier.
Physics Constants
#define VR3PHY_DYN_SKINDIVIDER   200.0f
 Skin divider for dynamic and kinematic objects (convex meshes)
#define VR3PHY_STA_SKINDIVIDER   1000.0f
 Skin divider for static objects (generic triangle meshes)
#define VR3PHY_PROJDISTDIVIDER   1.0f
 Projection distance divider.
#define VR3PHY_DEF_SKINWIDTH   0.1f
 Default skin width for shapes.
#define VR3PHY_DEF_GRAVITY   0.0f,-9.80665f,0.0f
 Default gravity for physics simulation.
#define VR3PHYSIM_DEF_ITERNUM   10
 Default solver iteration steps.
#define VR3PHYSIM_DEF_TIMESTEP   (1.0f/120.0f)
 Simulation timestep.
#define VR3PHYSIM_DEF_MAXSTEPS   8
 Maximum number of steps in a single simulation cycle.
Physics Simulator Modes
#define VR3PHYSIM_AUTOMATIC   0
 Automatic object registration mode.
#define VR3PHYSIM_MANUAL   1
 Manual object registration mode.
Integer string buffer length
#define VR3_INT_STRING_LENGTH   16
 number of characters in a buffer used to store an integer value as a string
Utility Macros
#define STRINGIFY2(x)   #x
 Stringify a nonstring macro (second expansion)
#define STRINGIFY(x)   STRINGIFY2(x)
 Stringify a nonstring macro (first expansion)

Functions

Global Initialization and Shutdown Functions
void VR3Init ()
 VR3Lib initialization function.
void VR3Deinit ()
 VR3Lib deinitialization function.

Detailed Description

VRlib base header file.

Author:
Daniele Giannetti
Version:
1.0
Date:
August 2010

This header file defines some constants used by the VRLib engine and should be the first VRLib file to include in any project.

Definition in file VR3Lib.h.


Define Documentation

#define STRINGIFY (   x )    STRINGIFY2(x)

Stringify a nonstring macro (first expansion)

Definition at line 1028 of file VR3Lib.h.

#define STRINGIFY2 (   x )    #x

Stringify a nonstring macro (second expansion)

Definition at line 1026 of file VR3Lib.h.

#define VR3_GL_VERSION_MAJOR   "3"

opengl major version to be used (at least 3, version 3.0, is expected)

Definition at line 218 of file VR3Lib.h.

#define VR3_GL_VERSION_MINOR   "3"

opengl minor version to be used

Definition at line 220 of file VR3Lib.h.

#define VR3_GLSL_VERSION_MAJOR   "3"

GLSL major version to be used (at least 3, version 3.30, is expected)

Definition at line 229 of file VR3Lib.h.

#define VR3_GLSL_VERSION_MINOR   "30"

opengl minor version to be used

Definition at line 231 of file VR3Lib.h.

#define VR3_INT_STRING_LENGTH   16

number of characters in a buffer used to store an integer value as a string

Definition at line 1016 of file VR3Lib.h.

#define VR3_MAX_NOTIFICATION_LENGTH   256

number of maximum characters in a predefined notification message

Definition at line 885 of file VR3Lib.h.

#define VR3_NUM_BG_UNIFORMS   1

Total number of uniform identifiers.

Definition at line 776 of file VR3Lib.h.

#define VR3_NUM_BLUR_UNIFORMS   2

Total number of uniform identifiers.

Definition at line 826 of file VR3Lib.h.

#define VR3_NUM_SHAD_UNIFORMS   5

Total number of uniform identifiers.

Definition at line 797 of file VR3Lib.h.

#define VR3_NUM_STD_UNIFORMS   39

Total number of uniform identifiers for standard rendering shaders.

Definition at line 658 of file VR3Lib.h.

#define VR3_NUM_TEXT_UNIFORMS   3

Total number of uniform identifiers.

Definition at line 854 of file VR3Lib.h.

#define VR3BEGFL_KEEPCOLORS   0x0001

Keep current color buffer.

This flag avoids clearing the color buffer while entering a Begin()...End() block, this is used to avoid clearing the colors written in the framebuffer by a previous block in the same frame.

Definition at line 246 of file VR3Lib.h.

#define VR3BEGFL_KEEPLIGHTS   0x0002

Keep current scene light uniform parameters for shaders.

This flag causes the shader uniform parameters relative to the scene lights not to be updated while entering a Begin()...End() block. This may be useful if multiple begin-end calls are executed in a single frame and the scene lights are left untouched, or if we want to increase performance in an application that never changes the lighting properties of the scene.

Definition at line 256 of file VR3Lib.h.

#define VR3BEGFL_KEEPMATRICES   0x0004

Keep current matrices uniform parameters for shaders.

This flag causes the shader uniform parameters relative to the viewing and projection transformation not to be updated while entering the Begin()...End() block. This may be useful if multiple begin-end calls are executed in a single frame and the viewport and cameras are left untouched, or if we want to increase performance in an application that never changes the viewport dimensions and the camera parameters.

Definition at line 267 of file VR3Lib.h.

#define VR3BEGFL_KEEPPHYSICS   0x0010

Keep current physics results.

This flag causes the physical simulation results not to be collected when entering a Begin()...End() This flag has no effect if no VR3PhysicsSimulator is currently active or if the active physics simulator has not been prepared yet, but is very useful when there is an active simulator but we want to avoid a new result fetching operation because this is not the first Begin()...End() block of the frame.

Definition at line 289 of file VR3Lib.h.

#define VR3BEGFL_KEEPSHADOWMAPS   0x0008

Keep current shadow maps in shaders.

This flag causes the shadow maps used to project shadows onto the scene not to be computed entering the Begin()...End() block. This flag has no effect if no VR3ShadowController is currently active, but is very useful when there is an active shadow controller but we want to avoid shadow map generation because this is not the first Begin()...End() block of the frame.

Definition at line 277 of file VR3Lib.h.

#define VR3BG_VER_POS_INDEX   0

Constant VBO index for vertex positions.

Definition at line 452 of file VR3Lib.h.

#define VR3CAM_FREE   0

Free mode.

Definition at line 357 of file VR3Lib.h.

#define VR3CAM_LOOKAT   1

Lookat mode.

Definition at line 359 of file VR3Lib.h.

#define VR3DRAWFL_NOSIMULATE   0x0004

Avoid simulation data flag.

This flag may be set by the VR3Lib user in order to avoid physical simulation in an object draw call. This will automatically be passed to the children objects in order to draw an entire hierarchy of non physically simulated objects (even during simulation).

Definition at line 329 of file VR3Lib.h.

#define VR3DRAWFL_RECEIVESHADOWS   0x0002

Receive shadows while rendering.

This flag is activated when an object being drawn discovers that it belongs to the shadow receivers set of the active VR3ShadowController. If this is the case, it must compute the occlusion probability while rendering. The object's children will be rendered with the same flag discovered.

Definition at line 319 of file VR3Lib.h.

#define VR3DRAWFL_SHADOWMAP   0x0001

Draw the shadow map.

Flags are usually automatically set if needed, the user won't have to deal with flags under normal operations, undesired behaviour may arise if the user decides to set some of this flags. This flag is set when the object is not being drawn on the screen or in a user FBO, instead the object is being drawn on the shadow map. When rendering a shadow map, mesh drawing is simpler because we do not need any material or lighting information.

Definition at line 310 of file VR3Lib.h.

#define VR3EM_DIFFUSE   0x0001

Environment mapping performed only with diffuse component.

Definition at line 382 of file VR3Lib.h.

#define VR3EM_FULL   0x0003

Full environemnt mapping (recommended when using IBL)

Definition at line 386 of file VR3Lib.h.

#define VR3EM_NONE   0x0000

Environment mapping disabled.

Definition at line 380 of file VR3Lib.h.

#define VR3EM_SPECULAR   0x0002

Environment mapping performed only with diffuse component.

Definition at line 384 of file VR3Lib.h.

#define VR3FBO_MAX_IMAGES   16

Maximum number of color images attached.

Definition at line 639 of file VR3Lib.h.

#define VR3LIGHT_AMBIENT   0

Ambient light color.

Definition at line 369 of file VR3Lib.h.

#define VR3LIGHT_DIFFUSE   1

Diffuse light color.

Definition at line 371 of file VR3Lib.h.

#define VR3LIGHT_SPECULAR   2

Specular light color.

Definition at line 373 of file VR3Lib.h.

#define VR3MAT_NOSUB   -2

submaterial identifier that stands for a non-sub material

Definition at line 559 of file VR3Lib.h.

#define VR3MESH_DEF_BI   0.0f

Default bias for displacement mapping.

Definition at line 436 of file VR3Lib.h.

#define VR3MESH_DEF_SC   1.0f

Default scale for displacement mapping.

Definition at line 438 of file VR3Lib.h.

#define VR3MESH_DEF_TF   4

Default tessellation factor for displacement mapping.

Definition at line 440 of file VR3Lib.h.

#define VR3MESH_DIFF_COORD_INDEX   2

Constant VBO index for diffuse texture coordinates.

Definition at line 427 of file VR3Lib.h.

#define VR3MESH_DISP_COORD_INDEX   5

Constant VBO index for displacement map coordinates.

Definition at line 433 of file VR3Lib.h.

#define VR3MESH_LIGHT_COORD_INDEX   3

Constant VBO index for light map coordinates.

Definition at line 429 of file VR3Lib.h.

#define VR3MESH_MAX_VER_ATTRIBS   6

Maximum number attributes per vertex.

Definition at line 420 of file VR3Lib.h.

#define VR3MESH_MIN_TF   2

Minimum valid tessellation factor for displacement mapping.

Definition at line 442 of file VR3Lib.h.

#define VR3MESH_NORM_COORD_INDEX   4

Constant VBO index for normal map coordinates.

Definition at line 431 of file VR3Lib.h.

#define VR3MESH_NORM_INDEX   1

Constant VBO index for normals.

Definition at line 425 of file VR3Lib.h.

#define VR3MESH_VER_POS_INDEX   0

Constant VBO index for vertex positions.

Definition at line 423 of file VR3Lib.h.

#define VR3OBJ_NUM_LODS   10

Maximum number of different level of details for an object.

Definition at line 410 of file VR3Lib.h.

#define VR3PHY_DEF_GRAVITY   0.0f,-9.80665f,0.0f

Default gravity for physics simulation.

Definition at line 963 of file VR3Lib.h.

#define VR3PHY_DEF_SKINWIDTH   0.1f

Default skin width for shapes.

Definition at line 960 of file VR3Lib.h.

#define VR3PHY_DYN_SKINDIVIDER   200.0f

Skin divider for dynamic and kinematic objects (convex meshes)

The skin width is an important parameter in rigid body PhysX simulation, it strongly affect the simulation stability but very high values will result in unrealistic simulations. The appropriate value usually depends on the rigid body size: the bigger the object is and the bigger the skin width will have to be. In the VR3Lib engine we set the skin width by computing the average length of the object on the three orthogonal axis X, Y and Z, and then dividing the result with a constant parameter which is the following divider. This is the divider used for dynamic and kinematic objects, these objects are such that they are decomposed in convex meshes for simulations. It may be useful to inflate meshes to hide skin width related object intersection before collision. If desired, this is supposed to happen offline (before writing the data to the mesh file containing the physical mesh).

Definition at line 929 of file VR3Lib.h.

#define VR3PHY_PROJDISTDIVIDER   1.0f

Projection distance divider.

When dealing with revolute, spherical and generic joints, projection is enforced to combat inaccuracy of joint simulation. The projection distance is set by the average side size of the jointed actors bounding boxes divided by this constant parameter.

Definition at line 957 of file VR3Lib.h.

#define VR3PHY_STA_SKINDIVIDER   1000.0f

Skin divider for static objects (generic triangle meshes)

The skin width is an important parameter in rigid body PhysX simulation, it strongly affect the simulation stability but very high values will result in unrealistic simulations. The appropriate value usually depends on the rigid body size: the bigger the object is and the bigger the skin width will have to be. In the VR3Lib engine we set the skin width by computing the average length of the object on the three orthogonal axis X, Y and Z, and then dividing the result with a constant parameter which is the following divider. This is the divider used for static objects, these objects are always cooked as generic triangle meshes (and not decomposed in convex meshes). It may be useful to inflate meshes to hide skin width related object intersection before collision. If desired, this is supposed to happen offline (before writing the data to the mesh file containing the physical mesh).

Definition at line 949 of file VR3Lib.h.

#define VR3PHYMESH_DYNAMIC   0

Dynamic mesh type identifier.

Definition at line 900 of file VR3Lib.h.

#define VR3PHYMESH_KINEMATIC   2

Kinematic mesh type identifier.

Definition at line 904 of file VR3Lib.h.

#define VR3PHYMESH_STATIC   1

Static mesh type identifier.

Definition at line 902 of file VR3Lib.h.

#define VR3PHYSIM_AUTOMATIC   0

Automatic object registration mode.

Definition at line 1002 of file VR3Lib.h.

#define VR3PHYSIM_DEF_ITERNUM   10

Default solver iteration steps.

This is the default number of solver steps that PhysX must perform while simulating rigid bodies, a high number of iteration may produce more convincing simulations and increase stability but will also limit the frame rate.

Definition at line 971 of file VR3Lib.h.

#define VR3PHYSIM_DEF_MAXSTEPS   8

Maximum number of steps in a single simulation cycle.

The timestep defines the length of a single step, but this constant defines the default maximum number of simulation steps to be performed at simulation time in a sincle simulation cycle. Usually, this default value will fit in any situation.

Definition at line 992 of file VR3Lib.h.

#define VR3PHYSIM_DEF_TIMESTEP   (1.0f/120.0f)

Simulation timestep.

During simulation, we have that elapsed time since the last frame is split into some steps of length given by a specified timestep, this is the default value for the timestep. When the timestep is set to a smaller value, we may obtain more fluid simulations and increase the frame rate if the bottleneck was the physical simulation, but the maximum number of step will usually have to be raised (therefore limiting performance). Increasing the timestep may instead increase the frame rate when the low frame rate is not caused by the physics simulation. Usually, this default value will fit in any situation.

Definition at line 984 of file VR3Lib.h.

#define VR3PHYSIM_MANUAL   1

Manual object registration mode.

Definition at line 1004 of file VR3Lib.h.

#define VR3SC_DEF_ZFAR   1000.0f

default far clipping distance

Definition at line 400 of file VR3Lib.h.

#define VR3SC_DEF_ZNEAR   0.1f

default near clipping distance

Definition at line 398 of file VR3Lib.h.

#define VR3SC_FACE_CULLING   2

Backface culling flag.

Identifies the scene backface culling option.

Definition at line 347 of file VR3Lib.h.

#define VR3SC_LIGHT   0

Identifies one of the scene lights.

Definition at line 341 of file VR3Lib.h.

#define VR3SC_NUM_CAMERAS   8

maximum number of active cameras

Definition at line 394 of file VR3Lib.h.

#define VR3SC_NUM_LIGHTS   16

maximum number of active lights

Definition at line 396 of file VR3Lib.h.

#define VR3SC_VF_CULLING   1

View frustum culling flag.

Identifies the view frustum culling scene option.

Definition at line 344 of file VR3Lib.h.

#define VR3SDOW_DEF_BLEEDREDUCTION   0.0f

Default value for the bleeding reduction factor algorithm parameter.

Definition at line 575 of file VR3Lib.h.

#define VR3SDOW_DEF_DEPTHSCALE   40.0f

Default value for the depth scale algorithm parameter.

Definition at line 569 of file VR3Lib.h.

#define VR3SDOW_DEF_FILTERSIZE   3

Default value for the filter size algorithm parameter.

Definition at line 577 of file VR3Lib.h.

#define VR3SDOW_DEF_INTENSITY   0.4f

Default value for the shadow intensity algorithm parameter.

Definition at line 573 of file VR3Lib.h.

#define VR3SDOW_DEF_MINVARIANCE   0.00001f

Default value for the minimum variance algorithm parameter.

Definition at line 571 of file VR3Lib.h.

#define VR3SDOW_FACE_CULLING   2

Backface culling during shadow map rendering flag.

Identifies the shadow controller backface culling option.

Definition at line 605 of file VR3Lib.h.

#define VR3SDOW_MAX_DEPTHSCALE   40.0f

Maximum value for the depth scale algorithm parameter.

Numerical precision is an issue when using exponential-like shadow maps, to avoid float overflow we use a maximum depth scale value that can be considered safe in any IEEE 754 single precision implementation and will work on any modern system.

Definition at line 585 of file VR3Lib.h.

#define VR3SDOW_MAX_FILTERSIZE   10

Maximum value for the filter size algorithm parameter.

Definition at line 587 of file VR3Lib.h.

#define VR3SDOW_MIN_FILTERSIZE   1

Minimum value for the filter size algorithm parameter.

Definition at line 589 of file VR3Lib.h.

#define VR3SDOW_NUM_SOURCES   16

Number of shadow sources (inactive by default)

Definition at line 567 of file VR3Lib.h.

#define VR3SDOW_SOURCE   0

Identifies one of the shadow sources in the controller.

Definition at line 599 of file VR3Lib.h.

#define VR3SDOW_SOURCE_CULLING   3

Shadow source culling during shadow map rendering flag.

Identifies the shadow controller shadow source culling option.

Definition at line 608 of file VR3Lib.h.

#define VR3SDOW_VF_CULLING   1

Shadow view frustum culling flag.

Identifies the view frustum culling shadow controller option.

Definition at line 602 of file VR3Lib.h.

#define VR3SDOWCTRL_AUTOMATIC   0

Automatic object sets management mode.

Definition at line 617 of file VR3Lib.h.

#define VR3SDOWCTRL_BLUR_VER_POS_INDEX   0

Constant VBO index for vertex positions.

Definition at line 629 of file VR3Lib.h.

#define VR3SDOWCTRL_MANUAL   1

Manual object sets management mode.

Definition at line 619 of file VR3Lib.h.

#define VR3SH_GS_COMPONENTS_PER_VERTEX_DIFF   11

number of output components per vertex with diffuse texture

Definition at line 873 of file VR3Lib.h.

#define VR3SH_GS_COMPONENTS_PER_VERTEX_NODIFF   9

number of output components per vertex without diffuse texture

Definition at line 875 of file VR3Lib.h.

#define VR3TEX_2D   GL_TEXTURE_2D

Standard 2D texture.

Definition at line 534 of file VR3Lib.h.

#define VR3TEX_CUBE_MAP   GL_TEXTURE_CUBE_MAP

Cube map.

Definition at line 536 of file VR3Lib.h.

#define VR3TEX_DIFFUSE   0

Diffuse texture.

Definition at line 546 of file VR3Lib.h.

#define VR3TEX_DISPLACEMENT   3

Displacement map.

Definition at line 552 of file VR3Lib.h.

#define VR3TEX_LIGHT   1

Light map.

Definition at line 548 of file VR3Lib.h.

#define VR3TEX_NORMAL   2

Normal map.

Definition at line 550 of file VR3Lib.h.

#define VR3TEX_RESERVED_UNITS   6

Number of different texture image units required by the VR3Lib.

Definition at line 495 of file VR3Lib.h.

#define VR3TEXT_DEF_CHARSET   ANSI_CHARSET

Default character set.

Definition at line 472 of file VR3Lib.h.

#define VR3TEXT_DEF_FONT   "Times New Roman"

Default font name.

Definition at line 470 of file VR3Lib.h.

#define VR3TEXT_DEF_RESY   32

Default resolution for loaded text glyphs.

Definition at line 468 of file VR3Lib.h.

#define VR3TEXT_VER_POS_INDEX   0

Constant VBO index for vertex positions.

Definition at line 465 of file VR3Lib.h.

#define VR3TEXT_ZDISPLACEMENT   0.0001f

Displacement along the local Z axis of subsequent characters.

Definition at line 475 of file VR3Lib.h.

#define VR3TEXUNIT_BACKGROUND   GL_TEXTURE0

Texture image unit reserved for the background texture.

Definition at line 512 of file VR3Lib.h.

#define VR3TEXUNIT_BASE_SHADOW   (GL_TEXTURE0+VR3TEX_RESERVED_UNITS)

Base texture image unit reserved for shadow mapping.

Definition at line 515 of file VR3Lib.h.

#define VR3TEXUNIT_BLUR   GL_TEXTURE0

Texture image unit reserved for blurring.

Definition at line 518 of file VR3Lib.h.

#define VR3TEXUNIT_DIFFUSE   GL_TEXTURE0

Texture image unit reserved for Diffuse Mapping.

Definition at line 498 of file VR3Lib.h.

#define VR3TEXUNIT_DISPLACEMENT   GL_TEXTURE3

Texture image unit reserved for Displacement Mapping.

Definition at line 504 of file VR3Lib.h.

#define VR3TEXUNIT_ENVDIFF   GL_TEXTURE4

Texture image unit reserved for Environment Mapping (diffuse component)

Definition at line 507 of file VR3Lib.h.

#define VR3TEXUNIT_ENVSPEC   GL_TEXTURE5

Texture image unit reserved for Environment Mapping (specular component)

Definition at line 509 of file VR3Lib.h.

#define VR3TEXUNIT_LIGHT   GL_TEXTURE1

Texture image unit reserved for Light Mapping.

Definition at line 500 of file VR3Lib.h.

#define VR3TEXUNIT_NORMAL   GL_TEXTURE2

Texture image unit reserved for Normal Mapping.

Definition at line 502 of file VR3Lib.h.

#define VR3TEXUNIT_TEXT   GL_TEXTURE0

Texture image unit reserved for text rendering.

Definition at line 521 of file VR3Lib.h.

#define VR3UNI_bg_transformMatrix   0

Projection*View transformation matrix (a modified viewing matrix is used - no translation)

Definition at line 779 of file VR3Lib.h.

#define VR3UNI_blur_filterSize   1

Gaussian blur filter width (1 to 10, in pixels)

Definition at line 833 of file VR3Lib.h.

#define VR3UNI_blur_texSize   0

Shadow map width or height depending on the particular shader program.

Width when considering horizontal blur, height when considering vertical blur.

Definition at line 831 of file VR3Lib.h.

#define VR3UNI_diffFlag   19

Diffuse texture flag (used in external shader programs)

Definition at line 713 of file VR3Lib.h.

#define VR3UNI_diffMatrix   18

Diffuse texture coordinates transformation.

Definition at line 711 of file VR3Lib.h.

#define VR3UNI_dispBI   26

Displacement map bias value.

Definition at line 727 of file VR3Lib.h.

#define VR3UNI_dispFlag   25

Displacement map flag (used in external shader programs)

Definition at line 725 of file VR3Lib.h.

#define VR3UNI_dispMatrix   24

Displacement map coordinates transformation.

Definition at line 723 of file VR3Lib.h.

#define VR3UNI_dispSC   27

Displacement map scale value.

Definition at line 729 of file VR3Lib.h.

#define VR3UNI_dispTF   28

Displacement map tessellation factor.

Definition at line 731 of file VR3Lib.h.

#define VR3UNI_envMode   29

Environment mapping mode (same as VR3Scene::m_env_mode)

Definition at line 736 of file VR3Lib.h.

#define VR3UNI_eyePosObj   1

Eye position in object coordinates.

This is loaded with the world position of the eye in case of specular environment mapping.

Definition at line 668 of file VR3Lib.h.

#define VR3UNI_lightAmbient   12

Lights ambient array.

Definition at line 696 of file VR3Lib.h.

#define VR3UNI_lightDiffuse   13

Lights diffuse array.

Definition at line 698 of file VR3Lib.h.

#define VR3UNI_lightFlag   21

Light map flag (used in external shader programs)

Definition at line 717 of file VR3Lib.h.

#define VR3UNI_lightMatrix   20

Light map coordinates transformation.

Definition at line 715 of file VR3Lib.h.

#define VR3UNI_lightPos   17

Lights position in world coordinates array.

Definition at line 706 of file VR3Lib.h.

#define VR3UNI_lightPosObj   15

Lights position in object coordinates array.

Definition at line 702 of file VR3Lib.h.

#define VR3UNI_lightSpecular   14

Lights specular array.

Definition at line 700 of file VR3Lib.h.

#define VR3UNI_matAmbient   7

Material ambient.

Definition at line 683 of file VR3Lib.h.

#define VR3UNI_matDiffuse   8

Material diffuse.

Definition at line 685 of file VR3Lib.h.

#define VR3UNI_matEmission   6

Material emission.

Definition at line 681 of file VR3Lib.h.

#define VR3UNI_matOpacity   10

Material opacity.

Definition at line 689 of file VR3Lib.h.

#define VR3UNI_matShininess   11

Material shininess.

Definition at line 691 of file VR3Lib.h.

#define VR3UNI_matSpecular   9

Material specular.

Definition at line 687 of file VR3Lib.h.

#define VR3UNI_modelMatrix   2

Modeling transformation matrix.

Definition at line 670 of file VR3Lib.h.

#define VR3UNI_normalMatrix   5

Transformation matrix to use to bring normals to the world space.

Definition at line 676 of file VR3Lib.h.

#define VR3UNI_normFlag   23

Normal map flag (used in external shader programs)

Definition at line 721 of file VR3Lib.h.

#define VR3UNI_normMatrix   22

Normal map coordinates transformation.

Definition at line 719 of file VR3Lib.h.

#define VR3UNI_numActiveLights   16

Number of active lights.

Definition at line 704 of file VR3Lib.h.

#define VR3UNI_projMatrix   4

Projection transformation matrix.

Definition at line 674 of file VR3Lib.h.

#define VR3UNI_shaBleedRedFactor   35

Array of light bleeding reduction factors.

Definition at line 751 of file VR3Lib.h.

#define VR3UNI_shad_depthScale   2

Depth scale algorithm parameter.

Definition at line 804 of file VR3Lib.h.

#define VR3UNI_shad_modelViewMatrix   0

Shadow source viewing and modeling matrix.

Definition at line 800 of file VR3Lib.h.

#define VR3UNI_shad_projMatrix   1

Shadow source projection matrix.

Definition at line 802 of file VR3Lib.h.

#define VR3UNI_shad_zFar   3

Far clipping distance shadow source parameter.

Definition at line 806 of file VR3Lib.h.

#define VR3UNI_shad_zNear   4

Near clipping distance shadow source parameter.

Definition at line 808 of file VR3Lib.h.

#define VR3UNI_shaDepthScale   36

Array of depth scales.

Definition at line 753 of file VR3Lib.h.

#define VR3UNI_shaIntensity   34

Array of shadow intensities.

Definition at line 749 of file VR3Lib.h.

#define VR3UNI_shaMinVariance   33

Array of minimum variances.

Definition at line 747 of file VR3Lib.h.

#define VR3UNI_shaModelView   31

Shadow source modelview array of matrices.

Definition at line 743 of file VR3Lib.h.

#define VR3UNI_shaNumActiveSources   30

Number of active shadow sources in the current shadow controller.

Definition at line 741 of file VR3Lib.h.

#define VR3UNI_shaProj   32

Shadow source projection array of matrices (corrected for shadow map lookup)

Definition at line 745 of file VR3Lib.h.

#define VR3UNI_shazFar   37

Array of far clipping distance values.

Definition at line 755 of file VR3Lib.h.

#define VR3UNI_shazNear   38

Array of near clipping distance values.

Definition at line 757 of file VR3Lib.h.

#define VR3UNI_text_color   2

Color of the text string.

Definition at line 861 of file VR3Lib.h.

#define VR3UNI_text_offset   1

Offset along the axes before applying the transformation matrix.

Definition at line 859 of file VR3Lib.h.

#define VR3UNI_text_transformMatrix   0

Projection*ModelView transformation matrix.

Definition at line 857 of file VR3Lib.h.

#define VR3UNI_transformMatrix   0

Projection*ModelView transformation matrix.

Definition at line 663 of file VR3Lib.h.

#define VR3UNI_viewMatrix   3

Viewing transformation matrix.

Definition at line 672 of file VR3Lib.h.


Function Documentation

void VR3Deinit (  )

VR3Lib deinitialization function.

This function may be used after every other VR3Lib object has been released to release the final resources held by the VR3Lib.

void VR3Init (  )

VR3Lib initialization function.

This function is the first VR3Lib function to be called at startup, it is used to initialize the VR3Lib structures and set up the global environment for execution. If this function is not called first, any VR3Lib main class instantiation will fail with fatal error. The VR3Lib main classes (directly used by the user) are:

 All Classes Namespaces Files Functions Variables Typedefs Friends Defines