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
Greetings, my beloved asylum! Like a bad girlfriend, I can't stay away. :) So, I've been playing around with the Canvas tag, and ported an old raycaster I had lying around (which used DHTML to accomplish a similar effect, which I think I posted here somewhere around five or six years ago :X) to use it. For good measure, I added floorcasting which really adds to the effect, but slows everything to a crawl. (I get 14FPS in the latest WebKit nightly, 10FPS in Safari, 5FPS in the latest Firefox and Opera.) Granted, I can reduce the screen resolution (which really helps, of course), but I'd like to save that for a last resort. http://lonelypinkelephants.com/scarab/ (Click to move/turn. Interface doesn't work in Firefox, probably because event.offsetX is garbage. :)) The map you walk around is shamelessly stolen from http://www.benjoffe.com/code/demos/canvascape/. I've made all of the trivial optimizations already, but it's pretty clear that the rendering is the bottleneck, not the calculations. I was wondering if anybody here (some of whom I know already have extensive experience in raycasters ;)) knew of clever methods to optimize what I'm trying to do. My best bet so far is that I'm just trying to push too many pixels, especially considering the fact I'm using drawImage for each one. I'd like to shoot for PC + iPhone, but I think on the iPhone I'll have to settle for walls-only. Also, a cookie to whoever knows where the textures + skyline are from. ;) [b]EDIT[/b]: Looks like I might be able to generate a floor image and just blit it? http://dev.opera.com/articles/view/html-5-canvas-the-basics/#pixelbasedmanipulation Anybody know if that's cross-platform or not? [small](Edited by [url=http://www.ozoneasylum.com/user/6658]iron_wallaby[/url] on 02-12-2009 15:22)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »