C4 Engine
C4 Engine API Documentation

class ShaderParameterController

Defined in:  C4Controller.h
The ShaderParameterController class manages a changing shader parameter.

class ShaderParameterController final : public Controller, public Observer<ShaderParameterController, Controller>


ShaderParameterController(int32 slot, const char *connectorKey = "");

slot The shader parameter slot. This must be in the range [0, 7].
connectorKey The connector key belonging to the target node through which another controller is observed.
The ShaderParameterController class is assigned to a Geometry node or Effect node to modify one of the shader parameters used by the node's material. The index of the shader parameter slot is specified by the slot parameter. When the shader parameter is modified, it affects only the target node and not all nodes using the same material as the target node.

The connectorKey parameter optionally specifies a connector belonging to the shader parameter controller's target node that is connected to another node having a controller that generates a color output. The shader parameter controller observes the connected node's controller and responds to kEventControllerColorUpdate events by updating the shader parameter to the color value output by the other controller. The StrobeController, FlickerController, and FlashController classes generate such outputs and are capable of driving a ShaderParameterController.
Base Classes
Controller A ShaderParameterController is a specific type of controller.
Observer<ShaderParameterController, Controller> A ShaderParameterController observes another controller for color update events.
See Also