logo

r_speeds - bsp
by Egir Helgrimson

      Most mappers know that the more they see from a certain angle ingame the more lag will appear. But plane is sometimes devided into smaller chunks which also causes lag.

     In this tutorial I will shortly explain what will cause bsp to devide your planes.

Leafnodes

      A leafnode is an area in a map with a coresponding table of which polygons will ever be visible. The position of a leafnode is decided by bsp and the table is calculated by vis.

      Blue lines are the faces of a leafnode. The red lines indicates the line of sight. faces marked with orange will never be rendered from within the leafnode shown - hence they don't figure in the leafnodes table of faces.

      Thick worldbrushes and brushes textured with HINT decides where the face of leafnodes are. But that is not enough. As an extra security the bsp program also creates leafnodes at 1024x1024x4096 starting at (0,0,0) in the map.

     You can ajust the max nodesize with the -maxnodesize # paramter to your bsp executable. Where # normaly is 1024. If you make it smaller r_speeds will raize but compiletime will go faster.

      No plane can reach from one leafnode to another, so any brush will be sliced as it goes through a face in the leafnode.

      If the plane needed 1 polygon to be drawn before, it now needs two. This doubles the r_speeds caused by the specific plane and thereby adds lag.

Subdevide

      All planes will be subdevided with 240 units when you compile. This is show on the screenshot below, where I used a 128x128 texture. Click to enlarge. You can make a simular view in half-life with the "gl_wireframe 2" command in console.

      Subdevide has two effects.

     Effect number one - r_speeds will raise each time a plane is subdevided. Exactly the same way as it does when reaching through a leafface (border of a leafnode).

     Effect number two - When a plane is subdevided Half-life don't have to render all of it but only the part of the plane which is in the direction of view and listed in the leafnode table corosponding to our present position ingame.

      We can make less polygons on a plane by streching the texture, since the 240 subdevide flollows the texture scale. That is why mappers have adviced you to strech out textures in open areas.

      Subdevide do comply to func_walls aswell, even those with render mode set to texture.

     You can change the subdevide size by using the -subdevide # parameter to your bsp executable, where # is the number of units each subdevide should be. The maximum is 240. Since this is the default there is no reason to change it.

      If you make a level with lots of walls, you might find it natural to make them 256 units heigh. But it would be even better if you made those walls 16 units lower (if you didn't scale the texture). Because then you will reduce r_speeds caused by the wall with up to 50%. That is r_speeds reduction for ya.

Back


Last updated the 25th of june2003 - Copyright www.egir.dk