Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

The best way to accelerate a Macintoy is at 9.8 meters per second per second.


programming / comp.lang.smalltalk.dolphin / OpenGL "game engine" release 1

SubjectAuthor
* OpenGL "game engine" release 1Zenchess
`* Re: OpenGL "game engine" release 1René_Juan_Rico_Mendoza
 `* Re: OpenGL "game engine" release 1Zenchess
  `* Re: OpenGL "game engine" release 1bruno.brasesco
   `- Re: OpenGL "game engine" release 1Zenchess

1
Subject: OpenGL "game engine" release 1
From: Zenchess
Newsgroups: comp.lang.smalltalk.dolphin
Date: Sun, 15 Sep 2019 09:04 UTC
X-Received: by 2002:a0c:8171:: with SMTP id 104mr6032274qvc.168.1568538263738;
Sun, 15 Sep 2019 02:04:23 -0700 (PDT)
X-Received: by 2002:a5b:889:: with SMTP id e9mr6009746ybq.381.1568538263337;
Sun, 15 Sep 2019 02:04:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!o24no8643863qtl.0!news-out.google.com!x7ni470qtf.0!nntp.google.com!o24no8643858qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Sun, 15 Sep 2019 02:04:22 -0700 (PDT)
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2600:8804:1200:6600:7c7b:c2f7:45c9:16a4;
posting-account=r2EEkwoAAADz3M0x3Szspui4wqseZF5h
NNTP-Posting-Host: 2600:8804:1200:6600:7c7b:c2f7:45c9:16a4
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5c234ef3-2a69-427d-a9b9-2e4764216df8@googlegroups.com>
Subject: OpenGL "game engine" release 1
From: zench...@gmail.com (Zenchess)
Injection-Date: Sun, 15 Sep 2019 09:04:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 74
View all headers
As promised I will now do the first release of my 'game engine'.
https://drive.google.com/open?id=11XhsFwTaCaiwz65a1xVQhr2BWAQXZYJ0

 I put 'game engine' in quotes, because it's really not even close to being entirely user friendly with a separation between smalltalk code and opengl library calls.  It's also entirely inflexible, so some opengl knowledge may be required to modify the demos.

There are 2 demos.  One is a breakout clone that you can start with the class method:

Game startWithWidth: 1920 height: 1080.

use your screen resolution of your primary monitor or it may fail.  It opens a full screen window.  You can quit the game with escape or alt-tab and close the window.

 you control the paddle with your mouse.  There's a particle trail following the ball.  This demo is very far from being optimized, many things can be done to improve performance if you were going to draw more sprites like texture atlases and instance rendering.  Another huge performance drain in both demos is creating MATRIX objects, which cut the framerate from around 1300 to 600 for me in some cases.  The framerate I get without much happening is somewhere between 4-6 thousand.  Disable VSYNC in your video driver settings if you'd like to see how high it goes for you.
 
  I do plan to continue updating the package, to better structure the code and make something more user-friendly.  I have a lot of future plans like better performance, VR integration (OpenVR or OpenXR whichever one I can get to work), and maybe even a scene editor.  Model loading with assimp is coming soon.

The 2nd demo is a 3d scene of around 100 cubes that are textured.
Start it with: Scene3DExample new startDemo.

  You can control the camera with WASD keys.  There is logic that always points the camera at a specific point, so really you can only awkwardly rotate around the cubes.  I got about 90-110 fps when I increased the number of cubes to 1000, but I'm pretty sure the huge fps drops are because of the MATRIX class instantiations every render frame.

  The code I wrote is licensed under MIT.  Some code is from Jose Gregoris which is distributed under permission.  The DeVIL library bindings and MATRIX class are from the original Unstdio release by Jeffrey Massung.

  I updated kiko's opengl package to allow use of core profile functions (opengl 3.3).  I wrote the GLFW and game example classes myself, although used
