Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 35
» Latest member: AmateurUnova
» Forum threads: 111
» Forum posts: 249

Full Statistics

Online Users
There are currently 8 online users.
» 0 Member(s) | 8 Guest(s)

Latest Threads
How to Register
Forum: Scratchpad Games
Last Post: Brian Beuken
Yesterday, 02:10 PM
» Replies: 0
» Views: 5
Installation of Bullet, S...
Forum: Fundamentals Errata/Questions
Last Post: Brian Beuken
Yesterday, 12:23 PM
» Replies: 1
» Views: 6
Now using the 3B+ as main...
Forum: General Chat
Last Post: Brian Beuken
Yesterday, 10:00 AM
» Replies: 0
» Views: 5
C++ Coding MagPi #73
Forum: General Chat
Last Post: Brian Beuken
Yesterday, 09:34 AM
» Replies: 0
» Views: 5
C++ Coding MagPi #72
Forum: General Chat
Last Post: Brian Beuken
Yesterday, 09:33 AM
» Replies: 0
» Views: 2
C++ Coding MagPi #71
Forum: General Chat
Last Post: Brian Beuken
Yesterday, 09:31 AM
» Replies: 0
» Views: 2
installing STB and GLM
Forum: General Chat
Last Post: Brian Beuken
Yesterday, 09:22 AM
» Replies: 0
» Views: 5
Asus Tinkerboard
Forum: Other SBC's
Last Post: Brian Beuken
09-23-2018, 08:51 PM
» Replies: 2
» Views: 340
Linux getting in the way ...
Forum: Other SBC's
Last Post: Brian Beuken
09-23-2018, 05:55 PM
» Replies: 2
» Views: 37
XU4
Forum: Other SBC's
Last Post: Brian Beuken
09-23-2018, 05:33 PM
» Replies: 3
» Views: 895

 
  Display Size and loading Lenna
Posted by: mayoricecream - 04-24-2018, 07:58 PM - Forum: Help my code won't work?? - Replies (10)

Hello,

When I try and get the pi to display the window in full-screen my monitor will turn black and stay black until the project breaks. When I hard code the resolution it works fine. For now I am just running the code with the resolution hard coded but any tips regarding this subject would be cool. 

I am also having another issue that could very well be a typo. When I try and get the picture of Lenna to come up I can see a opengl window opening up but the program output gives me a error until I break the program. I believe it has something to do when I draw the rectangle but I am not certain.

Print this item

  Depth Buffers
Posted by: Brian Beuken - 04-23-2018, 01:58 PM - Forum: Fundamentals Errata/Questions - No Replies

In page 318, The Fixed Pipeline Isn't Quite Dead

Though the text is all correct, there is no specific notice that the EGL attribute_list will also need to have defined a depth buffer defined as below, if you have expanded from the cubefast demo, you will need to update your attribute list to look like this, the hellocubestex demo already has this set up.

static const EGLint attribute_list[] =
{
EGL_RED_SIZE,
8,
EGL_GREEN_SIZE,
8,
EGL_BLUE_SIZE,
8,
EGL_ALPHA_SIZE,
8,
EGL_SAMPLE_BUFFERS,1, // if you want anti alias at a slight fps cost
EGL_SAMPLES,4,  //keep these 2lines, espeically useful for lower resolution
 
EGL_DEPTH_SIZE,5, //<<<<this allows depth buffers to work
EGL_SURFACE_TYPE,
EGL_WINDOW_BIT,
EGL_NONE
};

Print this item

  I'm not getting the 100x speed
Posted by: Brian Beuken - 04-21-2018, 02:47 AM - Forum: Fundamentals Errata/Questions - No Replies

Page 311 says you will get 100 times the speed using VBO's

yeah, well hmmm, a slight exaggeration on my part, it does depend on what target you are using, and also what format the data is, how much there is of it etc.  So while it is actually possible to get 100x the speed, really with the cube demo, it will only get that good on one of the bigger 8-16core high clock GPU systems I have here, the standard Raspberry 3 and lesser models, can't really match that. Though with  proper optimizations you can get pretty close to that.

But even if you can't manage 15000 cubes in 30+fps, you will notice a big boost in speed simply by avoiding doing too many repetitive calls to the GPU and focusing only on doing the minimum number of draw calls.

The cube demo could be a great demo to show you fake instancing, which allows you to draw around 32 cubes with one draw call.. Now..that does give you a massive speed boost as does using indexing, which I don't use anywhere in the book...try checking it out. 

I think I should make it clear in the next edition, that 100x is really for the higher end GPU's and the majority Raspberry users won't get that much

Print this item

  Hello All
Posted by: mayoricecream - 04-20-2018, 08:50 PM - Forum: General Chat - Replies (1)

