INormalShaderPlugin class

<oceansdk/normalshaderplugin.h>

Description

This interface class allows creating a Normal shader plugin by subclassing it and implementing all pure virtual member functions below.

Namespace

This class is in the namespace Ocean::Sdk

Members

class INormalShaderPlugin : public INormalShader
Vec3<float> valueTS(const IShaderContext *sc) const

[virtual]

Returns the shaded normal vector in the original surface tangent space for the given shader context sc.

Parameters

sc – The shading context for this shader evaluation

Reimplemented from INormalShader::valueTS()

Vec3<float> shadeWS(const IShaderContext *sc, const Vec3<float> &normalWS) const

[virtual]

Transforms a given world space normal vector.

This normal shading operation is done in addition to the one performed by shadeWS().

It is useful for modelling normal perturbations not easy to describe using shadeWS(), such as slight panel tilts over a building surface.

Parameters
  • sc – The shading context for this shader evaluation

  • normalWS – The original world space normal vector

Reimplemented from INormalShader::shadeWS()

const char *typeName() const

[virtual]

Returns the type name for this normal shader, as used internally and in Ocean files.

The type name must contain only lowercase ASCII letters (a-z), underscores (_) and digits (0-9).

Returns

the type name as a null terminated string

const char *prettyTypeName() const

[virtual]

Returns the pretty type name for this normal shader as a zero terminated string. Used in the graphical user interface.

The pretty type name may contain UTF-8 characters.

Returns

the pretty type name as a null terminated string

INormalShaderPlugin *clone() const

[virtual]

Clones the current class, usually implemented by:

{ return new MyClass(*this); }

Returns

pointer to a fresh copy of the object

void getParameters(IParamList *iParamList)

[virtual]

This function asks the normal shader plugin to declare its parameters via the IParamList interface

Parameters

iParamList – The interface for adding parameters

bool setParameter(const char *parameterName, const IParamValue &value)

[virtual]

This function sets the parameter parameterName to the value value

Parameters
  • parameterName – The parameter name

  • value – The new parameter value

Returns

true if the parameter was successfully updated

void addChildren(IAddChildContext *iChildAdd)

[virtual]

This function asks the normal shader plugin to declare its children.

Parameters

iChildAdd – The interface for adding children

bool prepare(const IPrepareContext *iPrepare)

[virtual]

This function asks the normal shader plugin to prepare itself for rendering.

All kind of precomputations should be performed here.

Pointer to children nodes should be retrieved in this function using the IPrepareContext interface

Parameters

iPrepare – The interface for getting child node pointers and other initialization data