Kekouan

Q2Model, Part 10

2023-04-29

Shadows

My plan to add shadows to Q2Model was to implement a depth map, but my shadows were only going to be computed from the view point of my Sunlight.

3D Model with depth map being applied

Just adding the depth map caused everything to get very dark.

View from the perspective

This is the perspective of the light that will be casting shadows, it's above and behind the model.

Partial shadows

The first evidence I had that shadows were working, but nothing really identifiable. It moved as the model moved though, so that was exciting.

I also had an interesting wall shadow:

Shadows on the wall

I never did figure out where that notch came from, but a couple of changes later I had working shadows:

3D model with shadows

And because I still had a collection of random Quake 2 models lying around: Quake 2 model of Chuckie from Rugrats

It was around this part that I started to see how daunting my plans/project were, if I was going to create all of this from scratch. I did spend some time re-working the lights and shadows to get to this point:

3D model with shadows and lights

But I was still only capable of creating shadows from the perspective of the "Sun".

3D model with shadows and lights

However in doing so I had to remove the text I had that displayed the animation/skin.

That's as far as I got with this. It was at this point I decided that writing a 3D game engine, and also the renderer was going to be too big to tackle. It did however accomplish the goal of making me learn how things worked from the ground up.