From 573f32150827f1c5649ff9a3e59ad73be0655bb1 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 2 Aug 2009 08:18:13 +0000 Subject: [PATCH] rasterize: another fix for shadows. fixes most, if not all, of the recently broken shadows. --- desmume/src/rasterize.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index c2ac61988..6928825b7 100644 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -198,6 +198,13 @@ struct PolyAttr bool isVisible(bool backfacing) { + //this was added after adding multi-bit stencil buffer + //it seems that we also need to prevent drawing back faces of shadow polys for rendering + u32 mode = (val>>4)&0x3; + if(mode==3 && polyid !=0) return !backfacing; + //another reasonable possibility is that we should be forcing back faces to draw (mariokart doesnt use them) + //and then only using a single bit buffer (but a cursory test of this doesnt actually work) + switch((val>>6)&3) { case 0: return false; case 1: return backfacing;