IScalarShader class

<oceansdk/scalarshaderplugin.h>

Description

This interface class allows calling a Scalar shader

In the SDK, you will either:

  • Use this class directly to call a child scalar shader

  • Use the derived class IScalarShaderPlugin to create a plugin scalar shader

Namespace

This class is in the namespace Ocean::Sdk

Inherited by

IScalarShaderPlugin

Members

class IScalarShader : public INode
void getValues(float *dest, const IShaderContext *sc) const

[virtual]

Asks the shader to compute its values in dest for the given shader context sc.

Parameters
  • dest – Pointer to a float array where the function should store its result

  • sc – The shading context for this shader evaluation

The size of dest should be retrieved using IShaderContext::numWavelengths().

Wavelengths may be retrieved using IShaderContext::getWavelength()

float decay(const IShaderContext *sc) const

[virtual]

Returns the shader decay value for the given shader context sc.

Parameters

sc – The shading context

Returns

the decay value for the given shader context sc.

float alpha(const IShaderContext *sc) const

[virtual]

Parameters

sc – The shading context

Returns

the opacity for the given shader context sc.

bool hasAlpha() const

[virtual]

Returns

false if alpha() returns always 1.0, true otherwise

float approxAverage() const

[virtual]

This value is used internally by Ocean for improving sampling efficiency. It returns an approximative average of the shader, both spatially and spectrally.

Returns

approximative average return value