Skip to content

ref: gl: draw normal-rendermode sprites according to their texture format - #2730

Open
oscarsolerfollana wants to merge 1 commit into
FWGS:masterfrom
oscarsolerfollana:fix/sprite-texformat-normal-mode
Open

oscarsolerfollana wants to merge 1 commit into
FWGS:masterfrom
oscarsolerfollana:fix/sprite-texformat-normal-mode

Conversation

@oscarsolerfollana

Copy link
Copy Markdown
Contributor

GoldSrc (inheriting from Quake) draws sprites in kRenderNormal according to the sprite's own texFormat: additive sprites blend additively, indexalpha sprites alpha-blend. Xash disables blending entirely, so they render opaque.

Visible in Natural Selection: the lerk's spore projectile is a client-side temp entity that never sets a rendermode — its indexalpha sprite renders as an opaque green blob instead of a translucent cloud (correct on GoldSrc). Verified fixed in-game.

Minimal repro with any indexalpha sprite, no mod needed:

ent_create env_sprite model sprites/spore2.spr spawnflags 1

Explicit rendermodes are unaffected — the change only touches the kRenderNormal/default path.

…rmat

GoldSrc, inheriting from Quake, draws sprites in kRenderNormal according to
the sprite's own texFormat: additive sprites blend additively and indexalpha
sprites alpha-blend. Xash disabled blending entirely, drawing them opaque.

Visible in Natural Selection: the lerk's spore projectile is a client-side
temp entity that never sets a rendermode, so its indexalpha sprite rendered
as an opaque green blob instead of a translucent cloud. Minimal repro with
any indexalpha sprite, no mod needed:

  ent_create env_sprite model sprites/spore2.spr spawnflags 1
@a1batross

Copy link
Copy Markdown
Member

Thanks, will review it later

Comment thread ref/gl/gl_sprite.c
case kRenderNormal:
default:
pglDisable( GL_BLEND );
// GoldSrc parity: in the normal render mode sprites draw according to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GoldSrc doesn't really check for texFormat when it decides the blending, it only matters during texture load.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we just implement the same blending GoldSrc uses on sprites and a gl_spriteblend cvar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants