Topic: Fun With Raycasting |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: |
posted 02-12-2009 13:22
Greetings, my beloved asylum! Like a bad girlfriend, I can't stay away. |
Nervous Wreck (II) Inmate From: |
posted 02-12-2009 23:19
Was much easier than I expected. The code is updated and now the floor is slathered with a lovely XOR texture. The framerate is now up to 33FPS in Webkit, which is much closer to what I was expecting. I'm also considering switching this thing back to raw DHTML -- I'm not really doing anything that requires canvas, and the CSS z-indexing could be super useful whenever I get around to adding objects... |
Nervous Wreck (II) Inmate From: Portland Oregon |
posted 02-12-2009 23:26
Hey Ironwallaby, I think i played with your script when I was learning about the canvas tag. I remember it worked a whole lot faster when I switched to setTimeout instead of setinterval. I have no idea why. I ended up placing the setTimeout for the draw function in the keyhandler function. That way it only calls draw when you move and it needs to redraw. |
Nervous Wreck (II) Inmate From: |
posted 02-13-2009 04:04
Alright, one more update for the evening. I basically rewrote the whole thing to clean up a lot of the mess... |
Nervous Wreck (II) Inmate From: Portland Oregon |
posted 02-13-2009 05:00
Yeah, I had made your dhtml one work in canvas but I couldn't get the tex variable figured out and it was not drawing the textures clean enough. Your original one used images for each sliver of the blocks drawn. So i just used the canvas image to do the slicing based on your tex variable. It's pretty fast. I also did one with colored divs that get lighter as you approach. Here's a link. |
Nervous Wreck (II) Inmate From: |
posted 02-13-2009 14:08
Oh, I follow now! My mistake, that one was definitely me. |
Paranoid (IV) Inmate From: Norway |
posted 02-16-2009 02:17
iron_wallaby: 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. |
Nervous Wreck (II) Inmate From: |
posted 02-17-2009 22:03
Cool stuff, p01. |
Paranoid (IV) Inmate From: Norway |
posted 02-18-2009 12:47
I aslo believe a Canvas based hybrid ( mode7+raycasting ) approach is the way to go. It produces a much more consistent quality of final rendering and ends up with a much more stable framerate. |
Nervous Wreck (II) Inmate From: |
posted 02-18-2009 13:45
You're right, it's much improved in Opera 10. I'm still going to have to tweak for more performance, but it's a much smaller jump. (To it's credit, though, Opera has by far the prettiest rendering.) |
Nervous Wreck (II) Inmate From: |
posted 05-31-2011 11:10
Edit TP: spam removed
|