By tesselating the quads that represent the walls, we can project shadows from the light onto the various surfaces by using an OpenGL shadow matrix. By only drawing the "floor" quad into the stencil buffer, we can clip the shadow so as to make the ground appear to float. By jittering the position of the light and accumulating shadows in the stencil buffer, we can create soft shadows, but at the cost of a painfully-slow framerate.
which sampling algo?
aksufatos 4 months ago
@meming4 - You should look up shadow mapping, it's a well-known shadowing method that is similar to what you described. It does look somewhat pixelly if you don't apply any filters, but it's not too bad.
cyborgtroy 1 year ago
Hello Its me again, I was wondering what matrix you used to project the primitives onto the walls, thnx
meming4 1 year ago
Im trying to make shadows in my 3d game, and I dont care at all how much quality the shadow has, so my idea is to put an invisible square made up of lots of little squares in front of the light, then "project" the squares outward, when one of the squares hits its first surface, it saves the distance from the light, note that the farther away the more space the square will take up. (any Idea on how I could do this?) then, I compare a pixel with part of the map (how do i determine what part?) ty
meming4 1 year ago