[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/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 - Q2 ref_soft replacement with colored light

Q2 ref_soft replacement with colored light

Discuss anything not covered by any of the other categories.

Moderator: InsideQC Admins

Q2 ref_soft replacement with colored light

Postby qbism » Sun May 18, 2014 6:11 am

Anyone want to betatest a replacement ref_soft.dll that adds colored lighting and widescreen waterwarp support to the Quake 2 software renderer? Alphatest and transparency are improved as a bonus. Not to mention the ddraw palette problem fixed- this one only uses DIB even for fullscreen! Knightmare's 'unofficial Q2 patch' 3.24 is supported, although haven't tried it on any others.

[EDIT: r_coloredlights 0 and fullscreen mode fixed. I hope. Same download links.]
[EDIT2: Added r_lightsaturation cvar for colored light]
[EDIT3: Minor speed improvement, darklight works, and just one (the pretty one!) colored light mode.]
[EDIT4: Unsigned short fix (thanks to Knightmare for the tip) ]


Oh, yeah, and there's a cvar called 'sw_transmooth' that dithers transparent surfaces.

Download dll [edit-updated link]:

Source code:

Notes about the code- It can be copied into the 3.24 source folder. (Make a backup for this purpose.) But I don't have VC 6, so I built it with VS 2013 (project included in the ref_soft folder).
This started with the colored light code leilei added to stock Q2. Shaded light was completed among other things with head-scratching and borrowed pieces of engoo. Waterwarp improvement and dithering are from AROS Quake2.

Image
That orange. r_lightsaturation = 2
Last edited by qbism on Sun Jun 22, 2014 4:23 pm, edited 5 times in total.
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Q2 ref_soft replacement with colored light

Postby dwere » Sun May 18, 2014 3:37 pm

Looks better than I thought it would. But I can't set fullscreen mode for some reason. I'm using the aformentioned 3.24 exe.
dwere
 
Posts: 11
Joined: Tue Dec 31, 2013 11:19 pm

Re: Q2 ref_soft replacement with colored light

Postby leileilol » Sun May 18, 2014 5:20 pm

BTW, r_coloredlights 2 enables 3dfxgl.dll-estimated gamma corrected lighting


Also I can't go fullscreen either and the rendering feels slow at 1280x960. Wish this retained the ASM...
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Q2 ref_soft replacement with colored light

Postby dwere » Sun May 18, 2014 5:57 pm

It's a shame r_coloredlights 0 works as 1. It would be nice to have an all-purpose dll.
dwere
 
Posts: 11
Joined: Tue Dec 31, 2013 11:19 pm

Re: Q2 ref_soft replacement with colored light

Postby Spiney » Sun May 18, 2014 6:12 pm

Don't have Q2 handy, but is it possible to do dithering for multitexture blending? That would be really cool.

edit: just to be clear, I meant mixing color of lighting and level textures "as if" in 24 bit and turning it to 8 bit dither. Not bilinear filtering with dither.
Last edited by Spiney on Mon May 19, 2014 11:38 am, edited 2 times in total.
Spiney
 
Posts: 63
Joined: Mon Feb 13, 2012 1:35 pm

Re: Q2 ref_soft replacement with colored light

Postby leileilol » Sun May 18, 2014 6:32 pm

Engoo has a dithering mode so yes it would be possible.
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Q2 ref_soft replacement with colored light

Postby qbism » Sun May 18, 2014 11:00 pm

fullscreen: Probably lost something in the /win32 source files. Might have missed something in a diff.

r_coloredlights 0: It's broken but should be easy fix.

asm: Not sure how to get it to compile in Visual Studio.

dither: currently implemented for transparencies, r_transmooth 0/1 cvar.

I wonder if there should be a saturation factor for colored lights. SW colored light looks more saturated than GL.
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Q2 ref_soft replacement with colored light

Postby leileilol » Sun May 18, 2014 11:16 pm

Again, wrong term of 'dither'. That is a pixel filtering technique. What I refer to is color reduction via dithering.
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Q2 ref_soft replacement with colored light

Postby qbism » Mon May 19, 2014 12:27 am

Please re-download via links above, I attempted to fix fullscreen and r_coloredlights = 0 modes.

The code uses an ordered dithered kernel per http://www.flipcode.com/archives/Textur ... real.shtml
It is only implemented on transparent R_DrawSpan polys. It looks good on turbulent spans, but a mixed bag everywhere else. I haven't looked at how engoo does it.

BTW, anyone ported Q1 or Q2 code base including asm from VC++ 6 to VS 2008 or higher? When I tried it, compiler doesn't give errors but linker can't find the objs.
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Q2 ref_soft replacement with colored light

Postby qbism » Mon May 19, 2014 4:10 am

Just fixed a bug with transparent flags in r_poly, and added r_lightsaturation cvar.
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Q2 ref_soft replacement with colored light

Postby revelator » Mon May 19, 2014 9:07 am

if i remember correctly you need to encapsulate the asm calls in quotes eg " " in msvc after version 6.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Q2 ref_soft replacement with colored light

Postby qbism » Tue May 20, 2014 2:23 am

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

Re: Q2 ref_soft replacement with colored light

Postby leileilol » Tue May 20, 2014 5:09 am

The dithering I refer to involves the span drawing code along with the surfmip code (to build a 15bpp surfacecache for the spans to dither with).

Play Engoo with Colored Lighting set to "Ultra (Dither)" in 320x200 or so, take a screen capture then zoom in to see what I mean.

And it's worth knowing you'll never need a table bigger than 18-bit since 256 color palettes work strictly in an 18-bit color depth. and a dithering table for 18-bit would be huge so stick to 15bpp for that for now.


The code you just picked is just regards to models, which is intended to apply noise to the light to rough out the banded lighting lookup. Also note that I did not implement model colored lighting the same way in Q2 - I cheated with a post-color calculation, so this feature ported over would be completely useless.
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Q2 ref_soft replacement with colored light

Postby dwere » Tue May 20, 2014 8:55 am

I played the entire Ground Zero with this. Everything was fine until the last level. There's a room containing an unusual lighting trick - a sphere emitting "black light" constantly fading in and out. Everything works as it should with r_coloredlights 0:
http://i.imgur.com/8QMgvkm.png

r_coloredlights 1:
http://i.imgur.com/LETqeGl.png

r_coloredlights 2:
http://i.imgur.com/qS04Ymp.png
dwere
 
Posts: 11
Joined: Tue Dec 31, 2013 11:19 pm

Re: Q2 ref_soft replacement with colored light

Postby revelator » Tue May 20, 2014 9:03 am

i was refering to the .asm files :)
though im not sure if quake2 uses the same method.
quake1 used a tool called gas2masm to convert gnu style asm to masm.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest