SkSL Shader
The Material Sampler does not currently support SkSL Shaders.
SkSL ("Skia Shading Language") is a variant of GLSL which is used as Skia's internal shading language. With some minor modifications, GLSL code from sites like https://www.shadertoy.com/ can be converted for use in Cavalry.
For more detail on the differences between GLSL and SkSL see the Skia documentation.
Note - our SkSL shader currently only takes float uniforms. We will be expanding this functionality soon.
UI
Blend Mode - see Blend Modes.
Shader Code - paste/edit SkSL code here.
Inputs - click the + Add button to to add a uniform.
Examples
Have a play with a selection of example .cv files. 👇
Original source code:
Stars: https://www.shadertoy.com/view/XlfGRj Solar Wind: https://www.shadertoy.com/view/4lf3Rj Clouds: https://www.shadertoy.com/view/4tdSWr Simple: https://www.shadertoy.com/view/XsXXDn
Flat colour
Delete the default
n0uniform. To do this, right click on the attribute and choose Delete Selected Attribute.Use the
+button to add a Color (half4) uniform.Paste the code below into the Shader Code box.
Adjust the color values on the uniform.
Cycling colour
Rename the existing n0 uniform to Time. To do this, right click on the attribute and choose Rename.
Paste the code below into the Shader Code box.
Scrub the Time uniform.

Pixels
Rename the existing n0 uniform to Time. To do this, right click on the attribute and choose Rename.
Use the
+button and choose Add Double 2 (float2) to add a new uniform.Rename the uniform to Resolution.
Paste the code below into the Shader Code box.
Increase the uniform's values.

Fractal Brownian motion
Rename the existing n0 uniform to Time. To do this, right click on the attribute and choose Rename.
Use the
+button and choose Add Double 2 (float2) to add a new uniform.Rename the uniform to Resolution.
Paste the code below into the Shader Code box.
Increase the uniform's values.

Last updated
Was this helpful?