Qrack Coronas Fixed How?

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Qrack Coronas Fixed How?

Post by Baker »

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: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Qrack Coronas Fixed How?

Post by Spike »

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
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Qrack Coronas Fixed How?

Post by mh »

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).
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Qrack Coronas Fixed How?

Post by leileilol »

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)
i should not be here
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Qrack Coronas Fixed How?

Post by mh »

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.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Re: Qrack Coronas Fixed How?

Post by r00k »

Code: Select all


	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);

revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Qrack Coronas Fixed How?

Post by revelator »

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
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Qrack Coronas Fixed How?

Post by Baker »

r00k wrote:

Code: Select all


	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 ..
Post Reply