mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +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:
parent
9d4c2f6308
commit
8e935ad3b1
8 changed files with 158 additions and 35 deletions
|
@ -70,6 +70,9 @@ struct RasterizerOptions {
|
|||
Array<TexCoordGenerationConfig, 4> texcoord_generation_config {};
|
||||
Gfx::IntRect viewport;
|
||||
bool lighting_enabled { false };
|
||||
bool color_material_enabled { false };
|
||||
ColorMaterialFace color_material_face { ColorMaterialFace::FrontAndBack };
|
||||
ColorMaterialMode color_material_mode { ColorMaterialMode::AmbientAndDiffuse };
|
||||
};
|
||||
|
||||
struct LightModelParameters {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue