January 25, 2020, 06:44:44 am

News:

You can help CodeWalrus stay online by donating here.

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

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

0 Members and 1 Guest are viewing this topic.

DJ Omnimaga

June 03, 2016, 05:35:24 am #225
Yeah I was curious about that. I know that solidFRAME has sorting but his models seems to have more details so I was curious about if the slowdown would be severe.

TheMachine02

June 03, 2016, 09:33:51 am #226 Last Edit: June 03, 2016, 09:35:46 am by TheMachine02
I actually run my engine at 320x240 resolution ... I am not sure if solidFrame run at this resolution or not actually. That is why they look more detailed. (Or solidframe just draw triangle with 2x2 pixel size, dunno). tr1p1ea if if you can enlight us on this point you are welcome

Also, about z-sorting, well doing it right is kinda hard, especially with a library implementation. Two though : spatial coherency might be used (that is, from a frame to an other frame, not much change in the sorted list, so insertion sort might be great here). And the second one is it *might* be a good idea to get backface culling running before trying to sorting polygons ... data structure need to be quite robust also. So, many problem, many solution, but not enough time (for now) to implement them

Quote from: DJ Omnimaga on June 02, 2016, 09:55:51 pm
The Prime uses some sort of list of coordinates IIRC. 1 rectangle for example is something like ((0,0),(0,10),(10,10),(10,0)) or maybe it was with brackets.

Also that last model is running at quite good speeds considering how complex it is for calculators. Is that Lara Croft?

It is indeed a lara croft model from the legend game (kinda scale down). Seeing the format, I guess that could be done. Just some C and you are good.

DJ Omnimaga

June 03, 2016, 04:18:00 pm #227
I think solidFRAME still runs at 160*120, scaled up or in 8bpp mode, for compatibility with the CSE version, but I could be wrong.

TheMachine02

June 03, 2016, 05:53:24 pm #228 Last Edit: June 03, 2016, 06:12:31 pm by TheMachine02
Quote from: DJ Omnimaga on June 03, 2016, 04:18:00 pm
I think solidFRAME still runs at 160*120, scaled up or in 8bpp mode, for compatibility with the CSE version, but I could be wrong.

That could be, indeed.

Sooooo have a badly optimized crappy z-sorting algorithm (and I am serious here  )

(512 frames for one turn)
Z-sorting :                                                                                               without :

(512 frames for one turn)

(256 frames for one turn, only 3000 poly cause I reached the 65536 bytes limit  )

So there is no backface culling, and algo is pretty crappy, but I guess that spacial coherency payed : there is an inital overhead (more or less big, lara model get a biiiig overhead), but once this is passed, the thing that take time is actually calculating the Z key for all the polygon. Look good though.

DJ Omnimaga

June 03, 2016, 06:35:21 pm #229
The first ones are quite impressive, speed-wise . The Lara Croft one got pretty slow, though (but it's pretty intensive in polygons so that's expected)

TheMachine02

June 03, 2016, 07:08:29 pm #230
Yeah that is because there is more overhead trying to process the triangle than actually drawing it

But, yeah, other got nearly 0 overhead, because the list doesn't change much between frame.

DJ Omnimaga

June 03, 2016, 09:07:06 pm #231
So I will ask again like I did on Omni: Would this engine be useable for very simple maps? (eg plain-colored walls with no texture and hardly any details) It would definitively be cool to see some sort of simple game using this engine for both very simple models and simple maps) (the character could just be made of cubic shapes like in Minecraft)

tr1p1ea

June 04, 2016, 03:47:20 am #232
Yes solidFRAME draws half-res ... the models look good at 320x240, nice work!

DJ Omnimaga

June 04, 2016, 04:45:53 am #233
Would drawing at lower resolution with doubled pixels improve the speed, by the way?

TheMachine02

June 04, 2016, 11:00:39 am #234 Last Edit: June 04, 2016, 02:07:00 pm by TheMachine02
Quote from: DJ Omnimaga on June 04, 2016, 04:45:53 am
Would drawing at lower resolution with doubled pixels improve the speed, by the way?

Well less drawing would mean more performance ... but then on small triangle you aren't limited by drawing, but by overhead (which is quite huge right now). So, I don't know. Maybe, I'll said.

Quote from: DJ Omnimaga on June 03, 2016, 09:07:06 pm
Would this engine be useable for very simple maps?

In the current state, no. There is no cliping going around, and thing are pretty much messy.    However, once it will be more clean, I'll guess something like X3D would be doable.

EDIT : btw tr1p1ea, what Z index are you using for sorting ? right now, I use average of 3 vertices z coordinate after the transform, but it raise some issue with a simple cube :

EDIT2 : beware of the crime hour ....

DJ Omnimaga

June 04, 2016, 03:52:47 pm #235
Haha I remember that little guy from Final Fantasy VII in battles (assuming it's him?). Looks quite nice.

For maps, maybe @catastropher could help if he's still around?

TheMachine02

June 04, 2016, 04:10:51 pm #236
Well he appears in many FF actually ...

Well I guess designing a simple map isn't *so* hard, I'll take a try one day...

DJ Omnimaga

June 04, 2016, 04:15:51 pm #237
Yeah I know, but FFVII semeed to be the only one I remembered exactly him from. IIRC he was in older ones too but I forgot which, plus I don't think he always did his death attacks the same way in older ones.

TheMachine02

June 04, 2016, 04:19:27 pm #238
Yeah, many monsters changed attack between ff. I do think he appears in V,VI,VII, VIII, IX, X,XIII.

DJ Omnimaga

June 04, 2016, 04:21:22 pm #239
True, but I think starting in FFVII he always did the same attack for the next games, right? (slowly move towards party then instakill everyone)