Skip to main content

Post-processing tools 2023 R2

ANSYS::Nexus::GLTFWriter::Light Class Reference

Last update: 17.04.2023

Lights define the light objects that can be added to a light node. More...

#include <GLTFWriter.h>

Inheritance diagram for ANSYS::Nexus::GLTFWriter::Light:

Static Public Member Functions

static LightCreateDirectional (GLTF *gltf, float colR=1, float colG=1, float colB=1, float dirX=0, float dirY=0, float dirZ=-1, float specColR=1, float specColG=1, float specColB=1, float shininess=100)
 
static LightCreateAmbient (GLTF *gltf, float colR=0.3, float colG=0.3, float colB=0.3)
 

Detailed Description

Lights define the light objects that can be added to a light node.

Lights are only required for techniques that have auto-generated programs. For auto-generated programs, the programs contain lighting code for each light. Currently only Ambient and Directional lights are supported.

For non-auto-generated programs, it is the responsibility of the program writer to generate a program that performs lighting calculations.

Definition at line 30 of file GLTFLight.h.

Member Function Documentation

◆ CreateAmbient()

static Light* ANSYS::Nexus::GLTFWriter::Light::CreateAmbient ( GLTF gltf,
float  colR = 0.3,
float  colG = 0.3,
float  colB = 0.3 
)
static

Creates an Ambient light.

Returns
Light object. Do not delete this pointer.
Parameters
[in]gltfGLTF object.
[in]colROptional, red component. Ranges from 0 to 1.
[in]colGOptional, green component. Ranges from 0 to 1.
[in]colBOptional, blue component. Ranges from 0 to 1.
Examples
Test001.cpp, Test004.cpp, Test005.cpp, Test006.cpp, Test007.cpp, Test008.cpp, Test009.cpp, Test010.cpp, Test012.cpp, and Test014.cpp.

◆ CreateDirectional()

static Light* ANSYS::Nexus::GLTFWriter::Light::CreateDirectional ( GLTF gltf,
float  colR = 1,
float  colG = 1,
float  colB = 1,
float  dirX = 0,
float  dirY = 0,
float  dirZ = -1,
float  specColR = 1,
float  specColG = 1,
float  specColB = 1,
float  shininess = 100 
)
static

Creates a Directional light.

Returns
Light object. Do not delete this pointer.
Parameters
[in]gltfGLTF object.
[in]colROptional, red component. Ranges from 0 to 1.
[in]colGOptional, green component. Ranges from 0 to 1.
[in]colBOptional, blue component. Ranges from 0 to 1.
[in]dirXOptional, X component of direction.
[in]dirYOptional, Y component of direction.
[in]dirZOptional, Z component of direction.
[in]specColROptional, red component of specular reflection. Ranges from 0 to 1.
[in]specColGOptional, green component of specular reflection. Ranges from 0 to 1.
[in]specColBOptional, blue component of specular reflection. Ranges from 0 to 1.
[in]shininessOptional, shininess of specular reflection. Ranges from 0 to 128.
Examples
Test001.cpp, Test004.cpp, Test005.cpp, Test006.cpp, Test007.cpp, Test008.cpp, Test009.cpp, Test010.cpp, Test012.cpp, and Test014.cpp.

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