New stuff

Time for some more stuuuuff.
The renderer is getting closer to actually being usable right now, save for a few things that I will have to cram in there before I’m ready to start deploying it in my projects.
There’s a ton of optimization to do also, but I’ll hold off on that a tiny bit longer. I just have to get everything in at this point.

So moving on, here’s a tiny thing that is pretty much essential:

It’s a point light. The green stuff is the convex bounding volume, but the volume is optimized using the stencil buffer to remove all parts that don’t affect any geometry, making it much faster.
I’ll add also that this optimization routine isn’t enforced on small lights, due to the potential diminishing return in performance.

I have also added spot lights:

Here are two different kinds of spot lights, see any difference?
Well you probably do. One of them casts a nice shadows on the geometry below.
The other one is the deliberate “slim” version of a spot light which is rendered using the deferred rendering part of the pipeline, which is tons of times faster than the shadow caster spot light.
Similar to the point light the non-shadow caster spot light is also optimized using the stencil buffer.

There’s a reason to why I made two types of the same light. I realized pretty early on that shadows were going to be a pretty slim product in my engine, even though I’m still considering implementing more types of shadows, such as omni light shadows and cascaded shadow maps for outside environments. But right now I’m thinking mostly indoor environments.
The reason why there are two types of spotlight is that one can cast shadows, but can also have a so called “Gobo” that affects how the light looks.
This is something that I’m not willing to cram into my deferred rendering pipeline because that would be a significant bloat for situations that don’t use it. In these cases it’s better to treat the few occurrences of these effects with special measures and leave the really really basic stuff for the main pipeline.

Here’s another picture just for kicks:

You can see how sweet the blend is between the two lights that both cast their own shadow. 😉

After all that I’m pretty much done with the lighting part of the engine for now. I’m pretty happy with what you can do with it, albeit it being limited for some cases. Most of those cases being when we can use shadows and when we can not. I think it makes sense to save the shadow casting lights for dramatic lighting cues that can really make a difference. A lot of games do this nowadays also.

 

Lights aside, here’s something I talked about last time I posted:

Soft particles! 😀
What makes them so special is that they don’t intersect with the rest of the geometry in an ugly way like particles used to do in early 3d games. This technique gives them the look of actual volume, which is very nice indeed.
This effect is also very customizable and optional, because there are a few particle effects that really don’t need it.

What else?
* The shadows are really simple even though they look OK right now. (First time putting shadows in, gimme a break.)
* Particles still don’t play nicely with refractions or water.
* I fixed the water a little from the last post, I totally forgot that the “shore” shouldn’t be that opaque and should be modulated by depth too.
* The Gobo I mentioned isn’t implemented yet.

I’ve been doing a ton of stuff so there’s probably something I left out…
*Shrug* Oh well. Laters. 🙂

2 comments

  1. Yeah, honestly I think it’s one of the better methods invented for modern rendering.
    It really does make a big, big difference in complex environments.

    Basically, if an engine supports it, it’d be silly not to use it. Wonderful things can be made with it… 🙂

Leave a comment