AddFragmentShader

Category: Global
Since engine version: 8.0 OC

Description

Adds shader slices to a category of shaders or to a single shader. Returns an identifier for removal.

Syntax

int AddFragmentShader(string category, string shader);

Parameters

category:
Shader category or shader name the slices are added to. Known categories:
Category Description
Common Applies to everything.
Object Applies to all objects and sprites.
Landscape Applies to the landscape.
shader:
The GLSL shader code.

Remark

Consider using built-in functions such as SetGamma, SetMatAdjust, or SetClrModulation for changing colors instead of writing a custom shader.

Example

AddFragmentShader("Landscape", "slice(color+1) { fragColor.r = 1.f; }");
Makes the landscape very red.
See also: RemoveShader
Luchs, 2016-10