Support Forum G3D Web Page |
Lighting environment (not just "environment map") intended for hardware rendering using screen-space approximations of indirect light. More...
Public Member Functions | |
LightingEnvironment () | |
LightingEnvironment (const Any &any) | |
void | copyScreenSpaceBuffers (const shared_ptr< Framebuffer > &framebuffer, const Vector2int16 colorGuardBand, const Vector2int16 depthGuardBand) |
void | getIndirectIlluminationProducingLights (Array< shared_ptr< Light > > &array) const |
Appends onto the array. More... | |
void | getNonShadowCastingLights (Array< shared_ptr< Light > > &array) const |
Appends onto the array. More... | |
int | numShadowCastingLights () const |
void | removeShadowCastingLights () |
Changes the order of the remaining lights. More... | |
const Vector2int16 | screenColorGuardBand () const |
For screenColorTexture(). More... | |
const shared_ptr< Texture > & | screenColorTexture () const |
An image of the color buffer. More... | |
const Vector2int16 | screenDepthGuardBand () const |
const shared_ptr< Texture > & | screenDepthTexture () const |
Used for screen-space reflection and refraction effects. More... | |
void | setShaderArgs (UniformTable &args, const String &prefix="") const |
Binds: More... | |
void | setToDemoLightingEnvironment () |
Creates a default lighting environment for demos, which uses the file on the noonclouds/noonclouds_*.jpg textures. More... | |
Any & | sourceAny () |
Intended for scene editors. More... | |
Any | toAny () const |
Public Attributes | |
shared_ptr< AmbientOcclusion > | ambientOcclusion |
AmbientOcclusionSettings | ambientOcclusionSettings |
Array< shared_ptr< DDGIVolume > > | ddgiVolumeArray |
Array< DDGIVolumeSpecification > | ddgiVolumeSpecificationArray |
Array< shared_ptr< Texture > > | environmentMapArray |
All environment map contributions are summed. More... | |
Array< float > | environmentMapWeightArray |
If the array is empty, all elements are treated as 1.0. More... | |
Array< shared_ptr< Light > > | lightArray |
shared_ptr< UniformTable > | uniformTable |
Additional arguments passed when setShaderArgs() is invoked (if notNull). More... | |
Protected Member Functions | |
void | maybeCopyBuffers () const |
Protected Attributes | |
Any | m_any |
Vector2int16 | m_copiedScreenColorGuardBand |
shared_ptr< Texture > | m_copiedScreenColorTexture |
Vector2int16 | m_copiedScreenDepthGuardBand |
shared_ptr< Texture > | m_copiedScreenDepthTexture |
Lighting environment (not just "environment map") intended for hardware rendering using screen-space approximations of indirect light.
If enabled, uses DDGI for ray-traced diffuse global illumination.
G3D::LightingEnvironment::LightingEnvironment | ( | ) |
G3D::LightingEnvironment::LightingEnvironment | ( | const Any & | any | ) |
void G3D::LightingEnvironment::copyScreenSpaceBuffers | ( | const shared_ptr< Framebuffer > & | framebuffer, |
const Vector2int16 | colorGuardBand, | ||
const Vector2int16 | depthGuardBand | ||
) |
void G3D::LightingEnvironment::getIndirectIlluminationProducingLights | ( | Array< shared_ptr< Light > > & | array | ) | const |
Appends onto the array.
void G3D::LightingEnvironment::getNonShadowCastingLights | ( | Array< shared_ptr< Light > > & | array | ) | const |
Appends onto the array.
|
protected |
int G3D::LightingEnvironment::numShadowCastingLights | ( | ) | const |
void G3D::LightingEnvironment::removeShadowCastingLights | ( | ) |
Changes the order of the remaining lights.
|
inline |
For screenColorTexture().
|
inline |
An image of the color buffer.
This is a copy of the previous buffer; it is never the Texture currently being rendered to.
Commonly used for screen-space reflection and refraction effects.
Returns the all-black texture if not currently allocated
|
inline |
|
inline |
Used for screen-space reflection and refraction effects.
Currently nullptr, likely to be replaced with a linear camera-space Z value in a future release.
void G3D::LightingEnvironment::setShaderArgs | ( | UniformTable & | args, |
const String & | prefix = "" |
||
) | const |
Binds:
void G3D::LightingEnvironment::setToDemoLightingEnvironment | ( | ) |
Creates a default lighting environment for demos, which uses the file on the noonclouds/noonclouds_*.jpg textures.
The code that it uses is below. Note that this loads a cube map every time that it is invoked, so this should not be used within the rendering loop.
|
inline |
Intended for scene editors.
Any G3D::LightingEnvironment::toAny | ( | ) | const |
shared_ptr<AmbientOcclusion> G3D::LightingEnvironment::ambientOcclusion |
AmbientOcclusionSettings G3D::LightingEnvironment::ambientOcclusionSettings |
Array<shared_ptr<DDGIVolume> > G3D::LightingEnvironment::ddgiVolumeArray |
Array<DDGIVolumeSpecification> G3D::LightingEnvironment::ddgiVolumeSpecificationArray |
All environment map contributions are summed.
Environment maps are scaled by a factor of PI when sampled because most environment maps are authored too dark, since legacy shaders often dropped that factor from the Lambertian denominator.
Array<float> G3D::LightingEnvironment::environmentMapWeightArray |
If the array is empty, all elements are treated as 1.0.
|
protected |
Referenced by sourceAny().
|
protected |
Referenced by screenColorGuardBand().
|
protected |
Referenced by screenColorTexture().
|
protected |
Referenced by screenDepthGuardBand().
|
protected |
Referenced by screenDepthTexture().
shared_ptr<UniformTable> G3D::LightingEnvironment::uniformTable |
Additional arguments passed when setShaderArgs() is invoked (if notNull).
This helps when prototyping new shader-based effects that require new uniform arguments. This is a pointer because it may contiain significant state and many renderers clone the lighting environment.