Skip to content

Commit

Permalink
Implement texture environment mode GL_BLEND (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
mardy authored May 25, 2024
1 parent 33bd3b4 commit 7015efc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gc_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,14 @@ static void setup_texture_stage(u8 stage, u8 raster_color, u8 raster_alpha,
GX_SetTevColorIn(stage, raster_color, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC);
GX_SetTevAlphaIn(stage, raster_alpha, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
break;
case GL_BLEND:
/* In data: c: Texture Color, a: raster value, b: tex env
* Operation: a(1-c)+b*c
* Until we implement GL_TEXTURE_ENV_COLOR, use white (GX_CC_ONE) for
* the tex env color. */
GX_SetTevColorIn(stage, raster_color, GX_CC_ONE, GX_CC_TEXC, GX_CC_ZERO);
GX_SetTevAlphaIn(stage, GX_CA_ZERO, raster_alpha, GX_CA_TEXA, GX_CA_ZERO);
break;
case GL_MODULATE:
default:
// In data: c: Texture Color b: raster value, Operation: b*c
Expand Down

0 comments on commit 7015efc

Please sign in to comment.