Shader
Write your own GLSL and draw thousands of anything into the scene, lit like a part. Insert one and it starts as a field of grass.


After: A Shader with Instance Count 4500, Vertex Count 24 and Traced on, running the grass shaders Stroke inserts.
A Shader draws InstanceCount copies of VertexCount vertices inside its box (CFrame and Size) with its VertexShader and FragmentShader, whose vertex stage places each vertex from gl_VertexID and gl_InstanceID. Each number, bool, Vector2, Vector3, Color3 or NumberRange attribute becomes a uniform of the same name, beside built-ins like uTime and uSize; glueShade lights a surface like a Part. Status shows "Compiled" or the first error. Traced adds its triangles to the path tracer in Rendered.
Properties
Transform
Shader
| Enabled | boolean | true | |
| FragmentShader | FragmentShader | The FragmentShader instance holding its GLSL, without a version line; it may live anywhere. | |
| InstanceCount | number | 40000 0 or more | How many copies of VertexCount vertices it draws. |
| Primitive | string | Triangles Triangles, Lines, Points | |
| Status | string | Read-only: Compiled, or the first error; a Shader nothing has drawn yet reads Compiled. | |
| Traced | boolean | false | In Rendered, a Triangles Shader with Traced on goes into the path trace instead of over it. |
| VertexCount | number | 24 0 or more | How many vertices each of the InstanceCount copies has. |
| VertexShader | VertexShader | The VertexShader instance holding its GLSL, without a version line; it may live anywhere. |
Scripts
| WorldCFrame | CFrame | scripts only |
