Skip to main content

Post-processing tools 2025 R1

ANSYS::AVZ::GLTFWriter::Light Class Reference

Last update: 16.07.2025

#include <GLTFWriter.h>

Inheritance diagram for ANSYS::AVZ::GLTFWriter::Light:

Static Public Member Functions

static 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 Light * CreateAmbient (GLTF *gltf, float colR=0.3, float colG=0.3, float colB=0.3)
 

Detailed Description

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.

Examples
Test001.cpp, Test004.cpp, Test005.cpp, Test006.cpp, Test007.cpp, Test008.cpp, Test009.cpp, Test010.cpp, Test012.cpp, and Test014.cpp.

Definition at line 30 of file GLTFLight.h.

Constructor & Destructor Documentation

◆ ~Light()

virtual ANSYS::AVZ::GLTFWriter::Light::~Light ( )
inlineprotectedvirtual

Definition at line 33 of file GLTFLight.h.

Member Function Documentation

◆ CreateAmbient()

static Light * ANSYS::AVZ::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.

◆ CreateDirectional()

static Light * ANSYS::AVZ::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.

The documentation for this class was generated from the following file:
  • D:/ANSYSDev/Product-src/webgl_viewer/gltfwriterlib/include/GLTFLight.h

Connect with Ansys