* 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 58024 times)

0 Members and 1 Guest are viewing this topic.

Offline tr1p1ea

  • Full User
  • Join Date: Feb 2015
  • Location:
  • Posts: 258
  • Post Rating Ratio: +4/-1
Re: gLib a fast 3D asm/axiom library
« Reply #480 on: September 13, 2017, 11:56:46 pm »
A SM64 level test would be great - but there could be an issue with N64 levels/models due to the size of polygon size and the lack of perspective correct texture mapping is all. You can see how affine texture mapping causes distortion when close to the camera and at angles and such. The PS1 got around this by not using large textured polygons - instead breaking them up into smaller ones to combat this. That being said, a game of that level of visual complexity is not really a realistic target if you want a playable framerate. BUT through some clever level optimization and thinking ... maybe it could be possible to an extent?!!!

If anyone can do it, it's TM02 :).
« Last Edit: September 14, 2017, 12:03:24 am by tr1p1ea »

Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 351
  • Post Rating Ratio: +14/-0
Re: gLib a fast 3D asm/axiom library
« Reply #481 on: September 14, 2017, 09:31:24 am »
A second issue may arise, that is the N64 use a lot of repeating texture. And my engine doesn't support texture repeating at boundary. The fix is quite simple ; and fall in the same categorie of the issue discuted by tr1p1ea, break large polygons into smaller one. For the visual complexity of the game, well I must said that the previous screenshot doesn't include ANY way of doing thing proprely, it just send all polygons through the library (and vertex as well), which is, well, a bad way to do thing :P One of the primary optimization one can do in such context is bounding boxes, test a whole sub level part against frustrum with 8 vertices et skip it enterily if it is outside. Given that the library can handle different stream of polygons/vertex from different location and doesn't expect only one consecutive stream, this is a very interesting thing to do. Second optimization that may be doable is to reduce the far plan visibility, ie how far can you see polygons. PS1 used this technique very often, using some fog. We won't be able to do fog here, but it is still a good thin to have given that depth is computed for sorting anyway. Third reside in library optimization itself, which aren't at all done :P
As a side note, I need to also said that the current pipeline must process all vertex (this is mandatory due to clippping). So removing some vertex through the bounding boxes is even a better idea than before (2000 vertex process in the last screenshot IS heavy, at about 90ms).

Just to give you an idea, through code refactoring color glib is almost 400% faster than early version - and it is mostly through new algorithm / better pathway, not much from code micro-optimisation, apart from the texture mapping routine, in which I've already put a lot of work. So given the opportunity, (and mostly because two of the three optimization ins't glib work, but instead more of the user work, and I don't use my library well  :P ), the complexity may be pretty high. I also may start to do a more advanced use of the library for following demo because well I want more speed obviously.

To finish, well if one have the level, I can simply convert it and load it up in the engine  :)

EDIT : huh, I forgot to include last eye-candy, shame of me  :P



EDIT 2 : well I said that bounding should be user made, that is not totally true, as I could also make it mandatory, but I fear I may lose in flexibility. What do you think ?
« Last Edit: September 14, 2017, 11:55:13 am by TheMachine02 »

Offline tr1p1ea

  • Full User
  • Join Date: Feb 2015
  • Location:
  • Posts: 258
  • Post Rating Ratio: +4/-1
Re: gLib a fast 3D asm/axiom library
« Reply #482 on: September 14, 2017, 09:40:04 pm »
Well the engine is already amazingly fast, I feel that making 3D models and levels SPECIFICALLY with the calc in mind could yield good results.

DAT EYE CANDY!!!! :).

Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 351
  • Post Rating Ratio: +14/-0
Re: gLib a fast 3D asm/axiom library
« Reply #483 on: September 15, 2017, 09:36:48 am »
Sure thing. Those level are end of life PSX quality grade, so don't wonder why there a bit heavy for the calc  :P Even considering the fact I have no (or limited vs PS1) lightning, the simple fact that it run *only* 8x slower (30fps vs 4-3fps) make me happy  :D (since the ez80 definitly doesn't have PSX hardware  :P )

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18730
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: gLib a fast 3D asm/axiom library
« Reply #484 on: September 16, 2017, 12:49:07 pm »
Did the PS1 have a graphics card? I forgot, but this can play a big role in graphical performances
  • Calculators owned: TI-57, 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: 351
  • Post Rating Ratio: +14/-0
Re: gLib a fast 3D asm/axiom library
« Reply #485 on: September 16, 2017, 12:52:51 pm »
It has a dedicated GPU with 1Mb of VRAM indeed, which was quite efficient (well, for the time). It only supported linear mapping though. So yeah, pretty good  :P

Offline _iPhoenix_

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 444
  • Post Rating Ratio: +9/-1
  • █████ ▼ ♪ Best music ♫
    • @dj_iPhoenix
    • @UCytgMNPxAMDsxjimvxHf01w
    • @the-legend-of-iphoenix
  • Gender: Male
Re: gLib a fast 3D asm/axiom library
« Reply #486 on: September 16, 2017, 04:02:06 pm »
I have a render request.

You should come up with a gLib logo, with a lot of poly, and use it as a benchmark.

I also want to see a render of a CE rendering a CE.
  • Calculators owned: A sentient TI-84+ CE, TI-85
  • Consoles, mobile devices and vintage computers owned: TI-99/4a home computer
Help me with a project by voting here! Thanks!

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18730
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: gLib a fast 3D asm/axiom library
« Reply #487 on: September 18, 2017, 03:19:08 pm »
It has a dedicated GPU with 1Mb of VRAM indeed, which was quite efficient (well, for the time). It only supported linear mapping though. So yeah, pretty good  :P
That's impressive. I assume it also supported minimal shading?
  • Calculators owned: TI-57, 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: 351
  • Post Rating Ratio: +14/-0
Re: gLib a fast 3D asm/axiom library
« Reply #488 on: September 22, 2017, 08:59:51 pm »
It did supported some advanced stuff for the time, mainly gouraud shading along side with texture. Filtering was pretty minimal though, vs the N64 for example, but it has plenty of RAM.

Anyway, I started to implement bounding box, as they are finally quite easy to make them working in the pipeline, and hopefully should improve performance quite a bit  :P

Offline p2

  • CodeWalrus Staff
  • Super User
  • Moderator
  • CodeWalrus Supporter
  • *
  • Join Date: Aug 2016
  • Location: Germany
  • Posts: 2283
  • Post Rating Ratio: +8/-0
  • *Wubba lubba dub dub*
    • KaliPhobos
  • Gender: Male
Re: gLib a fast 3D asm/axiom library
« Reply #489 on: September 22, 2017, 09:10:20 pm »
sooo full support for my 4k VR Pr0n estimated by the end of next week?  ;)

seriously man, what you're doing there is magic  :thumbsup:
Also it'd be great to see a comparison of speed, like re-rendering one of the old demos with the current state of ur program so we can see the actual difference ^^
Guess then it'd probably be even more impressive than the more and more complex models (that are impressive enough already) ;D
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Offline TheMachine02

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 351
  • Post Rating Ratio: +14/-0
Re: gLib a fast 3D asm/axiom library
« Reply #490 on: September 22, 2017, 09:47:29 pm »
Yeah I really should indeed. There wont be much improvement to flat filling though - havent touch the routine in ages - but texturing is an order of magnitude faster now.
I need to grab an old demo with some timing though to measure exactly the improvement. Maybe midna with the skybox ? (I need to see if I can fit texture in now caise the slybox I used was pretty huge, and I hard limited texture to 256x256)

 


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