FAQ  •  Register  •  Login

Qrack Coronas Fixed How?

Moderator: Inside3D Admins

<<

Baker

User avatar

Posts: 3182

Joined: Tue Mar 14, 2006 5:15 am

Post Mon May 07, 2012 10:41 am

Qrack Coronas Fixed How?

R00k, if you read this ... how did you end up fixing Qrack's coronas?

Last year when my laptop died in September, I lost all my old Qrack source codes so I don't quite have the ability to backtrace through the versions.

If I recall, the historical issue with Qrack coronas is that they specifically would appear through world entities (doors, the fake start map floor) so I am guessing they used vis.

Without knowing, I'm going to guess you used the traceline that the QMB particle stuff uses that also collides against ... ugh ... I can't remember what it also collides against ... but it was an improved traceline of some sort. QMB particles have to collide with everything and use an enhanced traceline that isn't quite the same as the standard traceline, but it has been 9 months since I've thought about what makes it different (because it was crashing my engine at one point ... well not directly, but it wasn't fond of being connected to a server without the map :D ).

/A somewhat crappy quality post, but then again I'm trying to aggressively attack my "to-do" list
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 ..
<<

Spike

Posts: 2070

Joined: Fri Nov 05, 2004 3:12 am

Location: UK

Post Mon May 07, 2012 10:54 am

Re: Qrack Coronas Fixed How?

you can also trace against either cl_visentities (I think it was) or cl_entities+cl_staticentities.
remember that sv_recursivehullcheck will only check ONE bsp object.

the alternative is to use GL_ARB_occlusion_query (the idealistic method, though somewhat awkward), or just directly sampling the depth buffer (the cheap hack that will stall the gpu, but is meant to work on pre-geforce2 cards and requires some matrix know how).
<<

mh

User avatar

Posts: 2172

Joined: Sat Jan 12, 2008 1:38 am

Post Mon May 07, 2012 2:03 pm

Re: Qrack Coronas Fixed How?

Occlusion query is the way I'd do it, but it should also be possible to hack something up using polygon offset (may need careful tweaking though).
Like the fifth day of playing 24-hour Scrabble when you don't want to use any letters because each one means a world to you because you're so deranged.
<<

leileilol

User avatar

Posts: 2399

Joined: Fri Oct 15, 2004 3:23 am

Post Mon May 07, 2012 7:18 pm

Re: Qrack Coronas Fixed How?

readpixels is slow but accurate, but don't have too many of those. They can be a big performance hit on modern hardware.

q3 and TF2 have readpixels flares. TF2 sometimes had updates which used ludicrous amounts of them leading to slowdown, making players blame something else for it (like model LODs or particles in the soldier 2011 update, when it's really just the flares coming off the trails of the cow mangler projectiles)
<<

mh

User avatar

Posts: 2172

Joined: Sat Jan 12, 2008 1:38 am

Post Mon May 07, 2012 9:18 pm

Re: Qrack Coronas Fixed How?

A single readpixels of even a 1x1 region will cause a pipeline stall. You could probably do it asynchronously to a PBO then grab the result in the following frame (on the principle that things don't change too much between any two consecutive frames) but that ends up being not very different to what you need to do with occlusion queries, so you may as well just use occlusion queries.

Hmmm - a 3D texture may be good for this too.
Like the fifth day of playing 24-hour Scrabble when you don't want to use any letters because each one means a world to you because you're so deranged.
<<

r00k

Posts: 908

Joined: Sat Nov 13, 2004 10:39 pm

Post Mon May 07, 2012 10:25 pm

Re: Qrack Coronas Fixed How?

  Code:

   GL_Bind(corona_textures[f->coronatexnum]);

   //glDisable(GL_DEPTH_TEST); //R00k: removed this so coronas are not visible through doors/plats
   glDepthMask (GL_FALSE);   // don't bother writing Z
   glBlendFunc(GL_SRC_ALPHA, GL_ONE);
   glEnable (GL_BLEND);
   glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

<<

reckless

Posts: 1637

Joined: Thu Jan 24, 2008 12:04 pm

Location: inside tha debugger

Post Mon May 07, 2012 11:10 pm

Re: Qrack Coronas Fixed How?

Hehe elegant ;) it also reared its ugly head on some other code i was working on and i was like wtf this works nicely though.
Funny thing related to depth checking if you try realm notice the water at r_wateralpha 1 if theres a lightsource (torch etc) on the other side the light from it is still visible (kinda a poor mans wall hack hehe) you cant see much else though.
Productivity is a state of mind.
<<

Baker

User avatar

Posts: 3182

Joined: Tue Mar 14, 2006 5:15 am

Post Wed May 09, 2012 12:36 am

Re: Qrack Coronas Fixed How?

r00k wrote:
  Code:

   GL_Bind(corona_textures[f->coronatexnum]);

   //glDisable(GL_DEPTH_TEST); //R00k: removed this so coronas are not visible through doors/plats
   glDepthMask (GL_FALSE);   // don't bother writing Z
   glBlendFunc(GL_SRC_ALPHA, GL_ONE);
   glEnable (GL_BLEND);
   glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);



That was anti-climatic. And anti-climatic is good :D

Since Qrack had the problem for maybe 3 years, I thought somehow the issue was "hard to fix".
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 ..

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.
Icons provided by Aha Soft