OZONE Asylum
Forums
DHTML/Javascript
Fun With Raycasting
This page's ID:
30838
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
[b]iron_wallaby:[/b] On my 2Ghz notebook, your script runs at ~30fps in Opera 9.63, ~40fps in Opera 10a, ~50fps in FF3.1b and ~75fps in SF4dp2. Alas FF lags a bit at updating the BMP image though. To optimize things a little, you could precompute the BMP header, get rid of the muls by 256 and [i]Math.floor[/i] in the floocasting, and remove the multiple calls to [i]pack()[/i] in favor of a single call when setting the [i]FLOOR.src[/i]. Also, setting the whole [i]style[/i] property instead of multiple sub properties might be faster. Nice work. Oh, btw, I've done raycasting with objects using Canvas, and the depth sorting is trivial. The overhead is negligeable . Moreover IMO it's largely made up for by the equal quality of rendering of all the elements of the game ( walls, sprites, floor & ceiling if any, HUD and other overlays ) : no sharp elements on top of blurred ones or the other way around. And Canvas also makes the management of multiple textures a million times cleaner than the DHTML approach. HTH [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love_small.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_charly.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_dk.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_reason.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_galaxy.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_neon88x31.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_teapot.png[/img][/sigrotate][/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »