DarkPlacesEngine / DarkPlaces

The DarkPlaces Quake engine, created by LadyHavoc. Official Git repository (replaces SVN).
https://icculus.org/twilight/darkplaces/
GNU General Public License v2.0
273 stars 39 forks source link

EF_ADDITIVE SPRITES are LIT by map (?) + partial fix #130

Open Baker7 opened 6 months ago

Baker7 commented 6 months ago

In Classic DarkPlaces, sprites with "!" (exclaim) anywhere in the name are lit, all other sprites are not. Light globes and bubbles in Quake, which are fullbright.

Additive sprites are by definition fullbright, since additive blending cannot subtract from color, only add.

In DarkPlaces Beta and tested against Beta Autobuild 20240210 -- I made some smoke that did light correctly in DarkPlaces Beta.

I "fixed" this issue by adding EF_ADDITIVE in addition to EF_FULLBRIGHT in cl_main.c

    // tenebrae's sprites are all additive mode (weird)
    ... 15 lines down +/-
        if (false == Have_Flag (e->render.effects, EF_FULLBRIGHT | EF_ADDITIVE_32)) // Baker: Added EF_ADDITIVE
            e->render.crflags |= RENDER_LIGHT;
    }

I'm not sure if the scope of the problem is limited to EF_ADDITIVE or not, sprite use in 3D in Quake is rather rare so I have difficulty even thinking of instances where sprites are used in 3d space other than stuff like maybe Nehahra snow (?), but I know it exists.

After adding EF_ADDITIVE ... honestly the smoke in DarkPlaces Beta is better looking than the equivalent in DarkPlaces Classic -- I'm not sure if that is a bug or feature.

The smoke I made seems to react to light better and I used a Spike/Spoike/Shpoike info he told me about Tenebrae last year and mixed up additive and non-additive particles in smoke it looks better than additive smoke.

-- Which is the verbose way of saying whatever changed in DarkPlaces Beta seems to be very nice with this slight adjustment.

ADD: EF_ADDITIVE can be used on things other than sprites, I cannot think of a mod using using EF_ADDITIVE on a model -- maybe Xonotic does somewhere. There is no reason to believe that the above applies only to sprites.

hemebond commented 5 months ago

In Classic DarkPlaces, sprites with "!" (exclaim) anywhere in the name are lit, all other sprites are not. Light globes and bubbles in Quake, which are fullbright.

Is this different in Beta? The bubbles I see are fullbright. Can you share a screenshot of the comparison?

Baker7 commented 5 months ago

I'll do some pics when I get a chance, I'll have to dig around and find the sprites and setup a test.

Baker7 commented 4 months ago

Image of correct DarkPlaces 2014 behavior

smokey_lit_sprite

Here is a smokey.sav and a sprite ... toss both in quake\id1 folder

https://www.moddb.com/mods/zircon-engine/addons/smokey-lit-sprite

Type "impulse 255" to give yourself quad.

Try this in DarkPlaces 2014 to see the sprite correctly affected by the lighting.

NOTE: My "fix" in this thread DOES NOT CORRECTLY address the issue and should be ignored.