Author Topic: Floorcaster  (Read 21355 times)

0 Members and 2 Guests are viewing this topic.

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Floorcaster
« Reply #15 on: July 24, 2010, 05:33:56 am »
bwang continues to bring 3D to Nspire. We could make a racing game with the engine.

What are the differences between mode7 and floorcaster (raytracer)?
Hobbing in calculator projects.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Floorcaster
« Reply #16 on: July 24, 2010, 11:34:33 am »
What are the differences between mode7 and floorcaster (raytracer)?

I was wondering about that myself.

Bwang, that sounds exciting!  Thanks for all the engines you're making!

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Floorcaster
« Reply #17 on: July 24, 2010, 02:08:20 pm »
Nice work!

Also, to make this more efficient, I would recommend drawing to a half-size screenbuffer (19200 bytes) and copying that to the bottom half of the screen. Then, you could have a parallax background in the top section.
« Last Edit: July 24, 2010, 03:12:33 pm by fb39ca4 »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #18 on: July 24, 2010, 04:04:15 pm »
I only draw half the screen right now.
What are the differences between mode7 and floorcaster (raytracer)?
Mode 7 takes a sprite, translates and rotates it, and then scales each horizontal line appropriately to give an illusion of perspective.
Floorcasting does a calculation for each pixel that determines the intersection between a ray and a plane.
They are completely different algorithms which give the same results.
« Last Edit: July 24, 2010, 04:19:10 pm by bwang »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #19 on: July 24, 2010, 06:40:08 pm »
I converted everything to fixed point, and now I can draw twice the number of pixels and still get a 25% speed gain :)
Fixed point is amazing; I think my next project will be converting Ncaster to fixed point.

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Floorcaster
« Reply #20 on: July 24, 2010, 06:56:12 pm »
Thanks for the answer. ^^

That is a really cool speed up. The ARM cpu doesn't offer better support for floats than z80 for instance? Seems a dramatic speed up, never knew the difference on speed but I have read that is used for games for "desktop computer" games (x86).
Hobbing in calculator projects.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #21 on: July 24, 2010, 07:02:04 pm »
I'm not an ASM programmer, so I'm not sure whether the Nspire has an FPU.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Floorcaster
« Reply #22 on: July 25, 2010, 07:00:26 am »
I converted everything to fixed point, and now I can draw twice the number of pixels and still get a 25% speed gain :)
Fixed point is amazing; I think my next project will be converting Ncaster to fixed point.
Very nice! I wonder how much of a speed gain Ncaster will get from this?

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Floorcaster
« Reply #23 on: July 25, 2010, 01:58:58 pm »
I only draw half the screen right now.

What I mean is, since you only draw to the bottom half of the screen, you should only copy the bottom half of the screenbuffer.

Nice work with the fixed-point version. Could you have an option to change the quality in the next version? (2x2, 2x1, and single pixels.)
« Last Edit: July 25, 2010, 03:57:16 pm by fb39ca4 »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #24 on: July 25, 2010, 04:17:08 pm »
I converted everything to fixed point, and now I can draw twice the number of pixels and still get a 25% speed gain :)
Fixed point is amazing; I think my next project will be converting Ncaster to fixed point.
Very nice! I wonder how much of a speed gain Ncaster will get from this?
Probably ~2x.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #25 on: July 25, 2010, 11:03:31 pm »
Here's a small video of it in action on hardware, since I've given up trying to get screenshots to work.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Floorcaster
« Reply #26 on: July 25, 2010, 11:29:23 pm »
Cool! Now for other textures besides a checkerboard ;D
Keep up the good work! :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Floorcaster
« Reply #27 on: July 25, 2010, 11:49:04 pm »
Excellent! You should be very pleased with the results! If only wish TI had put in a better LCD.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Floorcaster
« Reply #28 on: July 26, 2010, 12:19:44 am »
Yeah, this turned out to be a lot more usable than I thought it would be.
I should add tile mapping, so then I can write F-Zero Nspire Edition :D
Blarg, except I have several other projects I'm thinking about, and I'm busy with real life :(

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Floorcaster
« Reply #29 on: July 26, 2010, 01:32:26 am »
Wow that looks excellent!  I cant wait to see what it will look like with a tilemapper working :D Especially greyscale ^^ Although the LCD kinda is no good :/