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

@ -14,8 +14,7 @@ extern GL::GLContext* g_gl_context;
void glColorMaterial(GLenum face, GLenum mode)
{
// FIXME: implement
dbgln_if(GL_DEBUG, "glColorMaterial({:#x}, {:#x}): unimplemented", face, mode);
g_gl_context->gl_color_material(face, mode);
}
void glLightf(GLenum light, GLenum pname, GLfloat param)