![]() ![]() Solution: create the heighfield (I have a very good noise function). The problem is that you can't create a heighfield of more that 1 cube high, as then slanted surfaces would cross cube boundaries, and not all combinations are representable. Implementation is well defined, but a fair bit of work making it all run smooth.Īlgorithm for creating heighfields in Sauerbraten. Sectors need to be at least an entire detailed "room" or area. Placing too many portals can hurt performance, as sectors fragment GPU workloads. Clever use of mountains and large buildings can help. an area can be culled from rendering even though it is within the fog distance, because the portal to it is outside the fog distance. Fog + portals can still cull effectively outdoor, i.e. Of couse highly effective in indoor, it can still help in outdoor, though fog & LOD may be additionally required to help. With correct portal placement, this soon reduces the set of visible portals to zero, and thus rendering is done. Collect the list of portals touching those sectors, and intersect them with the first set of portals, rather than the view frustrum. Render all sectors connected to the visible portals. Test each with the view frustrum and only retain the visible ones. For the record: Find the sector the camer is in, and render it. when rendering, do the usual portal things.a vector of struct sector, each of which has a vector of portal ids, and a list of vertex arrays.a vector of struct portal, each of which has 2 sector ids, and portal surface dimensions.it gets set after a sectorize, and reset whenever geometry is edited a boolean in the map header that says wether sector information is valid.two numbers in a "cube" structure: portal and sector.This all means the following addition data.When a surface gets generated (which, by definition, is because it touches a non solid cube), the sector of that cube gets checked and the surface added to the vertex arrays of that sector. now when sauer goes through its process of generating vertex arrays for the level, it effectively treats each sector as a seperate level.portal cubes are made part of the sector which is not on the side of the portal plane.A sector structure this refers to holds a list of all portal numbers found during this traversal mark all these cube with a sector number.semi-solids have to be treated with care to see where to flood fill. flood fill all cubes reachable from there, not crossing solids or portal cubes.What this does is very simple: repeat until all cubes are sectorized: as a preprocess phase it now recomputes all sectors (at some point we will combine "calclight", "remip" and "sectorize" into a single command to make a level suitable for distribution).The engine will keep track of these portal surfaces (the cube refers to the portal number). The side of the selection that has the grid on has special meaning: this is the actual portal surface. Portals generally are placed in visibility bottleneck between larger areas, for example a doorway going into another room. This will mark all cubes involved as "portal" and also make them nonsolid. level designers mark a selection of solids, and then execute a "makeportal" command. ![]() This is how portals will be implemented in Sauerbraten (again, there is no urgent need for it right now, there are other things to be implemented first). One simple scheme that makes most sense on todays hardware is portals. Occlusion culling is not trivial in sauer, because of its highly generic scene structure. For many kinds of levels, real occlusion culling will be required. Heavy fog can help but is a nasty solution. This is not a big issue right now, as it has very efficient geometry throughput, levels are relatively small, and the average graphics card nowadays seriously overpowers sauer's modest rendering requirements.Īs we move to the future, 2 things will make this problematic: first, shaders will increase the fillrate & pixelshader load, and in combination with larger levels (causing more overdraw), this will make the engine entirely fillrate/pixelshader bound. Right now, Sauerbraten performs no occlusion culling. Sauerbraten Portal Scheme (Occlusion Culling). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |