Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Software 3D Render Engine WIP

Author
Message
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 22nd Jul 2007 01:53 Edited at: 12th Aug 2010 00:31
PlayBasic Software 3D Render Engine WIP V0.22 Update

While picking through a list of old demos during a recent updating frenzy, this seemed like one of the most logic demos to rebuild in PlayBASIC 1.63h. Since this type of demo puts great deal of strain on the PlayBASIC runtime. Each frame it has a mountain of rotation/projection/clipping calculations to get through, not to mention drawing the scene at the end of it. The while rendering uses built in features like Tri / GouraudTri combined with the scene buffer for depth sorting, everything else is just good old fashion PB code.

The original port of this demo was to PlayBasic V1.05/V1.06 (two years ago), the original code was written in DB about 2 years prior to that. So it's old code and it shows. While it's tempting to try and clean it up for users, that seems like a lot of work for nothing (since PlayBasicFX 1.70 supports Direct3D!), so rather i'm cleaning up the appearance. Performance wise PB1.63h has enough code execution improvement to be able to do things like add backdrop, run it in higher resolution and increase Z clipping plane distance. Other cosmetics has have been smoothing the height map, which removes the jiggered terrain appearance.

Anyway here's a few new pictures of this prehistoric demo ...

Attachments

Login to view attachments
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 22nd Jul 2007 01:55 Edited at: 12th Aug 2010 00:32

Attachments

Login to view attachments
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 22nd Jul 2007 02:06
Cool. How much FPS do you get in that?


Cheers,

-naota

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 22nd Jul 2007 16:07 Edited at: 12th Aug 2010 00:33
Between 30-60fps. Depending upon the number of triangles in view.

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 22nd Jul 2007 16:11 Edited at: 12th Aug 2010 00:34

Attachments

Login to view attachments
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 22nd Jul 2007 16:38
That looks awesome. I wish I knew that much about 3D. Is there a 3D programming language in your future?


Come see the WIP!
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 23rd Jul 2007 21:56 Edited at: 13th Nov 2023 11:42
UW3D - PlayBASIC Software 3D Engine Tech Demo V0.24

This demonstration shows complete software ( no 3D hardware is used at all) render engine written entirely in PlayBasic V1.63h.

Supports:

* Flat Shading.
* Gouruad shading.
* Z Clipping (near/far planes).
* Height Map Terrain.
* Dynamic objects (poly,cube,box,plane,sphere,disc,torus,tube,cone,vertex arrays)
* User Mesh Deformation.
* Scalable View Port



Demo Controls:


Mouse + Arrow Keys - Control Camera Direction (FPS style)

Function Keys - Change 3D engine options

SPACE - Return To RESTART DEMO

ESC - EXIT DEMO



Downloads:


UW3d Work In Progress

PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 24th Jul 2007 00:11
That's really impressive Kevin. The skysphere is a little funny, but that might just be me.

I have a few questions:

Why doesn't it use Hardware? Does that not mean it'll run slower than usual?

Also, I'm interested to see how objects are created (source code). Is it just like DBP?

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 24th Jul 2007 08:09
Stupid question, but is that OpenGL or DirectX in the background? Because I can't run any DX apps at the moment, but recently I found out OpenGL apps will run fine.

<I don't wanna download it if it won't run. >

Cheers,

-naota

tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 24th Jul 2007 08:37
That's real impressive!

I see screen tearing, though. Is there a way to vertical sync in Playbasic?

I'm not a real programmer but I play one with DBPro!
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 24th Jul 2007 15:24 Edited at: 28th Mar 2011 04:04
Quote: "The skysphere is a little funny, but that might just be me. "


That's because it's not a sky sphere, it's an image. It's two actually.


Quote: "Why doesn't it use Hardware?"


Where's the skill in that ?

The original version of the engine was written in DB classic. It became the foundation of the geometry engine used in a visibility tool ( Visible Worlds) that I was tinkering with. The older demo above is a direct (shovel) port of. The update is slightly more pb'ized than the old version, but not much.

Anyway, the purpose of the example isn't to create useful Terrain engine, but rather to demonstrate PlayBasic code execution under stress.


Quote: " Does that not mean it'll run slower than usual?"


You'd get faster drawing, but it spends more time processing geometry than drawing. Further improvements could me made by replacing the rotation code with PlayBasic's built in vertex rotation, but it defeats the purpose of the demo really.


Quote: "Also, I'm interested to see how objects are created (source code). Is it just like DBP?"


The scene creation is this.





Quote: "Stupid question, but is that OpenGL or DirectX in the background? Because I can't run any DX apps at the moment, but recently I found out OpenGL apps will run fine."


It's a DX DirectDraw surface.



Quote: " I see screen tearing, though. Is there a way to vertical sync in Playbasic?"


Yes ,just enable it with ScreenVSYNC ON/OFF

Login to post a reply

Server time is: 2024-11-24 01:57:28
Your offset time is: 2024-11-24 01:57:28