Shadows???

Blitz3D Forums/Blitz3D Programming/Shadows???

Yue(Posted 2011) [#1]
Hi, I want to learn to make shadows Blitz3D native commands, but use Fastext, I just want to make sure they learn important things, and because they do not speak English it all makes me a bit.

I have seen that there are two types of shadows, volumetric some calls, and other cartographic if I'm wrong, please two simple examples of these two types of shadows, I appreciate the help I can give.


vivaigiochi(Posted 2011) [#2]
english it's the base for Computer Science. I use fastlibs it's the best method to unknown about some mathematical question and see good results.
And so i say you must use it and use for fun ..
p.s. there are not native blitz commands for shadow


Yue(Posted 2011) [#3]
in the examples of such links blitz3d there, but for me it is very heavy, I think that example is volumetric shadow. And the others are cartographic I think designing a model used by a camera.





The shadow Gom, are carried out only with native command, I speak to know how I can integrate them as I am not a fan of pressing a button that automatically make me a shadow.




http://www.megaupload.com/?d=ZHD26QO3 Shadow Gom

All I want is to learn.

Last edited 2011

Last edited 2011


jfk EO-11110(Posted 2011) [#4]
I think "cartographic" is not correct. It seems you are referring to Shadow Mapping or perspective rendered shadows.

There are many diffrent variations, I'd suggest to search for this in wikipedia for an overview of the official terms and names. On pages like www.devmaster.net you will find more information.

In Blitz you can do stencil shadows (volumetric) and Shadow Mapping. Both is slow because when you use native Blitz commands, it will not make use of the hardware power. Note: the hardware can do hardware-accelerated stencil buffers, they make volumetric shadows fast. Devils Childs Shadows System makes use of it, with an external DLL (see toolbox). There is also the AShadow Lib that is using Stencil shadows as well, but other than DCs engine, it can do multiple lights, at least as far as I know. There may be more samples, using a little DirectX7 wrapper DLL, use the search tools here and at google.

There are several samples for Shadow mapping in Blitz, including: Sswifts Shadow Lib, FastExt, the sample Yasha posted in the other Shadow thread lately ("how are shadows done today"). Yashas sample may be useful to start with because it is very short and compact.

Making the shadows with the CPU, as in these 2 methods, becomes more and more obsolete because it's slow and modern graphics cards offer many features to do most of the shadows within the pixel shaders.

Programming of shadows (that are good enough for practical use) is however one of the harder things in my opinion.

Last edited 2011


Yue(Posted 2011) [#5]
@jfk EO-11110
thanks buddy, that's the problem with living in a country in the developing world without access to Internet and not knowing English, I am far from being a programmer in Blitz, for example the translator translates me like shadows cartographic Shadow Mapping: (.

Well look at the example of yasha but is obviously too heavy for me, and just wanted something simple like making a shadow of a cuckoo Shadow Mapping, simply because I want to learn, well I think it's the only way to have more control over progrmación. In the end I think I have much to learn and each day that passes is less.

A greeting.

I find Sswifts Shadow Lib?

Last edited 2011


jfk EO-11110(Posted 2011) [#6]
But when you have access to this forum then you have internet, no? Try to save Information for offline usage, on a USB stick and so.

Yashas Example also contains a cell-shading effect. It's well done, but not of interest here, so you best remove this first. The result is very short, and to make it use multiple lights and mutliple surfaces you even don't need to understand the 3D math it does to set the UVs, you need however good knowlegde of Blitz3D, making it hard when you are not very experienced with the language.

But even then: shadows cannot be much more simple (unless you want them only on a flat ground, and not on walls). In the code archives there are some samples for floor-only shadows.

I think Sswifts Shadows System can be found in his signature, eg. here
http://www.blitzbasic.com/Community/posts.php?topic=86108#975986#
Then again, if money is an issue then you maybe better try to write your own the hard way, but as a way to learn something about blitz and about shadows.


D4NM4N(Posted 2011) [#7]
To be honest b3d cannot do dynamic shadows well. (before you all boo me) it is true, DX7 is not really up to the task....

Saying that dynamic shadows can be done, but the fiddling involved and sacrifices you end up making makes it kind of anti-productive and the performance hit (other than a <10 entity shadow demo) is horrible, especially where intel gpus are concerned.

Put it this way, take minecraft (albeit an unusual 3d marvel in its own right and despite looking quite crap) or... pretty much any smartphone game taking the world by storm you do not need shadows at all.

Simple but pleasing graphics + great game wins every time...

Last edited 2011


RifRaf(Posted 2011) [#8]
Imo you are really just wasting time trying to get a shadow system ni B3D that doesnt kill your frame rate, even fastext shadows hit the fps pretty hard.

Simple but pleasing graphics + great game wins every time...

indeed
That is the reason I think Blitz3D has a long life left as long as its Binaries continue to execute on new version on windows in the future.

Last edited 2011


jfk EO-11110(Posted 2011) [#9]
You may also have to see it from an other point of view. Many people wouldn't even consider testing a game engine if it doesn't offer shadows, and a list of other things. Doing good shadows in DX7 is not impossible. While we cannot add shaders, we may at least do whatever we can for shadows and physics.

There is a number of DX7 games that are using perspective Shadow mapping (maybe some of them are DX8, but they still use software perspective mapping), to name just a few: Hitman 2, Deus Ex 2, NOLF 2 and so on. It isn't so much DX7 that makes perspective mapped shadows slow, but the way they are implemented. As long as there ain't 100 skinned, animated NPCs onscreen (they would kill the rate anyway), it is possible to use these shadows in Blitz3D, maybe it's even mandatory if you want more people to test it. Simply add some settings. Shadow detail: blob, low, mid. hi.

We are not talking about 3D Snake or Pacman here, but about some fullfledged FPS or TPS games, although DX7ish, noless with a realistic approach. I don't know about you, but I don't use BLitz3D for smartphone games, at least not as long as they haven't got the 3d hardware that is normally used with Blitz3D.

As long as it doesn't take you years, that's no waste of time IMHO. A system like fastext can be added with relative ease. It maybe needs some tweaking (eg. to stop casting shadows behind the light, or between light and caster), other than that is's running out of the box, especially for outdoor scenarios. Not sure how open for modding FastExt actually is (is the shadow sys part of the Blitz code, or is it in the DLL?). Sswifts System is open, and so are a few others.

EDIT: as an instant solution we maybe should stop asking people for "DirectX7 Support", but tell them instead it needs DirectX9c. Then when they see some shadows on the floor they may think it's something really new. :)

Last edited 2011