The fastest ShadowSystem - underwater simulation?

Blitz3D Forums/Blitz3D Programming/The fastest ShadowSystem - underwater simulation?

FlagDKT(Posted 2006) [#1]
Which *fast* shadow system should I use for an underwater simulation?
Need blurred shadows, so I cannot use stencil.(?)
thx


Gabriel(Posted 2006) [#2]
Well you've really only got SSwift's left then, haven't you? All the others are stencils, I think. I like SSwift's system anyway, it's what I used in Bowling Babes, and I think the shadows in that look great. I'd like to see a stencil shadow system cope with casting shadows from a 4,000 poly character.


Naughty Alien(Posted 2006) [#3]
Andreymans stencil shadow system casting from 10K mesh..thats limit per object..


Dreamora(Posted 2006) [#4]
For the caster or receiver?
10000 poly is nearly the max you can cast at all within a scene. So 2 of that max and you are at bottom speed for your app.

Its not the amount but the speed and output result that counts and if stencil isn't a possibility there (thought DDS might come up with some smoother shadows if you look at thread 2 of it) then sswifts or one of the "blobby drop shadows" from code archive might be the right way. (depends on your object if a simplified fake shadow casting a la command & conquer etc is enough)


Gabriel(Posted 2006) [#5]
Andreymans stencil shadow system casting from 10K mesh..thats limit per object..

And he already said he didn't want stencils because they're hard edged.


bytecode77(Posted 2006) [#6]
for an underwater simulation, you don't need a shadow system! you mean the wave reflevtion on the ground, right? there was someting in the code archives a certain time ago... you do it as follows: you make a copy of the terrain offseted by .1 on the y axis, and texture it with the wave-reflection-texture.
btw: swfits shadow system wouldn't do that....

I'd like to see a stencil shadow system cope with casting shadows from a 4,000 poly character

my shadow system casts 10.000 polygons by 60 fps. quite fast :)


Gabriel(Posted 2006) [#7]
my shadow system casts 10.000 polygons by 60 fps. quite fast :)

That's kind of meaningless without knowing whether you're casting from a static object or an animated mesh, what else is going on in the scene and what hardware you're talking about.

If that's a 10,000 poly mesh with skeletal animation, and there's a whole complex scene and physics going on in the background, and it's running on something like Geforce FX or Radeon 9x00 series, it's not bad. Still slower than SSwift's system, I suspect, but not bad at all.

Is it?


Defoc8(Posted 2006) [#8]
oooh..harsh words gab :p ;)
-i have no doubt that swifts system is quite
fast...but i wouldnt assume his system is faster than anyone
elses..and as for the "my shadow system casts 10.000 polygons by 60 fps. quite fast :)"

lol...i bet your brain cluster that it doesnt run at 60fps on my
system ;)


Dreamora(Posted 2006) [#9]
10k poly is no information. I can have 600k polygons casting nice smooth shadow with no FPS drop at all. You know, as no information is given, I simply assume static data and let Gile[s] do the job :P
(sswift shadow system allows static shadows as well btw which gives it a very nice speed boost. Great thing for shadows that are casted by a very slowly moving sun or the like :) )


Gabriel(Posted 2006) [#10]
but i wouldnt assume his system is faster than anyone
elses

Indeed, and I'm not. I'm not even assuming it's faster than any stencil system, but I do have my doubts, because stencil shadows get disproportionately slower when you used animated meshes and high polycounts, whereas texturemap shadows don't. It's just a texture, it doesn't care. Yes, it has to render the object, but it doesn't have all those moving vertices to extrude and calculate.

And also because Devil's Child very carefully took a quote where I was referring to animated meshes and made no mention of animated meshes in his reply, which made my suspicious little brain think he was trying to hint that it included animated meshes but it probably didn't.

EDIT: In fact I've since noticed that his shadow system doesn't support animated entities at all, so he was giving a completely false impression when he quoted my remark about animated entities.


Defoc8(Posted 2006) [#11]
fair point..but your still ugly ;)


Naughty Alien(Posted 2006) [#12]
:)) LOL


FlagDKT(Posted 2006) [#13]
I need shadows for the creatures, divers and maybe plants. They are b3d animated. The light is fixed.
However I need much compatibility, and stencil buffer is not supported by all 3d cards :\
So the best system is the one of Sswift?


Gabriel(Posted 2006) [#14]
fair point..but your still ugly ;)

Quite possibly, but it didn't seem to bother your sister ;)

POINT OF NOTICE: No one should take either Def or me seriously ;) ( nor take any notice of my shocking grammar which I have since corrected :P )

So the best system is the one of Sswift?

I don't think there are any robust and compatible shadow systems that don't use stencils apart from SSwift's, so his would almost win by default. But as I said, his IS good, and not only does it already have an option to blur the shadows ( quite fast too, I used to be able to shadow four 1250 poly animated characters with blurred soft shadows on a 9700 Pro at well over 60 fps! And that's a proper game with AI, physics, a complex scene, lots of other stuff going on, not just a tech demo! ) it also has a lot of little settings you can change to tweak everything to your satisfaction. But don't take my word for it. Try his demos.


sswift(Posted 2006) [#15]
Just be aware that you have to split up your levels if you want to get the best performance out of my system. Otherwise the system has to consider thousands of polygons a frame and can't discard large batches of them quickly.

Ie, if you have an underwater scene, with light casting down, then you'd want to break your ocean floor into a grid of entities. Of course you'd want to do that anyway for speed, but you really need to do it if you're casting shadows unless your ocean floor in its entirety is like 10K polys.


FlagDKT(Posted 2006) [#16]
I'm using mushclustering+ routine found in the code archive for the whole ground that is a b3d (11k tris) non animated mesh file.
I have the second uv mapping channel coordinates used by caustics texture, therefore I don't have any available uv mapping coords channel.(0 and 1 used)
Is it a problem for sswift system?


FlagDKT(Posted 2006) [#17]
tried the demo and had a problem with 512 sized textures. What's wrong?
Ati9800Pro Winxpsp2 dx9c



OJay(Posted 2006) [#18]
your shadow resolution must always be smaller than or equal to your screen resolution!

your screenshot above looks like a screen res of 640x480 => 480 < 512 = bad.

the reason is the copyrect-command since it can only grab an image from the visible buffer...of course it would be easy to replace copyrect by e.g. toms render2texture() function, but that would require the use of an extra dll!


sswift(Posted 2006) [#19]
"I'm using mushclustering+ routine found in the code archive for the whole ground that is a b3d (11k tris) non animated mesh file."


You'll have to give me a link to this routine. What does it do?

11k tris probably isn't too bad. Probably depends on how many shadows you want to cast. Other than that I couldn't say, I don't have any way to predict how well the system will perform for any particular situation, because there's too many variables to consider, like how the polygons are laid out in the mesh, how fast your cpu and video card are, what you consider an acceptable framerate, whether you use blurred shadows, how many shadows you need, how high of res you need them to be, whether the objects casting the shadows are animated or not, and how you tweak the settings in the system to optimize things.

There's simply too many variables to say for sure.


"I have the second uv mapping channel coordinates used by caustics texture, therefore I don't have any available uv mapping coords channel.(0 and 1 used) Is it a problem for sswift system?"

My system creates new polygons, it does not modify your pre-exisitng models. So the number of texture channels you use or how you use them doesn't matter.


FlagDKT(Posted 2006) [#20]
The screenshot is taken at 1024x768 (it's photoshop resized).Yes the Blitz window is at 640x480 :)
The clustering routine is THIS
p.s. How many tris in the scene from the sswift system demo zip file?
The ground, the objs etc...


sswift(Posted 2006) [#21]
Oh, well that function sounds convenient. If it works on levels then using that would help you get more speed out of my system.

I don't remember how many polygons are in the demo level, but it doesn't really matter because the speed depends not just on how many polygons there are, but how they're distributed. That sphere in the middle I think has a ton of polygons, while the ones on the pedastals have a moderate number but I may not have set those to receive shadows at all, I forget. The Beethoven model has like 20-50K polys, I forget... but it's not receiving shadows so that doesn't make much difference. And the ground and the pedastals don't have a ton of polygons.