IFilterShaderPlugin class¶
<oceansdk/filtershaderplugin.h>
Description¶
This interface class allows creating a Filter shader plugin by subclassing it and implementing all pure virtual member functions below.
Namespace¶
This class is in the namespace Ocean::Sdk
Members¶
-
class
IFilterShaderPlugin
: public IFilterShader¶ -
void
getValues
(float *dest, const IShaderContext *sc) const¶ [virtual]
Asks the shader to compute its values in
dest
for the given shader contextsc
.- 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 usingIShaderContext::numWavelengths()
.Wavelengths may be retrieved using
IShaderContext::getWavelength()
Reimplemented from
IFilterShader::getValues()
-
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
.
Reimplemented from
IFilterShader::decay()
-
float
alpha
(const IShaderContext *sc) const¶ [virtual]
- Parameters
sc – The shading context
- Returns
the opacity for the given shader context
sc
.
Reimplemented from
IFilterShader::alpha()
-
bool
hasAlpha
() const¶ [virtual]
- Returns
false if
alpha()
returns always 1.0, true otherwise
Reimplemented from
IFilterShader::hasAlpha()
-
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
Reimplemented from
IFilterShader::approxAverage()
-
const char *
typeName
() const¶ [virtual]
Returns the type name for this filter 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 filter 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
-
IFilterShaderPlugin *
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 filter 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 valuevalue
- 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 filter shader plugin to declare its children.
- Parameters
iChildAdd – The interface for adding children
-
bool
prepare
(const IPrepareContext *iPrepare)¶ [virtual]
This function asks the filter 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
-
void