Update 5-11-14

Objects and Culling


This week was spent writing a system to cull objects at certain distances in such a way that they can fade in and out and also cast shadows. It was also set up to try to share as many materials as possible to lower draw calls.

In the end, the following things were added to the game as real objects that now are part of the culling system.

  1. Bridges (already in but now being culled)
  2. Trees (not in the terrain tree system anymore)
  3. Bushes
  4. Rocks
  5. Fences

The basic procedure is to attach an ObjectFader component to each object and then look at the object’s shader names.

If the object is fading in or out, the word “Transparent/” is prefixed to the shader name if it isn’t there and the shader isn’t a cutout shader (for leaves).

Once, the item is fully visible, it gets its material set to a shared material without the “Transparent/” prefix so that shadows will work.

Transparent/Cutout/(Diffuse or Bumped Specular) are used for leaves since the leaves are set up with alpha patterns to make the leaves grow into existence when fading in.

Also, since there are now real objects, monsters and objects were changed so they now have collisions. with these objects, it isn’t necessary to have them on the server since they are either small enough to walk over (like rocks and fences), or they have capsule colliders that the monsters can slide around.

But that was basically it, just a lot of stuff in the background to start making it easier to deal with objects in the levels.

Some pictures:

Field
Forest
Hills
Swamp
Dark Forest
Wastelend. Rocks need to be red.
Desert
Another Swamp