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.

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



DJ Omnimaga

Wow it looks really great with lightning O.O

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

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.

DJ Omnimaga

Very nice lightning so far. I wonder how the animation would look like if you made the light rotate instead of the model?

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

DJ 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

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