ANSYS::Nexus::GLTFWriter::Parameter Class Reference
Last update: 17.04.2023Parameters describe how and from where program attributes and uniforms are derived. More...
#include <GLTFWriter.h>
Public Types | |
enum | ParameterType { PT_INT = 5124 , PT_FLOAT = 5126 , PT_FLOAT_VEC2 = 35664 , PT_FLOAT_VEC3 = 35665 , PT_FLOAT_VEC4 = 35666 , PT_INT_VEC2 = 35667 , PT_INT_VEC3 = 35668 , PT_INT_VEC4 = 35669 , PT_BOOL = 35670 , PT_FLOAT_MAT3 = 35675 , PT_FLOAT_MAT4 = 35676 , PT_SAMPLER_2D = 35678 } |
Static Public Member Functions | |
static Parameter * | Create (GLTF *gltf, const char *shaderName, const char *externalName, ParameterType type, const Value *defaultValue=0) |
static Parameter * | CreateModelViewMatrix (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateModelMatrix (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateViewMatrix (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateProjectionMatrix (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateNormalMatrix (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateViewport (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateTexture (GLTF *gltf, const char *shaderName, unsigned int num) |
static Parameter * | CreatePosition (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateColor (GLTF *gltf, const char *shaderName, ParameterType type) |
static Parameter * | CreatePointSize (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateDisplacementScale (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateNormal (GLTF *gltf, const char *shaderName) |
static Parameter * | CreateTexCoord (GLTF *gltf, const char *shaderName, unsigned int num) |
Detailed Description
Parameters describe how and from where program attributes and uniforms are derived.
Parameters are part of techniques. Every attribute or uniform defined in the technique program must have a corresponding parameter.
Definition at line 28 of file GLTFTechnique.h.
Member Enumeration Documentation
◆ ParameterType
Type of parameter
Enumerator | |
---|---|
PT_INT | 4 byte integer |
PT_FLOAT | 4 byte float |
PT_FLOAT_VEC2 | 2 PT_FLOAT's |
PT_FLOAT_VEC3 | 3 PT_FLOAT's |
PT_FLOAT_VEC4 | 4 PT_FLOAT's |
PT_INT_VEC2 | 2 PT_INT's |
PT_INT_VEC3 | 3 PT_INT's |
PT_INT_VEC4 | 4 PT_INT's |
PT_BOOL | 1 byte bool |
PT_FLOAT_MAT3 | 3x3 (9) AT_FLOAT's |
PT_FLOAT_MAT4 | 4x4 (16) PT_FLOAT's |
PT_SAMPLER_2D | 2D Texture |
Definition at line 32 of file GLTFTechnique.h.
Member Function Documentation
◆ Create()
|
static |
Creates a parameter for defining how to get shader shaderName uniform or attribute value. This can be used for creating non-specific parameters.
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader. [in] externalName Name of object from where to get value. The name can be from: - built-in value such as "MODELVIEW", "PROJECTION", or "MODELVIEWINVERSETRANSPOSE"
- material value name
- attribute name
[in] type Parameter::ParameterType defining type of parameter. [in] defaultValue Optional, default Value for parameter. Can be overridden by value in material.
- Examples
- Test002.cpp, and Test008.cpp.
◆ CreateColor()
|
static |
Creates a parameter for defining how to get a value for the shader color attribute value. The externalName is "COLOR" and must match that of an attribute in the primitive.
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader. [in] type Parameter::ParameterType defining type of parameter. Possible values are: - PT_FLOAT
- PT_FLOAT_VEC2
- PT_FLOAT_VEC3
- PT_FLOAT_VEC4
◆ CreateDisplacementScale()
|
static |
Creates a parameter for defining how to get a value for the shader DisplacementScale attribute value. The externalName is "DISPLACEMENTSCALE" and must match that of an attribute in the primitive.
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader.
◆ CreateModelMatrix()
◆ CreateModelViewMatrix()
|
static |
Creates a parameter for utilizing the modelview matrix. The externalName is "MODELVIEW".
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader.
- Examples
- Test002.cpp, and Test008.cpp.
◆ CreateNormal()
|
static |
Creates a parameter for defining how to get a value for the shader normal attribute value. The externalName is "NORMAL" and must match that of an attribute in the primitive.
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader.
◆ CreateNormalMatrix()
|
static |
Creates a parameter for utilizing the normal matrix. The normal matrix is the inverse transpose of the modelview matrix. The externalName is "MODELVIEWINVERSETRANSPOSE".
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader.
- Examples
- Test002.cpp, and Test008.cpp.
◆ CreatePointSize()
|
static |
Creates a parameter for defining how to get a value for the shader pointSize attribute value. The externalName is "POINTSIZE" and must match that of an attribute in the primitive.
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader.
◆ CreatePosition()
|
static |
Creates a parameter for defining how to get a value for the shader position attribute value. The externalName is "POSITION" and must match that of an attribute in the primitive.
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader.
◆ CreateProjectionMatrix()
|
static |
Creates a parameter for utilizing the projection matrix. The externalName is "PROJECTION".
- Returns
- Parameter object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] shaderName Name of parameter as defined in shader.
- Examples
- Test002.cpp, and Test008.cpp.
◆ CreateTexCoord()
|
static |
Creates a parameter for defining how to get a value for the shader texture coordinate num attribute value. The externalName is "TEXCOORD???" where "???" is num and must match that of an attribute in the primitive.
- Returns
- Parameter object. Do not delete this pointer.
◆ CreateTexture()
|
static |
Creates a parameter for defining how to get a value for the shader texture num uniform value. The externalName is "texture???" where "???" is num and must match that of a material value.
- Returns
- Parameter object. Do not delete this pointer.
◆ CreateViewMatrix()
◆ CreateViewport()
The documentation for this class was generated from the following file:
- D:/ANSYSDev/NoBackup/branches/EnSight-Second-Coming/webgl_viewer/gltfwriterlib/include/GLTFTechnique.h