Login
Back to forumReply to this topicGo to last reply

Posted By

George
on 2021-01-19
20:58:54
 Two renders with 3D Engine 2.5 on real machines (C64 and Plus/4)

I tried the 3D Engine 2.5 on my C64 (with 3.5 Basic Extension) and my plus/4. Here the results i want to share:

Suzanne from Blender.
Code runs on a C64 without any modification. 3.5 Basic Extension is needed.


Afrodite of Milos
3 hour render of an 2782 vertices model on a commodore plus/4. 64k Memory was at the limit. Happy it went well!


Posted By

seff
on 2021-01-20
07:52:28
 Re: Two renders with 3D Engine 2.5 on real machines (C64 and Plus/4)

@George, what is Basic 3.5 extension on C64? Does it port all Commodore Basic v3.5 commands back to C64?

Posted By

George
on 2021-01-20
08:52:36
 Re: Two renders with 3D Engine 2.5 on real machines (C64 and Plus/4)

@seff:
Its this program: 64'er BASIC 3.5 for Commodore 64

Code also runs on Basic 7.0 for the C128.
A Vic20 Version also exists

Posted By

MMS
on 2021-01-20
18:23:37
 Re: Two renders with 3D Engine 2.5 on real machines (C64 and Plus/4)

Nics pics!

I can say that extension is an artifical intelligence for the C64 grin
BTW, what about the speed? C64 is measured to be faster with V2.0 BASIC than Plus/4, is it valid with this extension too?

Posted By

George
on 2021-01-20
22:00:51
 Re: Two renders with 3D Engine 2.5 on real machines (C64 and Plus/4)

I dit not measure it, but it felt slower then the plus/4. But i could be wrong

Posted By

Mad
on 2021-01-21
11:25:59
 Re: Two renders with 3D Engine 2.5 on real machines (C64 and Plus/4)

Wow nice!! I was always asking me how you did the hidden surface removal. Do you paint filled polygons behind the wireframes? Or do you have a dedicated algorithm for that? Anyways nice job with Basic3.5 on the C64! grin (C64 has much less Basic memory then, or?)

Posted By

George
on 2021-01-21
14:04:07
 Re: Two renders with 3D Engine 2.5 on real machines (C64 and Plus/4)

Thanks Mad for the nice words. Always encouraging and motivating to here a nice response. I am a great fan of your miracles you do on the plus/4.

The algorithm is called "Painters Algorithm", a classic method to do 3d graphics. It goes like this:
* calculate the normal (orthogonal Vector of a surface) of every face
* if the z-coord of the normal has a certain value (i think >0) then its visible
* sort all visible faces by the z-coodinate of the midpoint of the face
* paint every face as "filled" polygon from behind to the front

I did a video tutorial about how its done : Tutorial 3D-Engine 2.5: How to render Blender "Suzanne" on the Commodore Plus/4


The hard part was (because i never done 3d graphics before)
* to get it all together in Basic 3.5 with its limitations (i coded only with an editor Notepad++)
* to find a method to transfer the obj-files from Blender to my Basic program (find a suitable format OBJ, PLY, ...)
* to find a way to store the modeldata with the lowest memory consumption possible (still researching for optimations, our community helped a lot with tips and hints)
* to find a method in Blender to shrink the Models into a size, the the plus/4 with its 64k can handle (here no experience at all inthe beginning). Limitation is about ~2800 verts depending on model an render angles. But there a many low poly models free available.

My goals from the beginning were:
* Easy portability to all 8-bit computers which are equipped BASIC
* render as big models as possible (speed not so important)
* have fun with the process: Using Blender -> export to the plus/4 ->find your desired angles -> enjoy the render

The 3.5 Basic Extension does not reduce the standard free Basic of the C64. It leaves about 36 k free, makes our Plus/4 with the 60k first choice for rendering in BASIC.

So if you all have general ideas for futher optimizations/features, i am always willing to hear.

Posted By

seff
on 2021-01-23
02:39:18
 Re: Two renders with 3D Engine 2.5 on real machines (C64 and Plus/4)

@George this is a great example of code portability, something that could (and should) have been achieved in the 1980s by CBM.



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024