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.

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

NameTypeDefaultDescription
CFrameCFrameWith Size, the box the Shader draws inside.
OrientationVector3The rotation half of CFrame, hidden from Properties.
PositionVector3The position half of CFrame, hidden from Properties.
SizeVector324, 2, 24With CFrame, the box the Shader draws inside.

Shader

Enabledbooleantrue
FragmentShaderFragmentShaderThe FragmentShader instance holding its GLSL, without a version line; it may live anywhere.
InstanceCountnumber40000
0 to 4e+06
How many copies of VertexCount vertices it draws.
Primitivestring"Triangles"
Triangles, Lines, Points
StatusstringRead-only: Compiled, or the first error; a Shader nothing has drawn yet reads Compiled.
TracedbooleanfalseIn Rendered, a Triangles Shader with Traced on goes into the path trace instead of over it.
VertexCountnumber24
0 to 1e+06
How many vertices each of the InstanceCount copies has.
VertexShaderVertexShaderThe VertexShader instance holding its GLSL, without a version line; it may live anywhere.

Scripts

WorldCFrameCFramescripts only
From Instance 22