This'll probably go nowhere...

Hardware, coding, music, graphic and various applications

Moderators: Mug UK, [ProToS], lp, moondog/.tSCc., Moderator Team

Post Reply
User avatar
LaceySnr
Captain Atari
Captain Atari
Posts: 172
Joined: Wed Jun 26, 2013 5:00 am
Contact:

This'll probably go nowhere...

Post by LaceySnr »

But I wanted to write a basic software 3d again, and figured it might be fun to do it on the Falcon in TC mode (albeit in C, for some modicum of portability). It's not fast or pretty, and may well never be either of those two things, but thought I might post some updates here all the same. Finally got my triangle raster quirks worked out tonight, previously I had triangles vanishing under very specific conditions. So far it can load an .obj file, render it without any kind of depth testing, crash spectacularly if a triangle goes out of the screen and that's about it :D
Icosphere.gif
You do not have the required permissions to view the files attached to this post.

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3555
Joined: Sat Jun 30, 2012 9:33 am

Re: This'll probably go nowhere...

Post by dml »

:thumbs:

Nice work! Looks pretty tidy.

Tip - if you ADD the pixels to the fraembuffer you should be able to see edge overlap errors, if there are any. Providing you backface cull and test with a convex shape anyway.

On the other hand I don't want to drive you insane chasing down tiny glitches :) you can always focus on something more fun!

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 745
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: This'll probably go nowhere...

Post by Anima »

Well, I like it. In fact it doesn't have to be fast or whatever as long as you and others have fun watching and/or programming new stuff on our ancient machines. So thumbs up!

So you can load Wavefront object files with your program?

User avatar
mrbombermillzy
Captain Atari
Captain Atari
Posts: 303
Joined: Tue Sep 13, 2016 9:24 am

Re: This'll probably go nowhere...

Post by mrbombermillzy »

Augmenting what Anima said: If everyone 'had a go' like this, then we would be a thriving Atari scene once again.

Plus you never know what techniques you may uncover and/or what might lead to what.

Carry on I say! ;)

User avatar
LaceySnr
Captain Atari
Captain Atari
Posts: 172
Joined: Wed Jun 26, 2013 5:00 am
Contact:

Re: This'll probably go nowhere...

Post by LaceySnr »

Anima wrote:
Thu Jul 02, 2020 3:00 pm
Well, I like it. In fact it doesn't have to be fast or whatever as long as you and others have fun watching and/or programming new stuff on our ancient machines. So thumbs up!

So you can load Wavefront object files with your program?
Basic ones :) It only loads the vertex and face information. I calculate face normals myself for backface culling and lighting as obj's only provide vertex normals and not sure I'll have the grunt available for smooth shading.
dml wrote:
Thu Jul 02, 2020 2:48 pm
Tip - if you ADD the pixels to the fraembuffer you should be able to see edge overlap errors, if there are any. Providing you backface cull and test with a convex shape anyway.
Yeah I've done that in the past. I think there's a tiny bit of overdraw at the moment but nothing crazy. The biggest performance killer is that until I have a full scene I'm just memset'ing the entire buffer to black before doing any drawing. Well, it's that and all the multiplications :P

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 745
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: This'll probably go nowhere...

Post by Anima »

LaceySnr wrote:
Fri Jul 03, 2020 12:10 am
Basic ones :) It only loads the vertex and face information. I calculate face normals myself for backface culling and lighting as obj's only provide vertex normals and not sure I'll have the grunt available for smooth shading.
I managed to extract the 3D objects from some arcade games and converted them to the Wavefront format. The colors are not correct, though. Those should look nice with flat shading. ;)

Air Combat
Cyber Sled
Solvalou

User avatar
LaceySnr
Captain Atari
Captain Atari
Posts: 172
Joined: Wed Jun 26, 2013 5:00 am
Contact:

Re: This'll probably go nowhere...

Post by LaceySnr »

Reckon I might need to sort out some proper z-buffering or something to make these look good, but couldn't resist taking a crack. Pretty sure I'm dropping a few tris with backface culling turned on so either I have a bug or some of the faces are wound in different directions. Will keep poking about :)
ace1.png
ace2.png
ace3.png
You do not have the required permissions to view the files attached to this post.

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 745
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: This'll probably go nowhere...

Post by Anima »

Nice! :cheers:

Well, I just remember that the models might contain quads so do you discard them while parsing?

User avatar
LaceySnr
Captain Atari
Captain Atari
Posts: 172
Joined: Wed Jun 26, 2013 5:00 am
Contact:

Re: This'll probably go nowhere...

Post by LaceySnr »

Ah, I didn't look in the file in too much detail - that may well be it. I do some pretty basic scanf parsing, might well just be discarding the fourth index. Will take a look - should be easy enough to create two triangles for a quad, will just have to make sure I get the winding correct.

User avatar
LaceySnr
Captain Atari
Captain Atari
Posts: 172
Joined: Wed Jun 26, 2013 5:00 am
Contact:

Re: This'll probably go nowhere...

Post by LaceySnr »

Anima wrote:
Fri Jul 03, 2020 1:06 pm
Well, I just remember that the models might contain quads so do you discard them while parsing?
You were correct! There weren't many in the file, but I added support for them and it's filled in a few gaps. Spent most of the last week working on a Windows tool that leverages the same loading code etc. which makes it all much easier to debug. Hopefully get some basic BSP stuff going thanks to DML's advice and have a flat shaded version soon that doesn't have all the z-fighting issues!
ace5.png
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Professionals”