Join us on Discord!
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

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

ben_g

That looks nice. Maybe you could also have some code to 'bake' the lighting to the polygon colour data, so that you only need to compute it once. It only works with a fixed model and light source, but it could be useful when you start to actually render an environment with it.

Snektron

Quote from: TheMachine02 on June 13, 2016, 06:30:58 PM

Rough lightning and backface culling  :P  (this screen is 256 frames/turn)
Thats pretty impressive o.o
Nice job :D
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...



Dream of Omnimaga

Wow it looks really great with lightning O.O
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Lionel Debroux

Yeah, backface culling and most of all lighting add a new dimension to the rendered images.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

Snektron

  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


TheMachine02

Thanks guy  :P ... About speed, still the old same 12fps (I miss 15fps by not much though, since bfc make the triangle rendering at about 1500000TStates (or -800000 from without)). I've just made one turn 256 frames (whereas some screen run at 512frames/turn).

Quote from: ben_g on June 13, 2016, 07:37:47 PM
That looks nice. Maybe you could also have some code to 'bake' the lighting to the polygon colour data, so that you only need to compute it once. It only works with a fixed model and light source, but it could be useful when you start to actually render an environment with it.

Yeah, definitly. There will be quite of precalculation in model loading.

EDIT : fixed light look nice too


tr1p1ea

Hey nice, you also have double sided polygons working which is nice :).

TheMachine02

Quote from: tr1p1ea on June 14, 2016, 09:48:30 PM
Hey nice, you also have double sided polygons working which is nice :).

Actually, no, I just didn't put bfc  :P

tr1p1ea


ben_g

Especially when lighting is involved, it may be easier to not use double sided polygons and just model them as 2 polygons of which 1 has an inverted normal. This is often done in PC games (mostly because it's hard to define for every polygon if it's double-sided or not and rendering a few extra polygons usually has a smaller impact than rendering a full model without backface culling.

Dream of Omnimaga

Very nice lightning so far. I wonder how the animation would look like if you made the light rotate instead of the model?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

TheMachine02


As about double sided polygons, seeing the current state of the engine, it may be better to do not support them and instead go as ben_g said, put two polygons with inverted normal. Since one will be removed anyway, that put only a small overhead (the bfc is pretty much the first thing before polygon processing).

EDIT : so, I've got appv loading working, which is nice, since the whole thing is now smaller. I also corrected few bug. However, it induced a small overhead, along with the bug corrections. So, the chocobo model now miss the 12fps mark by less than 80000TStates <_<. (I don't understand some of the overhead in the rendering code, but I think it is due to the corrected bugs... ) Anyway, have a download to test  :D
Please note that keeping the appv in the archive WILL crash calc, because no unarchivate function as been implemented...  :P

Dream of Omnimaga

Darn, that lightning/shading rotation looks pretty cool. I'll give this a try on my calc soon. Glad to see a download :)


Also I finally made a sub-forum for this project :3= https://codewalr.us/index.php?board=63.0
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

TheMachine02

Quote from: DJ Omnimaga on June 15, 2016, 10:40:47 PM
Also I finally made a sub-forum for this project :3= https://codewalr.us/index.php?board=63.0

Thank you a lot  :D

To celebrate this, have a screenshot with backface culling (I duplicate bad looking poly and fliped the normal in blender) and lightning !


(256 frames/model turn)

So, since I duplicated the poly, the vertices count and poly count kinda goes up (433 vertices, 627 polygons), but backface culling removed quite a lot of useless work for the engine and so in run @12fps now (one frame standing at about ~3800000 TStates). There is futhermore perpolygon light calculation (that is, one more dot product per poly).

Have also a download with the new model + program !

EDIT : it was also my 200e post  :D

Powered by EzPortal