basicFragment

View sourcebasicFragment: string

WebGL 2 fragment-shader source for a basic textured-material pipeline.

The shader expects v_uv and v_color varyings, a WebglBasicMaterial block containing enable_vertex_color, opacity, and color, and the main_texture sampler. It starts with material.color; when enable_vertex_color is true, it multiplies that color by v_color before writing output_color.

The source still samples main_texture, but the sampled value and opacity are not used in the output. Compile it with createProgramFromSrc alongside a vertex stage that provides matching v_uv and v_color outputs, then bind the declared uniform block and sampler names.

Default: ...