Forum

Any quake mod that supports Back face culling?

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

Moderator: InsideQC Admins

Any quake mod that supports Back face culling?

Postby Mexicouger » Fri Apr 29, 2011 2:09 am

I Looked at darkplaces, and it doesn't look like it supports it, is there any other mods that do? I eagerly want to see how it was implemented.
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby leileilol » Fri Apr 29, 2011 2:15 am

backface culling is a renderer feature. you'll have to specify in a .shader in darkplaces to 'cull disable' your material.
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Downsider » Fri Apr 29, 2011 2:21 am

Backface culling is "implemented" by flicking a switch on the GPU.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Re: Any quake mod that supports Back face culling?

Postby Baker » Fri Apr 29, 2011 3:34 am

[removed by self]
Last edited by Baker on Sun May 01, 2011 3:44 pm, edited 1 time in total.
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

Postby mh » Fri Apr 29, 2011 9:10 am

Backface culling can be typically done in hardware or software (or both). Hardware is just a matter of glCullFace, software is done by the BACKFACE_EPSILON/SURF_PLANEBACK stuff (search through the engine source for those two and you'll find all that you need to know).

Why would you do it in software? Simple reason is that if you only do it in hardware then the relevant vertexes need to be sent to the GPU, transformed and recomposed into triangles before they can be culled by hardware. Do it in software too and you can cull on a per-surface level without any of that unnecessary overhead.

Interesting to note that there is a backface culling test in R_RecursiveWorldNode that is completely unnecessary as surfaces are already backfaced properly by the BSP tree walk. It is highly effective for brush model entities though.

Sometimes you don't want to backface cull. There's no point in culling particles and sprites as they're screen-aligned quads which will always be facing the viewpoint. The backface cull test itself is a little bit of extra overhead so in cases like this there's no tradeoff and you want to avoid it.
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
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest