shadow mapping woes

I stripped the MetalDeferredLighting demo down to just the shadow map bits. I removed the light fairies, skybox and bump mapping. However, I couldn't remove the (model) structure group, material, and scaling dependencies in favour of loading a simple quad.


It would be nice if sample code did 1 thing, and with a minimal amount of code. Ideally, separate (digestible) demo projects for each technique.


I managed to port the stripped down bits over to my project. The 2 pass render pipeline is in place and all the color attachments look good (I guess), but the shadows are glitchy. I've been hammering on this thing for a long, long, long time and have noticeably less hair. It's super frustrating when it kinda works...but not quite.

Does anyone happen to have a simple demo? Like a cube casting a shadow on a ground plane?

Apple's sample code "MetalDeferredLighting" is pretty complex,it's not for beginners(since you metioned "a cube casting shadow on a ground plane",I assumed you were looking for samples for beginners).

I'm learning Metal too,what I'm doing is "translating":

1.Take an OpenGL tutorial.

2.Learn the concept.

3.Do it again in Metal.

Metal is a computer graphic API(just API,not a whole new concept).Metal's way of implementing a shadowmapping is exactly the same as OpenGL's except you're using a different API.

sorry for my poor English,not a native speaker 😀

shadow mapping woes
 
 
Q