This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

LightProb Class

This class is used to create non-dynamical spherical harmonics-based probe light sources. They bake environmental light and after that can imitate dynamic lighting.

LightProb Class

This class inherits from Light

Members


LightProb (vec4 color, vec3 radius)

Constructor. Creates a probe light source.

Arguments

  • vec4 color - Color of the new light source.
  • vec3 radius - Radius of the new light source in units.

void getCoefficients (int id)

Gets the spherical harmonics coefficients set for the probe light source.

Arguments

  • int id - Coefficients vector ID.

vec3 getImageTextureColor (vec3 direction)

Returns a light color at the specified direction.

Arguments

  • vec3 direction - Direction vector.

Return value

Light color at the specified direction.

void getImageTextureImage (Image image)

Grabs the cube texture (RGBA16F) containing the rendered probe light environment.

Arguments

  • Image image - Name of the probe light texture.

vec3 getRadius ()

Returns the current radius of the probe light source.

Return value

Radius of the light source.

void renderImageTexture (float znear, float zfar, int size)

Renders a light image texture.

Arguments

  • float znear - Rendering near clipping plane.
  • float zfar - Rendering far clipping plane.
  • int size - Rendering image size.

void setCoefficients (int id_0, int id_1, float k)

Linearly interpolates between two spherical harmonics coefficients vectors and the sets the resulting one for the probe light source.

Arguments

  • int id_0 - The first coefficients vector ID.
  • int id_1 - The second coefficients vector ID.
  • float k - Interpolation weight.

void setCoefficients (int id)

Sets the spherical harmonics coefficients for the probe light source.

Arguments

  • int id - Coefficients vector ID.

void setImageTextureImage (Image image)

Sets the environment cube texture for the probe light source, so that the spherical harmonics coefficients could be computed.

Arguments

  • Image image - Name of the probe light texture.

void setRadius (vec3 radius)

Sets the radius of the probe light source.

Arguments

  • vec3 radius - Radius values of the probe light source.
Last update: 2017-07-03
Build: ()