Hello my name is Juston Metarref. I am currently a student programmer and am looking forward to making games. I'm mainly here to ask questions about the book. Looking forward to the adventure.

Print this item

  Open VG
Posted by: Brian Beuken - 04-20-2018, 03:36 PM - Forum: Raspberry Pi questions - No Replies

Got asked if I was going to include OpenVG in any tutorials.

I really don't know, I tinkered with it when it 1st came out but only as far as the usual make a shape kinda demo's, I never saw any point in using it in games.

I'm not too sure if it would add anything to a game framework other than making menu's a bit simpler. I don't even know if it can co-exist with OpenGL render buffers doing their thing

Perhaps others can give some input here.  Looking at the Raspberry forums, its a viable concept for 2D and menu systems, but I can't really see what it offers those of us doing 3D?
If it could handle overlays then it might be an interesting way to quickly create text boxes, so its worth an investigation at least.

I do have Jan Newmarch's book Raspberry Pi GPU Audio Video Programming which has a small section on using OpenVG for text rendering, so I might work through that and see what I can do with it.

Print this item

  Immediate error Frame not in Module
Posted by: Brian Beuken - 04-19-2018, 10:36 PM - Forum: Help my code won't work?? - No Replies

This one might happen by accident when you are setting up your project or changing some values in the makefile settings

Check the type of project you are making in Makefile settings Project Type, it should say Executable, if its one of the other 2 options it will not run.

It may be you accidentally set this value by moving a mouse over it an not noticing, or you edit the makefile in error.

But bottom line is the fix is to make sure you are building an executable, just click on the box and select executable, then apply.

Print this item

  OAB's VB's VBO's ermmm
Posted by: Brian Beuken - 04-19-2018, 02:56 PM - Forum: Fundamentals Errata/Questions - No Replies

In Chapter 6, Buffers Buffers everywhere, 

I got a bit mixed up with trying to explain OAB's Object Attribute Buffers, which are actually a generic concept not an OpenGLES2.0 concept, Other graphic API's use different types of buffers and I think I just tripped over my laces after doing some work on another system and my brain farted that out. 

OpenGLES has a more limited type of buffer and its quite wrong to refer to them as OAB's

And in fact despite my tendency to refer to them as VB's they should strictly speaking be called by their proper name of VBO's Vertex Buffer Objects.

So ignore my use of Object Attribute Buffers and call them VBO's

Which is... a buffer containing various attributes which the GPU can use when properly informed of how the data is laid out!


I'll make a note to tidy that section up

Print this item

  Disable OpenGL, for failed to add service error
Posted by: Brian Beuken - 04-15-2018, 11:26 AM - Forum: Help my code won't work?? - Replies (1)

A new thing I wasn't aware of, since my Raspberry Pi's don't have the experimental version of OpenGL activated.

If your pi is currently running with "full" OpenGL enabled, then the OpenGLES2.0 demos in the book and on the site will most likely fail to run, giving a failed to add service error.

The fix is simple, you need to have a totally fresh install of Raspbian before you start working on the book. (this is by far the best option)

or

You have to disable the OpenGL drivers. You can do this by opening a terminal and entering

sudo raspi-config

use your keyboard to select Advanced options, 
select GL Driver
and then use Legacy Original non-GL drivers

(if you have OpenGL drivers installed it will say disable GL drivers instead)

Once done you are back in OpenGLES2.0 mode, and all OpenGLES2.0 projects should now work fine.

There are work rounds to get OpenGL to work, but really I would avoid that, the projects are all designed on OpenGLES2.0 so best to use it.


Reading the Pi forums, there may be other causes for this error, but for Stretch, this seems the most likely.

Print this item

  error running first example (chapter 3 triangle)
Posted by: michal - 04-14-2018, 01:48 PM - Forum: Help my code won't work?? - Replies (13)

First of all im sorry i did not use the other forum, but i was only allowed to post in this for some reason.

Anyways, my project compiles but it does not run.

I am getting the following error 

Code:
* failed to add service - already in use?

Have no idea how to fix it.

Print this item

  C++ Coding MagPi #69
Posted by: Brian Beuken - 04-13-2018, 08:29 AM - Forum: General Chat - No Replies

A bit of a leap this month as we finally get a game (of sorts) up and running. Most of the explanations for what is happening are in the source code as the article needs to describe what we're doing rather than spell out the code.

Using what we learned previously about creating objects and giving them graphics we can arrange for a playfield to be displayed and populate it with items which we set up at the beginning and also create as the game is in progress.

This is our first proper use of inheritance and creating objects in the free space memory using the new keyword. It also means we need to take responsibility for removing items we make when we are done with them which brings us to the delete keyword. These 2 keywords should always balance up.

We will also see that even though we are making a game, it clearly suffers from some issues, especially speed. Next month we need to look into why a project that is working fine, isn't working fast and what we can do about that.

Print this item