OptionaldepthDiscard fragments behind what is already drawn. Default true.
OptionaldepthWrite fragment depth into the depth buffer. Defaults to true, except
when transparent is true and depthWrite is not set explicitly.
OptionalglslOptionalsideWhich faces are drawn. Default 'double': no culling, as today.
OptionaltransparentAlpha blending (SRC_ALPHA, ONE_MINUS_SRC_ALPHA) instead of overwriting
the framebuffer, and depth writes off unless depthWrite says
otherwise. Also determines draw order: transparent meshes are drawn
after opaque ones, back to front. Default false.
A material is plain data: shader sources per shading language, a draw mode and a uniforms object. A renderer picks the language it understands (
glslfor WebGL2; a WebGPU renderer would readwgsl), compiles one program per material (shared by all meshes using it) and uploads the uniforms on every draw, skipping the ones that did not change. Replacing a shader source recompiles the program on the next render.