3D polygon world render

Game development specific discussions.
Post Reply
Gunslinger
Posts: 103
Joined: Mar 08, 2016 19:10
Location: The Netherlands

3D polygon world render

Post by Gunslinger »

Hello Everyone,

I have been working on my one 3D render and i like to show some pictures and source if you like.
I call it a low-polygon cartoon style 3D.
Never did think to make it this far.

Here is a picture i like http://ac1.servegame.com:88/Screens/Screenshot03.png
some older pictures are
http://ac1.servegame.com:88/Screens/Screenshot02.png
http://ac1.servegame.com:88/Screens/Screenshot01.png
http://ac1.servegame.com:88/Screens/Screenshot04.png

The world render code is a 16x16x16 chunk area by default and containing points, triangle and lights in range.
it supports VR-mode with a big frame-rate impact :)
My plan is to send the chunks over internet for a multiplayer game, but i have a lot to do.
I have modified D.J.Peters polygon for it http://www.freebasic.net/forum/viewtopi ... 09#p227109
And i'm still learning the freebasic languages on my one way.

Tell me what you think.
thesanman112
Posts: 538
Joined: Jul 15, 2005 4:13

Re: 3D polygon world render

Post by thesanman112 »

Looks good....f14 kamakzee is a game i developed in freebasic going back many years...it took me over a year of prgramming to get a good working demo whipped up..realms of darkness was another...notbsure if itnwould still be on this server or not.
Gunslinger
Posts: 103
Joined: Mar 08, 2016 19:10
Location: The Netherlands

Re: 3D polygon world render

Post by Gunslinger »

Update 2
I got back on it. https://youtu.be/gB4ajrh-aU0
Now loads from STL 3D files.

The 200 trees are objects and the cubes are dropped in solid world.
Moving light is still not on the objects.
Last edited by Gunslinger on Oct 08, 2018 22:34, edited 1 time in total.
dafhi
Posts: 1640
Joined: Jun 04, 2005 9:51

Re: 3D polygon world render

Post by dafhi »

thanks for sharing :-)
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: 3D polygon world render

Post by paul doe »

Gunslinger wrote:I have been working on my one 3D render and i like to show some pictures and source if you like...
A little source code would be nice, I think ;)
Gunslinger
Posts: 103
Joined: Mar 08, 2016 19:10
Location: The Netherlands

Re: 3D polygon world render

Post by Gunslinger »

paul doe wrote:
Gunslinger wrote:I have been working on my one 3D render and i like to show some pictures and source if you like...
A little source code would be nice, I think ;)
The source code is not little any more.
So many thing to improve and cleanup.
here you go. http://ac1.servegame.com:88/download/Ar ... linger.zip

I think i can use pointers in triangles data type to improve performance.
Let me know if you have any tips. :-)
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: 3D polygon world render

Post by paul doe »

Gunslinger wrote:Let me know if you have any tips. :-)
Nice! Didn't take a really depth look, but for now I can tell you that it freezes the process after a while. Are you using getMouse() in another thread? It is either this, or you're having a race condition somewhere in the code.

One tip for now: the movement speed varies wildly with the framerate (~14-45 FPS here). You need to either:
  • Take the rendering time into account when doing the update (see here)
    - Or -
  • Implement a framerate independent update loop (see here)
Pretty good work, considering it's rendered all in software!
Gunslinger
Posts: 103
Joined: Mar 08, 2016 19:10
Location: The Netherlands

Re: 3D polygon world render

Post by Gunslinger »

paul doe wrote:
Gunslinger wrote:Let me know if you have any tips. :-)
Nice! Didn't take a really depth look, but for now I can tell you that it freezes the process after a while. Are you using getMouse() in another thread? It is either this, or you're having a race condition somewhere in the code.

One tip for now: the movement speed varies wildly with the framerate (~14-45 FPS here). You need to either:
  • Take the rendering time into account when doing the update (see here)
    - Or -
  • Implement a framerate independent update loop (see here)
Pretty good work, considering it's rendered all in software!
Thanks, Freezes happens when the video buffer is to small.
It wil do a redim preserve for more room as many times as needed.
That array is very big so it freezes a bit, over times it will stop doing that.

And i know about frame rate, just like to see how high it gets.
When i move up way from the world the fps go to 300+ and i rocket of in space :)
Last edited by Gunslinger on Oct 09, 2018 20:37, edited 1 time in total.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: 3D polygon world render

