flex shadows

Blitz3D Forums/Blitz3D Programming/flex shadows

Ruz(Posted 2003) [#1]
I managed to get the flex shadow system implemented on my demo. It has slowed down my fps by about 5 or 6 fps . is
thats about normal.
Apart from that that it works fine.


Caff(Posted 2003) [#2]
Well let's see it then...


Ruz(Posted 2003) [#3]
see it caff? not much to see just now. just a default oval texture as the shadow, but it does hug the terrain like its supposed to.
I just wondered if the slow down was normal or not.

Also I was wondering over the legality of putting a copyrighted character in my demo( stitch from lilo and stitch). it is just a demo to send to employers , not for public sale.


Rob(Posted 2003) [#4]
The flex demo is probably slow because

- the flex is being called too often
- the flex mesh is too detailed (choose lower segs)
- the linepicks are too long (it drops too far)

you should be able to get very little performance hit if it's tweaked right


Ruz(Posted 2003) [#5]
Ok Rob ,cheers. Thats improved it by about 2 or 3 fps at least. Getting about 35 fps average now at 1024x768


Litobyte(Posted 2003) [#6]
Tip: try to set only the elements you need to check with pick, pickable. Then after the check you turn them unpickable.

This should significatively increase your framerate.

Dragan's Quest checks (linepick) geometries up to 5000 triangles all pickable for the instant of the check, then put them unpickable.

Another good tip is to SKIP too detailed model, and use a bounding box instead of them.

Sorry 'bout my half english. I hope you understood.


Ruz(Posted 2003) [#7]
Thanks for the tips Zurk173 and hey your english is fine.

I don't think there is much of an issue with the linepicking though as my framerate is now not too far away from what it was before I introduced the flex shadow.


Litobyte(Posted 2003) [#8]
With a 1000 triangles level maybe,
but try it on a 3000 or more level :P

You have to sort in a smart way, the object you want the shadow aligned, not all the "pieces" of your b3d or whatever mesh will be pickable.

If you load the level with a loadmesh command (no hierarcy to loop through) then you will have simply to write something like:

entitypickmode levelmesh,2 (poly)
;all the pick checks you need
...
entitypickmode levelmesh,0
updateworld
renderworld

this trick should make it faster, try it with a medium size geometry level and tell ;)


Ruz(Posted 2003) [#9]
actually the level mesh is nearer 9,000 polys, but I will try you suggestons anyway.
But since the leve mesh is one big mesh, won't the pick need to be left on constantly.
i actually tried seperating the mesh in to smaller pieces, but there was no noticeable increase in frame rate