IEnvironment class

<oceansdk/environmentplugin.h>

Description

This interface class allows calling a Environment

In the SDK, you will either:

  • Use this class directly to call a child environment

  • Use the derived class IEnvironmentPlugin to create a plugin environment

Namespace

This class is in the namespace Ocean::Sdk

Inherited by

IEnvironmentPlugin

Members

class IEnvironment : public INode
void addRadianceValues(IStokesContext *stokes, const Vec3<float> &direction) const

[virtual]

Parameters
  • stokes – Pointer to stokes to which values must be added

  • direction – The world space direction to compute radiance

Asks the environment to compute polarized radiance in a given direction add it to stokes

See IStokesContext for getting the list of requested wavelengths and for adding radiance

Vec3<float> samplePdf(Vec3<float> *dest, ISampler *sampler) const

[virtual]

Parameters
  • dest – Pointer to the vector where the sampled direction should be stored

  • sampler – Pointer to the sampler

Returns

The sampled probability distribution function (pdf)

Sample the environment using the provided numerical sampler

The probability distribution function (pdf) of sampling the direction must be equal to the value returned by pdf()

All numerical sampling performed in this function must be done through the sampler parameter. No other (pseudo)random generator may be used. See ISampler for more details on how to use it.

For good efficiency, the pdf of this function should be as close to proportional to the environment radiance values computed by addRadianceValues(). More precisely, the optimal pdf is the normalized radiance.

float pdf(const IShaderContext *context, const Vec3<float> &direction) const

[virtual]

Parameters
  • sc – Pointer to the shading context

  • direction – The sampled firection

Returns

The pdf value

Returns the probably distribution function (pdf) of sampling the direction direction when calling samplePdf()