
I belive it's something similar to the software lightmode, but it start decreasing the light in a far distance, and later everything is black.
So? (at least some tip about where is the software lightmode is so I could play with it

Moderator: Graf Zahl
Code: Select all
gzdoom.pk3/shaders/glsl/main.fp - function R_DoomLightingEquation
Code: Select all
lightmode = 8
Thanks Eruanna, that did the trickEruanna wrote:Yes, there is. You will have to use the shader system, though.
I don't know if there's a cleaner way to do this, but you can target the following shader:And use this MAPINFO definition:Code: Select all
gzdoom.pk3/shaders/glsl/main.fp - function R_DoomLightingEquation
Graf might have an idea of how it could/should be done differently, though. I've played with that shader some good bit, though, but nothing that's actually published into a project because main.fp is always changing.Code: Select all
lightmode = 8
Code: Select all
float R_DoomLightingEquation(float light)
{
// Calculated from r_visibility. It differs between walls, floor and sprites.
//
// Wall: globVis = r_WallVisibility
// Floor: r_FloorVisibility / abs(plane.Zat0 - ViewPos.Z)
// Sprite: same as wall
// All are calculated in R_SetVisibility and seem to be decided by the
// aspect ratio amongst other things.
lightscale = clamp(min(pixelpos.w,500.0) / 500.0, 0.0, 1.0);
return lightscale;
}
Code: Select all
/* L is the integer light level used in the game */
float L = 255 - light * 255.0;
//Spooky house Light Equation
float lightscale;
lightscale = clamp(( min(pixelpos.w * L , 76500.0)) / 76500.0, 0.0, 1.0);
Code: Select all
float newlightlevel = 1.0 - R_DoomLightingEquation(uLightLevel);
color.rgb *= newlightlevel;
Code: Select all
float R_DoomLightingEquation(float light)
{
float fullDarkDistance = 100.0; // Adjust this value to what distance you want it to get fully dark.
return clamp(pixelpos.w / fullDarkDistance, 0.0, 1.0) * (1.0 - light);
}
Code: Select all
float R_DoomLightingEquation(float light)
{
float fullDarkDistance = 100.0; // Adjust this value to what distance you want it to get fully dark.
return 1.0 - max((1.0 - pixelpos.w / fullDarkDistance) * light, 0.0);
}