IScalarShaderPlugin class

<oceansdk/scalarshaderplugin.h>

Description

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

Namespace

This class is in the namespace Ocean::Sdk

Members

class IScalarShaderPlugin : public IScalarShader
float value(const IShaderContext *sc) const

[virtual]

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

Parameters

sc – The shading context

Returns

the shader value for the given shader context sc.

Reimplemented from IScalarShader::hasAlpha()

const char *typeName() const

[virtual]

Returns the type name for this scalar 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 scalar 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

IScalarShaderPlugin *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 scalar 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 scalar shader plugin to declare its children.

Parameters

iChildAdd – The interface for adding children

bool prepare(const IPrepareContext *iPrepare)

[virtual]

This function asks the scalar 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