Advertisement Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

The Shaft

Sign in to follow this  


Made some more AI fixes, and worked on some particles. I had dust in the game a long time ago, and needed it for the first level, so I resurrected the dust particle system and largely re-wrote it.

I'm not thrilled with it - it can look great or horrible depending on what happens. I do some simple physics by treating the dust particles as spheres to try to get them to not penetrate walls or other objects, but, while that helps most of the time, it can do some strange things as well when caught by a door, etc.

The main issue I'm having with it is the lighting. I tuned the per-material dust color to work in the sunlight, so it's too bright and distracting in the shade.

The same issue happens with characters, where their ambient lighting is too bright in indoor areas, although they are properly shadowed.

I had a semi-solution for this a long time ago by storing a voxelized ambient light grid around the level. I just looked over the code again and realized it's a bit broken wrt to the trilinear filter - the weights are computed wrong. Plus a full voxelization of the level is out of the question for our bigger levels now. I considered doing an adaptive octree to store bent normals and occlusion or SH coefficients, but I think I'm going to simplify it a bit.

I'm going to use a simpler trick and see if that works first. Basically, cast a couple of upward rays from the character or particle, average the occlusion results, and also temporally average it as well. Very similar to what I do for the direct entity lighting for those objects that don't receive world shadows.

Note the dust looks ok in the near ground, but for the cultist further back it looks off.

Here's an idea for the dust at least - have it use the creating object's lighting info...

I could use the old quake2 trick of grabbing the lightmap underneath the character's feet, but my light map geometry is not in the aabb with the collision stuff...

Yesterday I made some more editor fixes, and added light shafts. There are many complex and expensive ways to do this, but I decided to try the simplest thing that could possibly work - which is a drawing a translucent mesh with cleverly scrolling textures on it. It looks best with back faces only or culling off completely, unless it intersects something on the ground, in which case, culling off is the way to go.

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!