[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Colored lighting faithful to the original colormap?

Colored lighting faithful to the original colormap?

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Colored lighting faithful to the original colormap?

Postby mankrip » Mon Jul 28, 2014 11:22 am

The main reason why I never implemented colored lighting is because I don't want the engine to lose this:
Image
See how the mono lighting makes the walls go from beige to purple, to blue, and to green before going fully black?

It would be easy to blend that lighting with a single colored light, but if multiple colored lights with different colors intersect each other (e.g. a blue light from the quad and a red light from a rocket) and also with a mono light (usually from the BSP's lightmap), I couldn't think of a good way to preserve the color artifacts of the colormap while gradually blending it with the multiple colors of the colored lights.

Any ideas?
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: Colored lighting faithful to the original colormap?

Postby Spike » Mon Jul 28, 2014 6:38 pm

if you're staying 8-bit, the palette is too useless to do coloured lighting (though you might be able to get away with it with dithering, but thats ugly in its own right).

if you want to retain the discolouration, you could probably achieve that by applying some non-linear distortion of the input lightmaps. increase green values at the low end and boost red at the highish end.

or just ask yourself if discoloured banding is really what you like seeing...

if you're doing direct-to-rgb rendering (ie: paletted texture, rgb framebuffer), just do the colormap[lightmap][texture] lookup 3 times per pixel? you'll get the same result for white lights while low green lights will be brighter than low red lights. plus you'll still have the hideous banding thing (although yes, you may get 3 times as much banding as each light channel starts to band at a different point, but as making it ugly appears to be your goal this is somewhat of a moot point and may actually help image quality much like dithering does)...
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Colored lighting faithful to the original colormap?

Postby mankrip » Mon Jul 28, 2014 11:10 pm

Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: Colored lighting faithful to the original colormap?

Postby mankrip » Mon Jul 28, 2014 11:30 pm

Probably a good way to achieve what I'm after is to blend all the lights, calculate the intensity of the resulting saturation, calculate the hue banding inversely proportional to the intensity of the saturation and scaled to the hue banding of the colormap, and apply the resulting banding to the hue of the lighting.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: Colored lighting faithful to the original colormap?

Postby leileilol » Tue Jul 29, 2014 12:20 am

This is why I chose to use a big 18-bit translation table (generated using the same BestColor function that made the colormap). Remember that 8-bit color (in VGA) only has 18-bit color precision, anything more than that is a waste. You'd probably have to do something about BuildLightmapRGB halving precision. Note that Engoo shifts the lightmap a tiny bit brighter to avoid artifacts, so that might have also affected the banding
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Colored lighting faithful to the original colormap?

Postby mankrip » Tue Jul 29, 2014 2:49 am

Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: Colored lighting faithful to the original colormap?

Postby Baker » Tue Jul 29, 2014 3:13 am

I think what was meant by the VGA compatibility is essentially DOSBox compatibility, which should be VGA as far as I know (did they have 16-bit color DOS games ever in the late 90s?).

(And has the nicety of being able on any platform that supports DOSBox which is almost everything)
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Colored lighting faithful to the original colormap?

Postby qbism » Tue Jul 29, 2014 3:45 am

User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Colored lighting faithful to the original colormap?

Postby revelator » Tue Jul 29, 2014 9:51 am

depends how late in the 1990's :) cards like the S3 virge and tseng labs 4000 did have more than 16 bit color
(actually they could both handle 32 bit color but they where so slow that they could not handle a game at that colorsetting).
there where also vesa cards able to run games at 256 color depths.

have a look here
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Colored lighting faithful to the original colormap?

Postby r00k » Tue Jul 29, 2014 1:49 pm

r00k
 
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Colored lighting faithful to the original colormap?

Postby leileilol » Tue Jul 29, 2014 4:02 pm

Probably could recreate it in GLQuake by linearly resampling the lightmap upward x 16, nearest filtering AND palettizing it to the Quake palette :P
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Colored lighting faithful to the original colormap?

Postby mankrip » Sat Aug 09, 2014 12:15 pm

Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 2 guests