Author Topic: [Axe] Mode 7 test  (Read 18605 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Axe] Mode 7 test
« Reply #15 on: December 27, 2012, 03:44:19 pm »
Wait it works now. I just used a pic0 with almost nothing displayed in the area where it rotated. And the framerate was a bit low. I got it to work now and here's a screenshot.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Axe] Mode 7 test
« Reply #16 on: December 27, 2012, 03:57:09 pm »
I'm trying another technique, I'll post a screenshot (maybe) and a source (surely) once done.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Axe] Mode 7 test
« Reply #17 on: December 29, 2012, 01:01:13 am »
Cool to hear. I can't wait to see how it looks like :)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Axe] Mode 7 test
« Reply #18 on: December 29, 2012, 09:29:32 am »
I can't believe it myself ... perfect Mode 7 ! O.O

With this new (and in fact, simpler) method, you have the choice between super-beautiful and awfully slow mode 7 :



Or super-fast and awfully ugly mode 7 :P :



I switch between these speeds by modifying the resolution. (sources for these 2 programs attached)
« Last Edit: December 29, 2012, 09:33:10 am by Matrefeytontias »

Offline Ranman

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1354
  • Rating: +83/-0
    • View Profile
Re: [Axe] Mode 7 test
« Reply #19 on: December 29, 2012, 09:47:31 am »
Very nice! Great job!

Are there any other potential optimizations remaining?
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: [Axe] Mode 7 test
« Reply #20 on: December 29, 2012, 10:35:00 am »
Very nice, but how come it is so incredibly slow in the 'beautiful' mode?

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [Axe] Mode 7 test
« Reply #21 on: December 29, 2012, 12:12:21 pm »
Wow, this is pretty awesome, congrats! :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Axe] Mode 7 test
« Reply #22 on: December 29, 2012, 03:21:42 pm »
Thanks everyone :)

Very nice, but how come it is so incredibly slow in the 'beautiful' mode?

It's because of the resolution : in the "beautiful" mode, I draw the scene pixel by pixel, which 96*32 calculations (see the source to have the real numbers), and in the fast mode, I draw the scene with 4*4 squares, so I do 16 times less calculations - but it's pretty ugly.

Offline Ranman

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1354
  • Rating: +83/-0
    • View Profile
Re: [Axe] Mode 7 test
« Reply #23 on: December 29, 2012, 03:58:39 pm »
I'm impressed with how small your code is.

Have you toyed with the idea of a look-up table? I know it is a lot more "code", but usually they are much faster -- and you need brute force speed here.

For example... The top line looks as if only 50% of the pixels tested are actually being drawn. So why test all of them? The table could contain the pixel offsets you might test as well as hold some intermediate precalculated values.

Very impressed!
« Last Edit: December 29, 2012, 04:03:08 pm by Ranman »
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: [Axe] Mode 7 test
« Reply #24 on: December 29, 2012, 04:03:57 pm »
That doesn't look quite like correct perspective, how are you going about doing your mode 7?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Axe] Mode 7 test
« Reply #25 on: December 29, 2012, 04:11:02 pm »
@Ranman I said I do 96*32 calculations, not 96*64. I test (and draw) only the bottom half of the screen. And I coded this around 2 am, so I'll optimise it right now :P

@Builderboy if it's not perspective, I don't know what it is. All the engine works around these formulas :

screenX = X / Z
screenY = Y / Z


Add some scaling and offsets, and you got it.

Offline Ranman

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1354
  • Rating: +83/-0
    • View Profile
Re: [Axe] Mode 7 test
« Reply #26 on: December 29, 2012, 04:25:45 pm »
@Ranman I said I do 96*32 calculations, not 96*64. I test (and draw) only the bottom half of the screen. And I coded this around 2 am, so I'll optimise it right now :P

I think you misunderstood me... The top line (@32) where you first start drawing looks to have half as many physical pixels drawn as the bottom line (@63). Or you could look at this way.... the bottom line may have half as many pixels tested as the top line (@32).

Optimizing can be a whole heckuva lot of fun! :)
« Last Edit: December 29, 2012, 04:32:23 pm by Ranman »
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Axe] Mode 7 test
« Reply #27 on: December 29, 2012, 04:30:16 pm »
Oh I see :P

It's because of my image. Try my program with a Pic0 full of pixels (like a full ground or something), there are as many pixels on the line 32 than on the line 63, it's just that the pixels of the line 32 are "further" than the ones of the line 63.

Offline Ranman

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1354
  • Rating: +83/-0
    • View Profile
Re: [Axe] Mode 7 test
« Reply #28 on: December 29, 2012, 04:35:19 pm »
It's because of my image. Try my program with a Pic0 full of pixels (like a full ground or something), there are as many pixels on the line 32 than on the line 63, it's just that the pixels of the line 32 are "further" than the ones of the line 63.

I got ya... If you put these "pics" in a 2D array (like a tile map) you'll be drawing all pixels. Maybe my idea wasn't so good after all. LOL
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Axe] Mode 7 test
« Reply #29 on: December 29, 2012, 04:43:57 pm »
Well, I looked at the source again, I can't see anything optimisable ; I can't find anything that can be precalculated and put into a LUT ; and I can't think of a simpler method. Maybe Mode 7 is not for Axe :(