https://learnopengl.com/In-Practice/2D-Game/Breakout as a guide.

  Not all of opengl is supported.  Notably I had trouble loading extensions for more modern versions of opengl past 3.3.  There's a good chance I've made a few mistakes, but so far everything seems to work pretty well.

  Here is a video of the breakout game running from dolphin:
https://www.youtube.com/watch?v=eV48Wu80IA0&feature=youtu.be

Totally welcome to all feedback (yes, I know its rough), and collaboration, maybe I can even make a github repo with pull requests and what not if anyone is interested. 

Kiko's opengl package has a sample viewer.  All the examples made by him use the old opengl Api (fixed functionality, glBegin glEnd, etc.).

Tested only with Dolphin release 7.0.57.2 from installer

https://github.com/dolphinsmalltalk/Dolphin/releases/tag/v7.0.57.2

One thing to note is that if you are running one of the demos, the Dolphin interface will no longer accept keyboard shortcuts for certain things.  You can get around this by right click accepting , and you can probably add a 1 ms delay to the game loop process as well.

-Jacob



Subject: Re: OpenGL "game engine" release 1
From: René_Juan_Rico_Mend
Newsgroups: comp.lang.smalltalk.dolphin
Date: Fri, 17 Jul 2020 23:03 UTC
References: 1
X-Received: by 2002:a37:4690:: with SMTP id t138mr555874qka.168.1595027009179; Fri, 17 Jul 2020 16:03:29 -0700 (PDT)
X-Received: by 2002:a25:a441:: with SMTP id f59mr17288569ybi.412.1595027008918; Fri, 17 Jul 2020 16:03:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Fri, 17 Jul 2020 16:03:28 -0700 (PDT)
In-Reply-To: <5c234ef3-2a69-427d-a9b9-2e4764216df8@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=152.170.71.219; posting-account=0ro49QoAAAAGU-uROiPC-KF6633kMlV8
NNTP-Posting-Host: 152.170.71.219
References: <5c234ef3-2a69-427d-a9b9-2e4764216df8@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7d205dcc-040b-4dea-b5e6-97c754b16632o@googlegroups.com>
Subject: Re: OpenGL "game engine" release 1
From: rejur...@gmail.com (René_Juan_Rico_Mendoza)
Injection-Date: Fri, 17 Jul 2020 23:03:29 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 0
View all headers
Nice work! :)


Subject: Re: OpenGL "game engine" release 1
From: Zenchess
Newsgroups: comp.lang.smalltalk.dolphin
Date: Sat, 18 Jul 2020 00:38 UTC
References: 1 2
X-Received: by 2002:a37:a80b:: with SMTP id r11mr11682755qke.474.1595032681517;
Fri, 17 Jul 2020 17:38:01 -0700 (PDT)
X-Received: by 2002:a25:db46:: with SMTP id g67mr18753503ybf.337.1595032681284;
Fri, 17 Jul 2020 17:38:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Fri, 17 Jul 2020 17:38:00 -0700 (PDT)
In-Reply-To: <7d205dcc-040b-4dea-b5e6-97c754b16632o@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8804:1207:1200:2d4c:5841:f98f:12f2;
posting-account=r2EEkwoAAADz3M0x3Szspui4wqseZF5h
NNTP-Posting-Host: 2600:8804:1207:1200:2d4c:5841:f98f:12f2
References: <5c234ef3-2a69-427d-a9b9-2e4764216df8@googlegroups.com> <7d205dcc-040b-4dea-b5e6-97c754b16632o@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <03932178-369e-4cb1-9ed1-6eff32bc79b2o@googlegroups.com>
Subject: Re: OpenGL "game engine" release 1
From: zench...@gmail.com (Zenchess)
Injection-Date: Sat, 18 Jul 2020 00:38:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
View all headers
On Friday, July 17, 2020 at 6:03:29 PM UTC-5, René Juan Rico Mendoza wrote:
Nice work! :)

