Skip to main content

Post-processing tools 2023 R2

ANSYS::Nexus::GLTFWriter::Parameter Class Reference

Last update: 17.04.2023

Parameters describe how and from where program attributes and uniforms are derived. More...

#include <GLTFWriter.h>

Inheritance diagram for ANSYS::Nexus::GLTFWriter::Parameter:

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 ParameterCreate (GLTF *gltf, const char *shaderName, const char *externalName, ParameterType type, const Value *defaultValue=0)
 
static ParameterCreateModelViewMatrix (GLTF *gltf, const char *shaderName)
 
static ParameterCreateModelMatrix (GLTF *gltf, const char *shaderName)
 
static ParameterCreateViewMatrix (GLTF *gltf, const char *shaderName)
 
static ParameterCreateProjectionMatrix (GLTF *gltf, const char *shaderName)
 
static ParameterCreateNormalMatrix (GLTF *gltf, const char *shaderName)
 
static ParameterCreateViewport (GLTF *gltf, const char *shaderName)
 
static ParameterCreateTexture (GLTF *gltf, const char *shaderName, unsigned int num)
 
static ParameterCreatePosition (GLTF *gltf, const char *shaderName)
 
static ParameterCreateColor (GLTF *gltf, const char *shaderName, ParameterType type)
 
static ParameterCreatePointSize (GLTF *gltf, const char *shaderName)
 
static ParameterCreateDisplacementScale (GLTF *gltf, const char *shaderName)
 
static ParameterCreateNormal (GLTF *gltf, const char *shaderName)
 
static ParameterCreateTexCoord (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 Parameter* ANSYS::Nexus::GLTFWriter::Parameter::Create ( GLTF gltf,
const char *  shaderName,
const char *  externalName,
ParameterType  type,
const Value defaultValue = 0 
)
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]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.
[in]externalNameName 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]typeParameter::ParameterType defining type of parameter.
[in]defaultValueOptional, default Value for parameter. Can be overridden by value in material.
Examples
Test002.cpp, and Test008.cpp.

◆ CreateColor()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateColor ( GLTF gltf,
const char *  shaderName,
ParameterType  type 
)
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]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.
[in]typeParameter::ParameterType defining type of parameter. Possible values are:
  • PT_FLOAT
  • PT_FLOAT_VEC2
  • PT_FLOAT_VEC3
  • PT_FLOAT_VEC4

◆ CreateDisplacementScale()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateDisplacementScale ( GLTF gltf,
const char *  shaderName 
)
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]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.

◆ CreateModelMatrix()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateModelMatrix ( GLTF gltf,
const char *  shaderName 
)
static

Creates a parameter for utilizing the model matrix. The externalName is "MODEL". The model matrix is the model/object part of the modelview matrix.

Returns
Parameter object. Do not delete this pointer.
Parameters
[in]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.

◆ CreateModelViewMatrix()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateModelViewMatrix ( GLTF gltf,
const char *  shaderName 
)
static

Creates a parameter for utilizing the modelview matrix. The externalName is "MODELVIEW".

Returns
Parameter object. Do not delete this pointer.
Parameters
[in]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.
Examples
Test002.cpp, and Test008.cpp.

◆ CreateNormal()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateNormal ( GLTF gltf,
const char *  shaderName 
)
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]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.

◆ CreateNormalMatrix()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateNormalMatrix ( GLTF gltf,
const char *  shaderName 
)
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]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.
Examples
Test002.cpp, and Test008.cpp.

◆ CreatePointSize()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreatePointSize ( GLTF gltf,
const char *  shaderName 
)
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]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.

◆ CreatePosition()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreatePosition ( GLTF gltf,
const char *  shaderName 
)
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]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.

◆ CreateProjectionMatrix()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateProjectionMatrix ( GLTF gltf,
const char *  shaderName 
)
static

Creates a parameter for utilizing the projection matrix. The externalName is "PROJECTION".

Returns
Parameter object. Do not delete this pointer.
Parameters
[in]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.
Examples
Test002.cpp, and Test008.cpp.

◆ CreateTexCoord()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateTexCoord ( GLTF gltf,
const char *  shaderName,
unsigned int  num 
)
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.
Parameters
[in]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.
[in]numTexture number, starting at 0.

◆ CreateTexture()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateTexture ( GLTF gltf,
const char *  shaderName,
unsigned int  num 
)
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.
Parameters
[in]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.
[in]numTexture number, starting at 0.

◆ CreateViewMatrix()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateViewMatrix ( GLTF gltf,
const char *  shaderName 
)
static

Creates a parameter for utilizing the view matrix. The externalName is "VIEW". The view matrix is the view/camera part of the modelview matrix.

Returns
Parameter object. Do not delete this pointer.
Parameters
[in]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.

◆ CreateViewport()

static Parameter* ANSYS::Nexus::GLTFWriter::Parameter::CreateViewport ( GLTF gltf,
const char *  shaderName 
)
static

Creates a parameter for utilizing the viewport. The viewport is a vec4 parameter, with parameters being x,y,w,h. The externalName is "VIEWPORT".

Returns
Parameter object. Do not delete this pointer.
Parameters
[in]gltfGLTF object.
[in]shaderNameName of parameter as defined in shader.

The documentation for this class was generated from the following file:
  • D:/ANSYSDev/NoBackup/branches/EnSight-Second-Coming/webgl_viewer/gltfwriterlib/include/GLTFTechnique.h