w23 / xash3d-fwgs

Vulkan Ray Tracing fork of Xash3D FWGS engine. Intended to be merged into master at some point in the future.
161 stars 16 forks source link

rtx: make some sprites emit light #233

Open w23 opened 2 years ago

w23 commented 2 years ago

Some sprites are essentially a light source, so they should have an attached dynamic point light.

EliteCombineSoldier commented 2 years ago

Im No Programmer But i copied the Dlight explosion Code (its in cl_tent.c) and pasted it under some effects (such as r_muzzleflash in cl_tent.c) and it worked it might need to be adjusted case by case im not sure if it applyable to all sprites but this is might be progress

    `dlight_t   *dl;

        dl = CL_AllocDlight( 0 );
        VectorCopy( pos, dl->origin );
        dl->radius = 1000;
        dl->color.r = 250;
        dl->color.g = 250;
        dl->color.b = 150;
        dl->die = cl.time + 0.01f;
        dl->decay = 80;`
0x4E69676874466F78 commented 8 months ago

Здесь стоит иметь ввиду идеи отсюда https://github.com/w23/xash3d-fwgs/issues/277#issuecomment-1526513318

Можно создать /modname/luchiki/sprites/spritename.patch по аналогии с #459 Где сделать что-то вроде такого:

{
"_light" "220 210 150  15000"
"origin" "0 0 0" // сдвиг источника света относительно его центра
}

применится для всех кадров, либо:

{
"_light" "220 210 150  15000"
"_xvk_sprite_frame" "00"
"origin" "0 0 0" // сдвиг источника света относительно его центра
}

применится только для 1 кадра спрайта. Есть мигающие спрайты. Возможно стоит умножать на яркость/цвет текстуры.

Не все спрайты квадратные, поэтому если возможно ещё стоит иметь цилиндрический вид источника где можно настроить его вытянутость.

Ещё полезный комментарий: https://github.com/w23/xash3d-fwgs/issues/153#issuecomment-1453364041

0x4E69676874466F78 commented 3 months ago

Что-то из этого на самом деле очень нужно иначем по эффективности будем проигрывать султиму.