1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:37:45 +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

@ -115,6 +115,7 @@ public:
virtual void gl_lightfv(GLenum light, GLenum pname, GLfloat const* params) = 0;
virtual void gl_materialf(GLenum face, GLenum pname, GLfloat param) = 0;
virtual void gl_materialfv(GLenum face, GLenum pname, GLfloat const* params) = 0;
virtual void gl_color_material(GLenum face, GLenum mode) = 0;
virtual void present() = 0;
};