* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: gLib a fast 3D asm/axiom library  (Read 41761 times)

0 Members and 3 Guests are viewing this topic.

Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 335
  • Post Rating Ratio: +14/-0
    • View Profile
gLib a fast 3D asm/axiom library
« on: January 19, 2015, 05:10:01 pm »
[cross posted from various site]

As some of you already know, I passed the last few month to convert GLib to an axiom, and if you doesn't know/or guess it, well SURPRISE !  :
I am proud to finally present this works, and hope we will be able to see some 3D project appears. Of course keep in mind
that this is a calculator engine, even if performances are definitly WAY more superior to axe version (thanks to asm/code refactoring).

In cliping, for example, I've got almost a 50%, even 55% performances boost....

For the new features/ changes from the axe version :
-library now use matrix, way more powerful than the previous method that I used, and for now faster
-VBO has been limited to 8 and for now can't be supressed (but don't worry you will soon be able to do that, and I'll post in tuto a way to do it from axe point of view)
-Many many many optimization, size wise and speed wise. Standard cube (example provided) run at more than 40 fps ....

Anyway, the little test screen :



note that the white a the begining is definitly a gif bug >_>

And of course, the download is attached. (I hope I don't forget anything in it !) Wait a little for a tuto update, and you will be able to play with it at is full potential  ;)
Concerning the source, I am pretty sure that Asm guru will find a lot, lot of optimization, feel free to take a look  ;D
Also, there is most likely going to have update, for example new optimization, bug fixes, but the syntax won't hopefully change (except if a small change can boost performance like hell  :P)

EDIT : there will be a change in syntax, cause this change does indeed increase performance like hell  :P


Almost finished tuto: https://codewalr.us/index.php?topic=692.msg21406#msg21406

gLib is making is way to color calculator and ez80 !! Screenies in the thread.



The download is obsolete, there is a new version (4.0.0) in the tuto thread  ;)
« Last Edit: September 21, 2016, 10:28:24 am by TheMachine02 »



Offline pimathbrainiac

  • Full User
  • Original 5
  • Join Date: Nov 2014
  • Location:
  • Posts: 420
  • Post Rating Ratio: +2/-1
  • Formerly Banned CW Co-Founder Turned News Editor
    • pimathbrainiac
    • View Profile
  • Gender: Other
Re: -gLib a (relatively) fast 3D library
« Reply #1 on: January 19, 2015, 05:14:31 pm »
YAY! Now for that portal game... *runs*

I can't wait for the tutorial. This will be really useful!
Well, I'm bach here too!

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3155
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: -gLib a (relatively) fast 3D library
« Reply #2 on: January 19, 2015, 05:49:29 pm »
I've actually been working on some 3d projection myself :)
ASM only though, and so far it has only some basic MultiplyMM and
MultiplyMV, but it is quite optimized (and big, MultiplyMM is 400 row, excl macros).
Anyway, im interested in how you do your calculations? Floating points or
just signed ints? Im using zeda's 24-bit float lib :)
And great work! :D
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 335
  • Post Rating Ratio: +14/-0
    • View Profile
Re: -gLib a (relatively) fast 3D library
« Reply #3 on: January 19, 2015, 06:16:11 pm »
definitly signed int, as 24 bits float will definitly leed to pretty much sslllooow thing. As we don't have many cycles for calculation, it could only be viable with int. (Altough that maybe half float could be use - 16 bit float, with 8bit mantissa, 7bit exponnent, 1bit sign, allowing doing only a 8x8 multiplication for multiplying two numbers)
My projection code is pretty much slow, since I use division. (altough that I made a fast math one, but limited in range) You can look at the code if you want  ;)

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3155
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: -gLib a (relatively) fast 3D library
« Reply #4 on: January 19, 2015, 06:21:35 pm »
Ah, i was thinking about 16 bit signed int when i started, but i felt that wouldnt be precise enough :/
And i will defenitely look at your src :)
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 335
  • Post Rating Ratio: +14/-0
    • View Profile