Thanks.  I've since fixed a lot of bugs, in particular the code I posted had a problem with drawing certain sprites at the right size, and many other issues.  I probably shouldn't have released it in that state, but if anyone is interested in doing opengl in dolphin at least it can be a good start.

I'll release an updated version soon


Subject: Re: OpenGL "game engine" release 1
From: bruno.br...@gmail.com
Newsgroups: comp.lang.smalltalk.dolphin
Date: Mon, 20 Jul 2020 21:21 UTC
References: 1 2 3
X-Received: by 2002:ad4:5844:: with SMTP id de4mr23784657qvb.241.1595280061918;
Mon, 20 Jul 2020 14:21:01 -0700 (PDT)
X-Received: by 2002:a25:c60c:: with SMTP id k12mr36321668ybf.407.1595280061660;
Mon, 20 Jul 2020 14:21:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Mon, 20 Jul 2020 14:21:01 -0700 (PDT)
In-Reply-To: <03932178-369e-4cb1-9ed1-6eff32bc79b2o@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=167.62.168.199; posting-account=9bXKwQoAAABPQazYnK93PaH66oPYo6yw
NNTP-Posting-Host: 167.62.168.199
References: <5c234ef3-2a69-427d-a9b9-2e4764216df8@googlegroups.com>
<7d205dcc-040b-4dea-b5e6-97c754b16632o@googlegroups.com> <03932178-369e-4cb1-9ed1-6eff32bc79b2o@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cfe9e77c-0736-4b07-a427-81b654a3a334o@googlegroups.com>
Subject: Re: OpenGL "game engine" release 1
From: bruno.br...@gmail.com
Injection-Date: Mon, 20 Jul 2020 21:21:01 +0000
Content-Type: text/plain; charset="UTF-8"
View all headers
Hi,


With latest Dolhin from Github fail with DNU:
itcReplaceAllSubstrings:with:

This method is not defined.

Are willing to upload the code to Github ?
It will be much easier to help you.

regards,
bruno


Subject: Re: OpenGL "game engine" release 1
From: Zenchess
Newsgroups: comp.lang.smalltalk.dolphin
Date: Mon, 20 Jul 2020 21:28 UTC
References: 1 2 3 4
X-Received: by 2002:a37:7a42:: with SMTP id v63mr24742234qkc.258.1595280533549;
Mon, 20 Jul 2020 14:28:53 -0700 (PDT)
X-Received: by 2002:a25:73d7:: with SMTP id o206mr34423577ybc.99.1595280533266;
Mon, 20 Jul 2020 14:28:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.smalltalk.dolphin
Date: Mon, 20 Jul 2020 14:28:52 -0700 (PDT)
In-Reply-To: <cfe9e77c-0736-4b07-a427-81b654a3a334o@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=2600:8804:1207:1200:1fc:cac:eeda:3956;
posting-account=r2EEkwoAAADz3M0x3Szspui4wqseZF5h
NNTP-Posting-Host: 2600:8804:1207:1200:1fc:cac:eeda:3956
References: <5c234ef3-2a69-427d-a9b9-2e4764216df8@googlegroups.com>
<7d205dcc-040b-4dea-b5e6-97c754b16632o@googlegroups.com> <03932178-369e-4cb1-9ed1-6eff32bc79b2o@googlegroups.com>
<cfe9e77c-0736-4b07-a427-81b654a3a334o@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3007ff4a-7ed3-40c1-93bf-5acdd64f808bo@googlegroups.com>
Subject: Re: OpenGL "game engine" release 1
From: zench...@gmail.com (Zenchess)
Injection-Date: Mon, 20 Jul 2020 21:28:53 +0000
Content-Type: text/plain; charset="UTF-8"
View all headers
I have been using it with 7.057.2 the latest 7.0 branch.  I will look into why it wouldnt work on the latest dolphin.  Sure I can paste it on github and I will put in the latest changes.


1
rocksolid light 0.7.2
clearneti2ptor