Quake3World.com Forums
     Programming Discussion
        distance culling surfaces


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: distance culling surfaces

Grunt
Grunt
Joined: 28 Mar 2014
Posts: 59
PostPosted: 10-10-2015 05:48 PM           Profile Send private message  E-mail  Edit post Reply with quote


In Wolfenstein and Spearmint's foliage code, shaders can be given the instruction to have the game cull them at a distance. I'm trying to create way for the game to cull surfaces at a distance by shader, possibly fade too, but without the use of all the foliage instance code and whatnot.

Wolf uses does this in RB_SurfaceFoliage but is there a way to just plug what its doing right into RB_SurfaceTriangles? From a brief glance it looks like wolf records the origin of each instance to be used for distance cull. Instead of using the instance origin is there a way to use the surface's origin?

I'm just trying to cull a lot of needless traingles at a distance. It could be by another approach too. Like all detail brushes would cull at a set distance but leave structural brushes. Or maybe a type of instruction in q3map2 that would convert a func_group into a different type of brushes that culled at distance.




Top
                 

Veteran
Veteran
Joined: 17 May 2011
Posts: 159
PostPosted: 10-11-2015 01:32 AM           Profile Send private message  E-mail  Edit post Reply with quote


Captaintoottoot wrote:
I'm just trying to cull a lot of needless traingles at a distance. It could be by another approach too. Like all detail brushes would cull at a set distance but leave structural brushes. Or maybe a type of instruction in q3map2 that would convert a func_group into a different type of brushes that culled at distance.


First of all, I'd only use the structural brushes to show the VIS compiler how to do the area portals, and make all the rest in detail (in my "Lo Sota Olt" map, everything was detail and was inside rectangle boxes made of caulk that were structural).

What you can do, if you're making a mod, is add a new "func" entity type, based of the other, except this one would be static. Then, in the cgame cg_ents.c, you add a special process that picks up your new "func_drawdist" entity and then calculate the distance from the player.
With this method, you could even maybe specify the distance you want directly in the editor and pick it up later !



_________________
My blog - My portfolio
---------------------
MJDM2 - DmeatSP01 - DmeatSP02


Top
                 

Grunt
Grunt
Joined: 28 Mar 2014
Posts: 59
PostPosted: 10-13-2015 12:02 PM           Profile Send private message  E-mail  Edit post Reply with quote


Actually I did already do something like this with map models. Adjustable distances and whatnot. I was trying to find another way of doing this without having to use a bunch of models and game entities.




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.