1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:37:34 +00:00

LibGL+LibSoftGPU: Implement glColorMaterial and GL_COLOR_MATERIAL

When `GL_COLOR_MATERIAL` is enabled, specific material parameters can
be overwritten by the current color per-vertex during the lighting
calculations. Which parameter is controlled by `glColorMaterial`.

Also move the lighting calculations _before_ clipping, because the spec
says so. As a result, we interpolate the resulting vertex color instead
of the input color.
This commit is contained in:
Jelle Raaijmakers 2022-01-13 03:03:35 +01:00 committed by Andreas Kling
parent 9d4c2f6308
commit 8e935ad3b1
8 changed files with 158 additions and 35 deletions

View file

@ -93,6 +93,8 @@ extern "C" {
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
// Get parameters
#define GL_COLOR_MATERIAL_FACE 0x0B55
#define GL_COLOR_MATERIAL_MODE 0x0B56
#define GL_COLOR_MATERIAL 0x0B57
#define GL_FOG_START 0x0B63
#define GL_FOG_END 0x0B64