Re: -gLib a (relatively) fast 3D library
« Reply #5 on: January 19, 2015, 06:24:13 pm »
Well, projection IS on 16 bit signed, and is relatively precise ....  :). It actually well enough for a 96x64 screen.

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3155
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: -gLib a (relatively) fast 3D library
« Reply #6 on: January 19, 2015, 06:32:16 pm »
And MVP calculation? i haven't really timed, but i'll see if i can record some gif :P
EDIT:
this is 3 multiplies every frame, running at 15 Mhz mode (its not the fastest, but what do you expect
with floats on a z80 :P). Also it's 'only' 6K since i unrolled ALL multiplications in the mm and mv :P
« Last Edit: January 19, 2015, 06:48:08 pm by Cumred_Snektron »
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18187
  • Post Rating Ratio: +91/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: -gLib a (relatively) fast 3D library
« Reply #7 on: January 20, 2015, 09:01:27 am »
I'm glad that this is alive again and now an axiom. :D Hopefully it's easier to use for Axe coders now :D
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 335
  • Post Rating Ratio: +14/-0
    • View Profile
Re: -gLib a (relatively) fast 3D library
« Reply #8 on: January 20, 2015, 10:16:16 am »
Matrix calculation is also made with integer, 7bit integer to be more precise. [-64,64] and precision is ok, as well as speed :



stress test with 256 points, 6fps at 6MHz (so for matrix rotation : 2304 fastmul per frame, and 256 div, 512 mul)
this test is without using fast math  :)

Offline Keoni29

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 284
  • Post Rating Ratio: +8/-0
    • View Profile
    • 8times8
  • Gender: Male
Re: -gLib a (relatively) fast 3D library
« Reply #9 on: January 20, 2015, 10:22:26 am »
Which software do you use to record these? The gif error is really strange. Looks quite impressive though :)
If you like my work, why not give me an internet?

Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 335
  • Post Rating Ratio: +14/-0
    • View Profile
Re: -gLib a (relatively) fast 3D library
« Reply #10 on: January 20, 2015, 10:24:58 am »
I am using wabbitemu, and I don't know what is causing this error. I've never had it before  :(

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3155
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: -gLib a (relatively) fast 3D library
« Reply #11 on: January 20, 2015, 02:10:47 pm »
My GIF is wabbit too yet idont have any problems
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 335
  • Post Rating Ratio: +14/-0
    • View Profile
Re: -gLib a (relatively) fast 3D library
« Reply #12 on: January 20, 2015, 02:14:17 pm »
bah it isn't too bad, and I think I can ircummvent this bug by launching program at the start of the screen.

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18187
  • Post Rating Ratio: +91/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: -gLib a (relatively) fast 3D library
« Reply #13 on: January 21, 2015, 05:01:44 am »
Matrix calculation is also made with integer, 7bit integer to be more precise. [-64,64] and precision is ok, as well as speed :



stress test with 256 points, 6fps at 6MHz (so for matrix rotation : 2304 fastmul per frame, and 256 div, 512 mul)
this test is without using fast math  :)
This almost lools like this could be used for terrain generation because of the low resolution :)
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Streetwalrus

  • Professional slacker
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Israel
  • Posts: 2854
  • Post Rating Ratio: +20/-0
  • ƎW∀⅁ ƎH⊥
    • View Profile
  • Gender: Male
Re: -gLib a (relatively) fast 3D library
« Reply #14 on: January 21, 2015, 02:40:16 pm »
Whoa this looks really epic. I didnt know you were making it an Axiom. Great job. :D
  • Calculators owned: TI-80, HP 40G, TI-84 Plus rev G (yay 128k RAM), TI-83 Plus Silver Edition (broken LCD), TI-82 Stats.fr (black), TI-Nspire CX rev C (yay Nlaunchy), TI-83+ SE ViewScreen



 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games