Post by paul doe »

Gunslinger wrote:Thanks, Freezes happens when the video buffer is to small.
It wil do a redim preserve for more room as many times as needed.
That array is very big so it freezes a bit, over times it will stop doing that.
Yes, but it shouldn't freeze the app. Also, why such a simple scene uses an inordinate amount of memory? Task Manager reports a usage of ~888 MB here (!)
Gunslinger wrote:And i know about frame rate, just like to see how high it gets.
When i move up way form the world the fps go to 300+ and i rocket of in space :)
Perhaps, but that also shouldn't happen. By decoupling the updating from the rendering, you can move at a consistent speed while still allowing the renderer to go as fast as your hardware can handle. See this article for details: https://www.koonsolo.com/news/dewitters-gameloop/
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: 3D polygon world render

Post by badidea »

Awesome :-)

Change:
#include "include/keyboard.bi" to #include "Include/keyboard.bi"
And delete:
#if defined(__FB_WIN32__) block in LP3_data_type.bi
And it runs under linux fbc32 and fbc64 bit as well.

Movement with mouse-pad is a bit annoying.

Three months to turn it into a game: https://freebasic.net/forum/viewtopic.php?f=17&t=27069
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: 3D polygon world render

Post by BasicCoder2 »

Cool demo. Can the code be used to make something like this?
https://www.youtube.com/watch?v=8piDU5UFA68
I remember the fun of learning to land on the air craft carrier without crashing. Flying under the Golden Gate bridge and over Alcatraz.
Looking back on some of the old software I have to take my hat off to the clever programmers of the time who had to make do with little memory and slow computers. Of course the Amiga did have special graphics hardware for some things such as drawing and filling in polygons.
I remember Mark Silby of Blitz Basic fame making a simple 3d demo of flying around the three pyramids and thought it would be cool to be able to do that myself.
Gunslinger
Posts: 103
Joined: Mar 08, 2016 19:10
Location: The Netherlands

Re: 3D polygon world render

Post by Gunslinger »

BasicCoder2 wrote:Cool demo. Can the code be used to make something like this?
https://www.youtube.com/watch?v=8piDU5UFA68
I remember the fun of learning to land on the air craft carrier without crashing. Flying under the Golden Gate bridge and over Alcatraz.
Looking back on some of the old software I have to take my hat off to the clever programmers of the time who had to make do with little memory and slow computers. Of course the Amiga did have special graphics hardware for some things such as drawing and filling in polygons.
I remember Mark Silby of Blitz Basic fame making a simple 3d demo of flying around the three pyramids and thought it would be cool to be able to do that myself.
I think this can do better then that game. The number of triangles i have is insane and uses like 800mb just to load the world.
Sins the world in my code is made of areas(chunks) so i can load chunks from disk and unload unused chunks, if needed.
The core code is far from complete.

And you bring me memories of F29 Retaliator (DOS game)
https://www.youtube.com/watch?v=gXdfsFYX-XU
Gunslinger
Posts: 103
Joined: Mar 08, 2016 19:10
Location: The Netherlands

Re: 3D polygon world render

Post by Gunslinger »

paul doe wrote:
Gunslinger wrote:Thanks, Freezes happens when the video buffer is to small.
It wil do a redim preserve for more room as many times as needed.
That array is very big so it freezes a bit, over times it will stop doing that.
Yes, but it shouldn't freeze the app. Also, why such a simple scene uses an inordinate amount of memory? Task Manager reports a usage of ~888 MB here (!)
Gunslinger wrote:And i know about frame rate, just like to see how high it gets.
When i move up way form the world the fps go to 300+ and i rocket of in space :)
Perhaps, but that also shouldn't happen. By decoupling the updating from the rendering, you can move at a consistent speed while still allowing the renderer to go as fast as your hardware can handle. See this article for details: https://www.koonsolo.com/news/dewitters-gameloop/
I had a look in memory use and i found the world reserved 4-8 times more then needed areas.
And i am sure more things are big. Got it down to 200mb on 32-bit.

I will look in the frame rate game speed issue, thanks for the link.
The plan is to have everything timer based speeds.


@badidea
Three months to turn it into a game, i'm not sure if that is possible.
Maybe something for fun.
And mouse-pads are always annoying, but works fine here.
Post Reply