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

0 Members and 1 Guest are viewing this topic.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Re: [Axe] Mode 7 test
« Reply #30 on: December 30, 2012, 05:22:10 am »
Do you have a screenie yet? I heard on irc yesterday you were able to optimise it with a LUT

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 #31 on: December 30, 2012, 05:41:32 am »
Yeah, in fact I was able to optimize it a lot. And it allowed me to implement rotations ! :D

The program of the screenshot uses 3 LUTs : one for the Y coordinates, one for the X coordinates (this means all the screen, because X coordinates depend on Y ones) and one to hold sin and cos values for the 256 angles. Oh, it also uses Full (because I don't want to make the screenshot during all the day ;D )

So, let's make our first lap of circuit using Full and 3 LUTs with a resolution of 2x2 pixels !


Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Re: [Axe] Mode 7 test
« Reply #32 on: December 30, 2012, 05:46:14 am »
Wow, awesome :)
But as you said yourself, maybe mode7 isn't something for axe, or maybe there still is some optimization left you didn't realise, because it's still quite slow xs

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 #33 on: December 30, 2012, 06:09:02 am »
Yeah, I think Mode 7 is more for ASM or another calc. Even with that, now that I have the method I can apply it for different platforms or languages.

<right now I'm trying it with Nldess, but shhhhht :P >

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: [Axe] Mode 7 test
« Reply #34 on: December 30, 2012, 06:25:36 am »
Is there a possibility of detecting a white pixel early so you can skip the calculations and move to the next? Seems to be a lot of whitespace in that track.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


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 #35 on: December 30, 2012, 07:10:35 am »
I don't think, because I need to make the calculation in order to know where to test the blank pixel ...

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Re: [Axe] Mode 7 test
« Reply #36 on: December 30, 2012, 07:16:54 am »
Wait, so you start with the projected location, and calculate back to the position in the image? Am I correct here?

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 #37 on: December 30, 2012, 08:53:47 am »
That's it plus one thing : I start with screen coordinates and a z-location (which is not part of the screen), and I use them to retrieve the coordinates of the pixel of the image to be displayed.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Re: [Axe] Mode 7 test
« Reply #38 on: December 30, 2012, 09:15:58 am »
Is that the usual way of working with mode7, or is that your interpretation? Because that sounds kinda strange to me

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 #39 on: December 30, 2012, 12:33:46 pm »
I don't know, I didn't use any tutorial for this method. My thought was that instead of going through all pixels of the image, project them on the screen and then have several dots on the same pixel or a pixel left blank, I should go through all pixels of the screen and retro-project them on the image, so in that way all the pixels will have their corresponding texture point.
« Last Edit: December 30, 2012, 12:34:03 pm by Matrefeytontias »

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Re: [Axe] Mode 7 test
« Reply #40 on: December 30, 2012, 12:45:01 pm »
Well, if you look at it that way, it makes sense too. I wouldn't really know which one is faster though

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: [Axe] Mode 7 test
« Reply #41 on: December 30, 2012, 01:10:17 pm »
I think projecting pixels from the buffer onto the screen would be faster, you don't need to project empty regions at all.
But calculating which (screen-)pixels have to be set for one (image-)pixel/texel needs some time, too.
Many clear texels -> image->screen faster
Many set texels -> screen->image faster

Also, are you doing real mode 7 (which doesn't support perspective/z at all)?

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 #42 on: December 30, 2012, 01:21:48 pm »
In fact I don't use Z perspective : I just use a pseudo one to make the lines at the top of the display area look further (I didn't found any other method). And I think your comparison is right, I'll try another technique.
« Last Edit: December 30, 2012, 01:22:09 pm by Matrefeytontias »

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 #43 on: December 30, 2012, 01:39:40 pm »
Yeah, in fact I was able to optimize it a lot. And it allowed me to implement rotations ! :D

The program of the screenshot uses 3 LUTs : one for the Y coordinates, one for the X coordinates (this means all the screen, because X coordinates depend on Y ones) and one to hold sin and cos values for the 256 angles. Oh, it also uses Full (because I don't want to make the screenshot during all the day ;D )

So, let's make our first lap of circuit using Full and 3 LUTs with a resolution of 2x2 pixels !


Wow, this is looking awesome IMO, epic work! :D

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

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: [Axe] Mode 7 test
« Reply #44 on: December 30, 2012, 01:41:40 pm »
Now include some cars and you have it: Super Mario Kart on a calculator!
It's not yet possible on ndless