![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
Define if the input color is supposed to be used in a premultiplied way.
Boolean SetInputPremultiplied(Boolean premultiplied)
premultiplied | If true, the input RGB components are multiplied by their alpha component. |
Check if the input color is supposed to be used in a premultiplied way.
Boolean IsInputPremultiplied()
Define if the output color is supposed to be used in a premultiplied way.
Boolean SetOutputPremultiplied(Boolean premultiplied)
premultiplied | If true, the output RGB components are multiplied by the alpha component of the vertex color. |
Check if the output color is supposed to be used in a premultiplied way.
Boolean IsOutputPremultiplied()
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)
enabled | If true, color parameters are used. |
Check if color parameters are used.
Boolean IsColoringEnabled()
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)
enabled | If true, vertex colors are used. |
Check if per-vertex colors are used.
Boolean IsVertexColoringEnabled()
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)
enabled | If true, lighting is enabled. |
Check if lighting is enabled.
Boolean IsLightingEnabled()
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)
unit | The texture unit to enable or disable. |
enabled | If true, texturing is enabled for the given unit. |
Check if texturing is enabled for a given unit.
Boolean IsTexturingEnabled(Integer unit)
unit | The texture unit to check. |
Set the light model used for rendering.
Boolean SetLightModel(Murl.IEnums.LightModel lightModel)
lightModel | the light model to use. |
Get the light model used for rendering.
Murl.IEnums.LightModel GetLightModel()