Ok, its been days and I still have no idea on how to create shadows (except a simple blob shadow, see link below). So I have to get to ground zero and start from there. I need to find out alot of info since I couldnt understand alot of the custom functions and methods in the demos and code archives relating to shadows. I figured I would ask the kind Blitzmasters a few questions and maybe post some very simple examples...
what is a stencil shadow?
If there is a thing called stencil shadows what are the not-stencil-shadows called?
Shadowing Techniques...
Lightmapping = creating an image of a scene that darkens faces that are blocked by an entity that sits between that face and a lightsource. This image has an alpha value so that a colormap can show through it. Both images are applied to a mesh to create a realistic looking terrain.
blob shadows = creating a seperate mesh, making it flat and applying a dark color to it that sits below an entity for static entities or is parented to a moving entity so that it follows it around. Quickest method of creating shadow look for a scene. May or may not be adjusted according to light sources. Is not an accurate method of representing shadows of entities. Basically its just a dark circle mesh that sits below an object. If you use uneven terrains, the lines of code required to blanket the shadow across the terrain appropriately will outnumber the lines of code to actually make your game, lol.
Blob Shadow Xample using a mesh = http://www.hilbily-works.com/Downloads1/BlobShadow.bb
Blob Shadow Xample using a textured Quad = http://www.hilbily-works.com/Downloads1/BlobShadow_wQuad.zip
Blob Shadow Xample using a Max created Quad mesh and TED Terrain = http://www.hilbily-works.com/Downloads1/BlobShadow_wMaxQuad_wTEDMeshTerrain.zip
Shadow Mapping = The process of comparing wether a pixel is visible from the light source by comparing it to a depth image of the lightsource view stored in the form of a texture.
Steps in creating and applying a shadow map
1 - Render the scene in shadow and store the image as a texture.
2 - Do a depth test to see if pixels are visible or not.
3 - Render the scene lit, areas that failed the depth test will not be re-rendered.
Shadow Volumes = A typical method of creating shadows for a scene. Involves raycasting from a lightsource to the furthest point of a scene and finding which faces are occluded by objects. Still have a way to go in understanding this.
Stencil Shadow = Ok, thanks to MarkCW's link, a stencil shadow system incorporates using a stencil buffer, (which limits the rendered area to work with) and a Zbuffer (Processes depth information), to determine per pixel coloring. According to Wikipedia, it is a three step process.
1 - Render the scene as if it were completely in shadow
2 - Using the depth information from that scene, construct a mask in the stencil buffer that has holes only where the visible surface is not in shadow.
3 - Render the scene again as if it were completely lit, using the stencil buffer to mask the shadowed areas.
There are currently 3 variations in applying this technique. DepthPass, DepthFail, and Exclusive-Or. These 3 variations use different methods on step 2 above.
Still have a way to go in understanding this.
LinePicking = Popular method of finding out if a face is behind an object and as such, should recieve the shadow of that object. Projects a line from the face to the lightsource, if there is a collision with any objects other than the the lightsource, than that face should be shadowed. Slow method since checking thousands of faces with every render is processor intensive.
Mixing Methods = Applying multiple methods of shadowing to represent the best looking scene without sacrificing processing power.
Lightmapping + Blob Shadows = Looks good until a moving entity enters the shadow area of a static object. The mixing of the blob shadow with lightmapped shadow doesn't work. You can create code to alter the coloring of the blob shadow mesh to look more like the lightmapped shadow, but this just doesnt seem to be efficient to me.
Shadow Volumes and Stencil Shadows = Using the stencil buffer (Area of ram on video card?) to accelerate the method of finding which faces are occluded according to a lightsource by raycasting or linepicking those faces.
If anyone is kind enough to help me, I will update this post to show accurate information so I can have a compilation of methods and techniques with a little understanding of how to apply them otherwise I will just go and play with my little 3d model dolls and dream.
Also, I realize that Swifts Shadow system is the most recommended one. But I am tapped out for purchasing addons, plugins, libraries, dlls and all that, So I am attempting to understand what Blitz3d can and cannot do in regards to shadows.
lol, thanks!!
what is a stencil shadow?
If there is a thing called stencil shadows what are the not-stencil-shadows called?
Shadowing Techniques...
Lightmapping = creating an image of a scene that darkens faces that are blocked by an entity that sits between that face and a lightsource. This image has an alpha value so that a colormap can show through it. Both images are applied to a mesh to create a realistic looking terrain.
blob shadows = creating a seperate mesh, making it flat and applying a dark color to it that sits below an entity for static entities or is parented to a moving entity so that it follows it around. Quickest method of creating shadow look for a scene. May or may not be adjusted according to light sources. Is not an accurate method of representing shadows of entities. Basically its just a dark circle mesh that sits below an object. If you use uneven terrains, the lines of code required to blanket the shadow across the terrain appropriately will outnumber the lines of code to actually make your game, lol.
Blob Shadow Xample using a mesh = http://www.hilbily-works.com/Downloads1/BlobShadow.bb
Blob Shadow Xample using a textured Quad = http://www.hilbily-works.com/Downloads1/BlobShadow_wQuad.zip
Blob Shadow Xample using a Max created Quad mesh and TED Terrain = http://www.hilbily-works.com/Downloads1/BlobShadow_wMaxQuad_wTEDMeshTerrain.zip
Shadow Mapping = The process of comparing wether a pixel is visible from the light source by comparing it to a depth image of the lightsource view stored in the form of a texture.
Steps in creating and applying a shadow map
1 - Render the scene in shadow and store the image as a texture.
2 - Do a depth test to see if pixels are visible or not.
3 - Render the scene lit, areas that failed the depth test will not be re-rendered.
Shadow Volumes = A typical method of creating shadows for a scene. Involves raycasting from a lightsource to the furthest point of a scene and finding which faces are occluded by objects. Still have a way to go in understanding this.
Stencil Shadow = Ok, thanks to MarkCW's link, a stencil shadow system incorporates using a stencil buffer, (which limits the rendered area to work with) and a Zbuffer (Processes depth information), to determine per pixel coloring. According to Wikipedia, it is a three step process.
1 - Render the scene as if it were completely in shadow
2 - Using the depth information from that scene, construct a mask in the stencil buffer that has holes only where the visible surface is not in shadow.
3 - Render the scene again as if it were completely lit, using the stencil buffer to mask the shadowed areas.
There are currently 3 variations in applying this technique. DepthPass, DepthFail, and Exclusive-Or. These 3 variations use different methods on step 2 above.
Still have a way to go in understanding this.
LinePicking = Popular method of finding out if a face is behind an object and as such, should recieve the shadow of that object. Projects a line from the face to the lightsource, if there is a collision with any objects other than the the lightsource, than that face should be shadowed. Slow method since checking thousands of faces with every render is processor intensive.
Mixing Methods = Applying multiple methods of shadowing to represent the best looking scene without sacrificing processing power.
Lightmapping + Blob Shadows = Looks good until a moving entity enters the shadow area of a static object. The mixing of the blob shadow with lightmapped shadow doesn't work. You can create code to alter the coloring of the blob shadow mesh to look more like the lightmapped shadow, but this just doesnt seem to be efficient to me.
Shadow Volumes and Stencil Shadows = Using the stencil buffer (Area of ram on video card?) to accelerate the method of finding which faces are occluded according to a lightsource by raycasting or linepicking those faces.
If anyone is kind enough to help me, I will update this post to show accurate information so I can have a compilation of methods and techniques with a little understanding of how to apply them otherwise I will just go and play with my little 3d model dolls and dream.
Also, I realize that Swifts Shadow system is the most recommended one. But I am tapped out for purchasing addons, plugins, libraries, dlls and all that, So I am attempting to understand what Blitz3d can and cannot do in regards to shadows.
lol, thanks!!