Every shape drawn by Prowl.Quill is rendered through its backend’s default shader, which handles the standard brush types (solid colour, linear/radial/box gradient, textures) and hardware-accelerated antialiasing. When you need effects that go beyond what the built-in brush system offers — glows, distortions, UV animations, or any full-screen technique — you can replace the default shader on the current brush with your own program. The canvas will use your shader for all subsequent shapes, pass your uniforms verbatim, and correctly batch shapes that share the same shader and uniform values into a single draw call.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Quill/llms.txt
Use this file to discover all available pages before exploring further.
Setting a custom shader
ShaderProgram in an OpenGL backend, or an IPipelineState in a Direct3D backend) to the current brush. From this point forward, every shape drawn will be rendered with that shader.
null (or call ClearCustomShader) to revert to the default shader.
Setting uniforms
Single uniform
float, int, Float2, Float3, Float4, Float4x4.
Multiple uniforms at once
SetShaderUniform for each entry, but slightly more convenient when you have many uniforms to set together.
Removing the custom shader
The ShaderUniforms class
Uniform state is managed by theShaderUniforms class that lives inside the Brush. You normally interact with it indirectly through SetShaderUniform / SetShaderUniforms, but you can also work with DrawCall.ShaderUniforms directly from a renderer implementation.
ShaderUniforms maintains a dirty hash so the batching system can detect changes without comparing every value on every draw call.
Batching model
Prowl.Quill batches consecutive shapes into a singleDrawCall whenever they share the same scissor rectangle, brush (including texture and gradient), and shader + uniforms. Changing the shader, changing any uniform, or calling RequestNewDrawCall() flushes the current batch and starts a new one.
Same state → one draw call
All shapes drawn with the same
SetCustomShader + SetShaderUniform combination are merged into a single GPU draw call automatically.Changed state → new draw call
Updating even one uniform value causes the next shape to start a new
DrawCall. Minimise uniform changes within a frame to keep draw call counts low.DrawCall so later Set calls do not retroactively modify a draw call that has already been recorded.
Uniform responsibility
When a custom shader is active, the renderer does not set the default brush uniforms (gradient matrices, scissor transforms, AA parameters, etc.). Your shader is fully in charge of its own parameters. If you need the standard Quill AA and scissor logic, you must replicate those uniforms in your shader and set them yourself, or compose your effect on top of a post-processing pass.Complete glowing shape example
Compile your shader at startup
Compile the shader once using your backend’s API and hold a reference. This step is backend-specific.
Set the shader and uniforms before drawing
Set state, draw all shapes that should use the glow effect, then clear the shader.
Switching between effects
When you need multiple distinct shader effects in one frame, structure your drawing so all shapes sharing the same shader are drawn consecutively — this keeps the draw call count minimal:Each
SetCustomShader or SetShaderUniform call marks the draw state dirty, which may start a new DrawCall on the next shape. For highest performance, set all uniforms before drawing any shapes rather than interleaving state changes with draw calls.