[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/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 - [quake2] overbright models

[quake2] overbright models

Discuss programming topics that involve the OpenGL API.

Moderator: InsideQC Admins

[quake2] overbright models

Postby marcelo_20xx » Tue Nov 15, 2011 2:11 am

I already implemented overbright in wals so now the game is a lot brighter without washed up textures, but it seems that the routine to include overbrights in models (like npcs and items or your weapons is different). Can somenone give some advice at this, I am working in the 3.21 source provided by ID.
marcelo_20xx
 
Posts: 10
Joined: Sat Nov 12, 2011 2:05 am

Re: [quake2] overbright models

Postby Spike » Tue Nov 15, 2011 6:02 am

overbrights:
Which of the following 2 has the greater dynamic range?

clamp(texture*clamp(lighting*0.5) * 2)
clamp(texture*clamp(lighting))

yup, the top one. that's the maths you need to set up to do your overbrights, instead of the second one.
or in other words, halve the light values passed per-vertex in your engine, and configure the GL_RGB_SCALE_ARB to double the resulting texture samples (or quater/quadruple, your choice).

with lightmaps its the lightmap samples which are halved (before being clamped to 255=1.0), which allows you to double the maximum range in there. with models its the glVertex values which is halved (before being clamped to 255=1.0)
that's the only difference.

if you calc the light levels in the vertex program using non-clamped colour values etc then you can bypass the inner clamp making any overbrighting limit value much much larger. sadly for world lighting, the inner clamp is limited by the precision provided by a 24bit colour image. you can achieve higher ranges by using a floating-point texture format. In the case of q3bsp, the lightmaps are already scaled down to 0.25, while quake/quake2 scales down in the lightmap generation code.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: [quake2] overbright models

Postby Barnes » Tue Nov 15, 2011 7:41 am

User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: [quake2] overbright models

Postby marcelo_20xx » Tue Nov 15, 2011 7:48 am

I forgot to mention that I took the code from this page "http://www.quakewiki.net/quakesrc/28.html" where Vic coded overbrights for the engine, but sadly there isnt working for models. I already took a look at KMQuake2 source and they changed a lot of stuff to get overbrights on models but I wasnt very sure how they implemented this, since the vanilla source and theirs are too much different.
marcelo_20xx
 
Posts: 10
Joined: Sat Nov 12, 2011 2:05 am

Re: [quake2] overbright models

Postby Barnes » Tue Nov 15, 2011 7:52 am

Vic's method really only works for the BSP.
for models and pictures overbright use above code. If I remember correctly it code uses in kmquake2
User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: [quake2] overbright models

Postby marcelo_20xx » Tue Nov 15, 2011 7:58 am

Yep, Vic's code only works for BSPs, thanks for the quick responses to both of you I will go to sleep and see if tomorrow I can get something work.
marcelo_20xx
 
Posts: 10
Joined: Sat Nov 12, 2011 2:05 am

Re: [quake2] overbright models

Postby mh » Tue Nov 15, 2011 10:18 am

User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: [quake2] overbright models

Postby leileilol » Tue Nov 15, 2011 1:36 pm

I should mention that unlike Quake, Quake2's models aren't intended to be overbrightened (not even in software) so brightening only the BSP still is logical.

Don't forget to nuke that stupid "intensity" feature. It sucks.
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: [quake2] overbright models

Postby Barnes » Tue Nov 15, 2011 2:31 pm

I think there is more correct to speak not about the overbright, but the multiplication of the color intensity of 2 times
like
gl_FragColor = color * u_ColorModulate; :D
User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: [quake2] overbright models

Postby mh » Tue Nov 15, 2011 4:38 pm

I believe that Q2 actually does overbright MD2s as it sends their textures through it's lightscale/intensity thing, and glColor/glColorPointer will clamp in the 0..1 range. There is a lot of second-system-effect crap in the Q2 renderer (gl_modulate is something else that must also die) that does confuse the issue though.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: [quake2] overbright models

Postby marcelo_20xx » Tue Nov 15, 2011 5:43 pm

The function that controls the textures in bmodels is "void R_DrawInlineBModel (void)"? (found in gl_rsurf.c). Also this forum is about coding Quake engine? or Quake 2 too?. KmQuake2 already implemented overbright in models but since their project and their webpage is dead I cant find how they did it :(.
marcelo_20xx
 
Posts: 10
Joined: Sat Nov 12, 2011 2:05 am

Re: [quake2] overbright models

Postby revelator » Tue Nov 15, 2011 8:02 pm

Mostly Quake but we do help on Q2 to if we can :)
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2605
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: [quake2] overbright models

Postby marcelo_20xx » Tue Nov 15, 2011 8:25 pm

marcelo_20xx
 
Posts: 10
Joined: Sat Nov 12, 2011 2:05 am

Re: [quake2] overbright models

Postby Barnes » Tue Nov 15, 2011 9:47 pm

User avatar
Barnes
 
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: [quake2] overbright models

Postby mh » Tue Nov 15, 2011 10:48 pm

User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Next

Return to OpenGL Programming

Who is online

Users browsing this forum: No registered users and 1 guest