The shoutbox is currently out of service. Join us on Discord instead.

[gLib][3d][z80][ez80] gLib a fast 3D asm/axiom library

Started by TheMachine02, January 19, 2015, 05:10:01 pm

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

TheMachine02

January 19, 2015, 05:10:01 pm Last Edit: September 21, 2016, 10:28:24 am by TheMachine02
[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  ;)

pimathbrainiac

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!

Snektron

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
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


TheMachine02

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  ;)

Snektron

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 :)
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


TheMachine02

Well, projection IS on 16 bit signed, and is relatively precise ....  :). It actually well enough for a 96x64 screen.

Snektron

January 19, 2015, 06:32:16 pm #6 Last Edit: January 19, 2015, 06:48:08 pm by Cumred_Snektron
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
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DJ Omnimaga

I'm glad that this is alive again and now an axiom. :D Hopefully it's easier to use for Axe coders now :D

TheMachine02

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  :)

Keoni29

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?

TheMachine02

I am using wabbitemu, and I don't know what is causing this error. I've never had it before  :(

Snektron

My GIF is wabbit too yet idont have any problems
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


TheMachine02

bah it isn't too bad, and I think I can ircummvent this bug by launching program at the start of the screen.

DJ Omnimaga

Quote from: TheMachine02 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  :)
This almost lools like this could be used for terrain generation because of the low resolution :)

Streetwalrus

Whoa this looks really epic. I didnt know you were making it an Axiom. Great job. :D

Powered by EzPortal