Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IFixedProgram

The IFixedProgram graph node interface.

Fixed programs represent an easy way to define simple material shaders without having to actually write any GPU shader code. However, they are quite restricted regarding any possible graphical effects; fixed programs are mainly used for simple tasks like flat shading with not more than 2 active texture units, e.g. for rendering HUDs or any othe 2D-only content.

See Graph::IMaterial for attaching a fixed program to a given material. See Graph::IFixedParameters for defining actual program parameters.


Table members

Inherited


Murl.Graph.IProgram

Methods


SetInputPremultiplied(premultiplied)

Define if the input color is supposed to be used in a premultiplied way.

Boolean SetInputPremultiplied(Boolean premultiplied)

Parameters
premultipliedIf true, the input RGB components are multiplied by their alpha component.
Returns
Boolean true if successful.

IsInputPremultiplied()

Check if the input color is supposed to be used in a premultiplied way.

Boolean IsInputPremultiplied()

Returns
Boolean true if premultiplied.

SetOutputPremultiplied(premultiplied)

Define if the output color is supposed to be used in a premultiplied way.

Boolean SetOutputPremultiplied(Boolean premultiplied)

Parameters
premultipliedIf true, the output RGB components are multiplied by the alpha component of the vertex color.
Returns
Boolean true if successful.

IsOutputPremultiplied()

Check if the output color is supposed to be used in a premultiplied way.

Boolean IsOutputPremultiplied()

Returns
Boolean true if premultiplied.

SetColoringEnabled(enabled)

Enable/disable the use of color parameters. If coloring is enabled, the program will make use of the actual color parameters stored in the currently active Graph::IParameters node. If disabled, 100% white is used. Note, that the global alpha (transparency) value of an object is controlled via the alpha value of the diffuse lighting component. If coloring is disabled, alpha fading of the object is also disabled. See also SetLightingEnabled() and SetTexturingEnabled(). If per-vertex colors are enabled (see SetVertexColoringEnabled()), they override the parameter's ambient and diffuse components.

Boolean SetColoringEnabled(Boolean enabled)

Parameters
enabledIf true, color parameters are used.
Returns
Boolean true if successful.

IsColoringEnabled()

Check if color parameters are used.

Boolean IsColoringEnabled()

Returns
Boolean true if color parameters are used.

SetVertexColoringEnabled(enabled)

Enable/disable the use of per-vertex colors. If vertex coloring is enabled, the program will make use of individual per-vertex color values present in the currently active vertex buffer, to be applied for the ambient and diffuse components. If color parameters are also enabled (see SetColoringEnabled()), ambient and diffuse components are taken from per-vertex information, and only specular and emissive components are used from the currently set parameters.

Boolean SetVertexColoringEnabled(Boolean enabled)

Parameters
enabledIf true, vertex colors are used.
Returns
Boolean true if successful.

IsVertexColoringEnabled()

Check if per-vertex colors are used.

Boolean IsVertexColoringEnabled()

Returns
Boolean true if per-vertex colors are used.

SetLightingEnabled(enabled)

Enable/disable simple (1 source) lighting. If lighting is enabled, the program evaluates the lighting equation for a single light source at unit 0, using the four possible lighting components defined in IEnums::LightingComponent. If disabled, only the IEnums::LIGHTING_COMPONENT_DIFFUSE is used. Note: If coloring is disabled, all of these components are set to 100% white (with 100% alpha for the diffuse component). See also SetColoringEnabled() and SetTexturingEnabled().

Boolean SetLightingEnabled(Boolean enabled)

Parameters
enabledIf true, lighting is enabled.
Returns
Boolean true if successful.

IsLightingEnabled()

Check if lighting is enabled.

Boolean IsLightingEnabled()

Returns
Boolean true if lighting is enabled.

SetTexturingEnabled(unit, enabled)

Enable/disable texturing for a given texture unit. If texturing is enabled, the resulting color from the color & lighting evaluation at each pixel is multiplied component-wise with the color retrieved from the active texture at that pixel. If disabled, only the plain color is used. See also SetColoringEnabled() and SetLightingEnabled().

Boolean SetTexturingEnabled(Integer unit, Boolean enabled)

Parameters
unitThe texture unit to enable or disable.
enabledIf true, texturing is enabled for the given unit.
Returns
Boolean true if successful.

IsTexturingEnabled(unit)

Check if texturing is enabled for a given unit.

Boolean IsTexturingEnabled(Integer unit)

Parameters
unitThe texture unit to check.
Returns
Boolean true if texturing is enabled.

SetLightModel(lightModel)

Set the light model used for rendering.

Boolean SetLightModel(Murl.IEnums.LightModel lightModel)

Parameters
lightModelthe light model to use.
Returns
Boolean true if successful.

GetLightModel()

Get the light model used for rendering.

Murl.IEnums.LightModel GetLightModel()

Returns
Murl.IEnums.LightModel The light model used.