User avatar
teh_orph
Posts: 346
Joined: Mon Jan 30, 2012 2:09 pm
Location: London
Contact: Website

Re: Using openGL?

Tue Apr 24, 2012 9:02 am

So the Q3 demo, did someone convert the code into ES? Last time I worked with that code base I'm sure it was just regular OpenGL...

(if it was converted I'd really like to know how much work it was etc and how it was done)

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5282
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Using openGL?

Tue Apr 24, 2012 9:13 am

Quake was obviously converted to openGLES but not by us.
Look at https://github.com/raspberrypi/quake3/blob/master/es
I believe that is the patch of ES port.

AlArenal
Posts: 141
Joined: Sun Feb 26, 2012 6:58 pm
Location: Germany
Contact: Website

Re: Using openGL?

Tue Apr 24, 2012 10:21 am

Just a little bit off-topic here, but what kind of literature would you recommend to learn OpenGL ES?

There's a lot of good OpenGL literature available while almost all books on ES seem to be heading towards either the Android or iOS platform. I'm wondering how much of a difference that makes.

The book I'm looking for should present the basics, maybe some advanced techniques and can of course be written for C/C++ and can be rather technical and low-level.

I just don't want to spend money on a book that's mostly about some implementation details and SDKs not available on the Pi.

peterpi
Posts: 42
Joined: Wed Jan 04, 2012 3:28 pm

Re: Using openGL?

Tue Apr 24, 2012 10:33 am

The book I linked to above may have a phone on the cover, but it's generic to anything and has a good balance of theory and code.  It's almost all in vanilla C, apart from the get-set-up-on-an-iPhone chapter.

I've been using it to code GL ES within an EGL context within an X window on Debian on a PC.

AlArenal
Posts: 141
Joined: Sun Feb 26, 2012 6:58 pm
Location: Germany
Contact: Website

Re: Using openGL?

Tue Apr 24, 2012 10:41 am

Oops, should have read the thread to the end

Thanks for the recommendation. I had that one already on my Amazon wishlist but it never hurts hearing from someone who actually uses it.

Phoenix RasPi
Posts: 19
Joined: Thu Mar 29, 2012 12:42 am

Re: Using openGL?

Tue Apr 24, 2012 5:20 pm

dom said:


@Phoenix RasPi try updating GitHub, Peter has committed some missing files.



Thanks, dom.  I just happened to revisit his site late last night and saw the new files had magically appeared.  I was the first/only person to download the original files and I hope that interest encouraged Peter to add more, although I guess he may just be adding things as he gets them done, since the repo has only existed for two days.

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Using openGL?

Tue Apr 24, 2012 6:10 pm

There is a debate going on whether people should learn OpenGL first and then proceed to ES, or the other way around, as ES 2.0 is essentially now a subset of OGL and therefore involves fewer APIs to comprehend.  Since ES 2.0 now uses basically the same workflow and GL Shader Language as OGL 3.x (and 4.0 coming this year), minus some lesser-used, more complex APIs, it seems like starting with ES should be fine for what most people will want to start doing.  Understanding the underlying 3-D principles and how transformations are performed by the hardware in sequence is what's important, in either case.

I would encourage people to do a few matrix multiplications by hand to truly appreciate what the 24 GFLOPS and 40 million shaded polygons rendered per second the GPU can perform.  Rotations are particularly educational, since they involve trigonometry and, therefore, really ugly floating-point values, not the mamby-pamby 1.0, 1.0, 1.0 and other whole-integer values typically used in examples

We really need the Python integration to make these capabilities more accessible to our ultimate educational target market.

1 + 2 = 3 ... Ha!  More like [1.0 0.0 0.0] + [2.0 0.0 0.0] = [3.0 0.0 0.0]  Hey!  I just performed a translation of a positive two units on the X axis!
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: Using openGL?

Tue Apr 24, 2012 10:23 pm

well at least that debate won"t exist on RPi. you simply can"t use anything but ES on the RPi.

Plus as you point out, the ES architecture makes you much more keenly aware of the resources at hand.

At least if people did their own 3d on ES in a 2d projection they wouldn"t have to go full old school and write their own line routines too!

I"m planning on doing a GL project, but as i"m more comfortable in visual studio, i"ll get core parts working and debugged on windows first as there are several options for native ES development on a windows desktop.

my project isn"t specific to rpi, but its very appealing to the target users, and searching on here liz is pretty much the only person who"s even mentioned it (in passing, as a response to something else) which i"m very surprised at.

so, although i"m pretty much doing it for me as its been bouncing around in my head for 10+ years i"d love for it to inspire some newbie programmers like i was once inspired. my hope is that my 'twist' on something will work great on a pc desktop/laptop and rpi, but also really come into its own on a tablet in the future.
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5201
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Using openGL?

Tue Apr 24, 2012 10:40 pm

I'm dying to know what your project (the one I so presciently mentioned) is now!

Peter's one of the smartest guys I know, which is why we asked him to do some development for the project (I am sure his head is swelling now, given that all those of us who know him are full of similar compliments) - he's also kind of irritatingly quick and dedicated, so I'm sure the repository will continue to grow, and speedily.
Director of Communications, Raspberry Pi

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Using openGL?

Wed Apr 25, 2012 5:36 am

ArborealSeer,

I'm actually very surprised at how few 3-D projects seem to be in progress.  The thing that caught my attention about the Pi was the GPU - being on a $25/$35 miniscule single-board computer capable of being battery powered for extended periods was just the bonus.

Since my Pi-finity! game is being developed specifically to help teach programming, initially for math and science problems (starting with physics, then chemistry, biology, and so forth), and science and math experiments exist in 3-D in the real world, all of my efforts will feature 3-D as a first-class citizen.  That means that the programming lessons and problems will automatically include 3-D elements (e.g., energy propagation in a physics problem will involve spherical trigonometry, not just planar trig).

WebGL is essentially ES and is cross-platform, so, I'm developing my models and mechanics in WebGL to show development team members my vision for various game system components.  They will largely be usable as-is when I transition them to ES on the Pi.  If you'd like to compare notes without a lot of public visibility until you're ready, I'd be glad to provide whatever feedback and assistance you might like via PM/e-mail.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

User avatar
jbeale
Posts: 3469
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Using openGL?

Wed Apr 25, 2012 6:10 am

By the way I haven't been keeping up with graphics developments. I just read about WebGL here yesterday and did a google search. Then updated my graphics driver. Then tried looking at some of the demos at http://www.chromeexperiments.com/webgl

...and WOW! -when did all this become possible in a browser? (I guess, in the last few years?) Anyway, I'm impressed by what WebGL (and, hopefully, the Pi) is capable of.

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: Using openGL?

Wed Apr 25, 2012 7:46 am

some cool stuff in there eh?

I'm also surprised that so few are in progress, i think once people have a version in their hands that works well and they can tinker with it''ll open up. there is definitely a buzz on some graphics programming forums. A boilerplate example to jumpstart people with the libs will definitely help there.

I know 6 other people who want pi's, and none of them post on here. (not many projects there yet though). So I expect there are a lot of people out there not posting who plan stuff.

sorry liz
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

shirro
Posts: 248
Joined: Tue Jan 24, 2012 4:54 am

Re: Using openGL?

Wed Apr 25, 2012 9:37 am

jbeale said:


By the way I haven't been keeping up with graphics developments. I just read about WebGL here yesterday and did a google search. Then updated my graphics driver. Then tried looking at some of the demos at http://www.chromeexperiments.com/webgl

…and WOW! -when did all this become possible in a browser? (I guess, in the last few years?) Anyway, I'm impressed by what WebGL (and, hopefully, the Pi) is capable of.


Yes, there are lots of potentially fun bits of the Pi. It's price, GPIO, size, power requirements, educational mission. But the bit that grabbed me was the potential for squeezing unexpected performance out of the GPU. I have never used OpenGL before so this will be a challenge.

Chrome experiments might be impressive but it is more fun to fiddle and change stuff. You MUST visit http://glsl.heroku.com/ if you liked Chrome experiments. You can live code shaders in your browser. One of the youtube demos showed one of the Qt guys had made a similar interface for the Pi using Qt Quick which is also Javascript and GLSL.

AlArenal
Posts: 141
Joined: Sun Feb 26, 2012 6:58 pm
Location: Germany
Contact: Website

Re: Using openGL?

Wed Apr 25, 2012 9:43 am

WebGL is nice but you can't do too much on the Pi with it except of some basic stuff and demos. The X window system, window manager and browser eat up too much RAM for more ambitious WebGL applications.

shirro
Posts: 248
Joined: Tue Jan 24, 2012 4:54 am

Re: Using openGL?

Wed Apr 25, 2012 9:51 am

Alex Langer said:


WebGL is nice but you can"t do too much on the Pi with it except of some basic stuff and demos. The X window system, window manager and browser eat up too much RAM for more ambitious WebGL applications.


You can"t run webgl on a Pi anyway. There is no OpenGL acceleration in X Windows and there are no browsers that run under OpenGL ES on the framebuffer (yet). Nobody is talking about doing that anyway. OpenGL ES is VERY similar to WebGL. So you should be able to prototype things in WebGL and then port them to the Pi. That is what Jim is intending.

Also because Qt has things like qmlviewer which is basically an embedded Javascript interpreter with access to the Qt libs you can program OpenGL from Javascript on a Pi with no web browser or X windows in sight. It isn"t WebGL but that isn"t the point. What it will be is fun.

And RAM will not be an issue for 4k and 64k demos. Well it might be because some of them unpack a hell of a lot of procedurally generated data but that is just another challenge. For instance something like Gaia Machina despite being only 64k of executable might not fit in 128M of ram when running.

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: Using openGL?

Wed Apr 25, 2012 10:24 am

The Demoscene is definitely aware..



Raizor

Clyde

Does this mean Raspberry Demos!!



I think it does Clyde

http://www.dbfinteractive.com/.....ic=5528.40
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5201
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Using openGL?

Wed Apr 25, 2012 11:33 am

God, I hope so. The Demoscene fascinates me.  Eben and I were introduced to each other by Alex Evans (who used to be Statix, and a Demo GOD) in 1997. I think Eben and I will be going to Assembly this year - hope to see some of you there!
Director of Communications, Raspberry Pi

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: Using openGL?

Wed Apr 25, 2012 11:41 am

Demoscene fascination and wanting to replicate effects is what got me wanting to learn to code! Outside those attempts have never been anything other than an admirer though.

I"m just getting done reading pretty much the only book about the history of the Demoscene, called "Freax" the first 3/4s of it were very interesting, buts its gotten tiresome towards the end.

Once the pi platform is ready for it a "sponsored" demo comp could certainly kick things off. Commodore did this back in the day at least once and on that forum I linked people actually sponsor some of the comp challenges out of their own pocket.
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5282
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Using openGL?

Wed Apr 25, 2012 11:42 am

Peter's github now has a Python/GLSL mouse driven julia set viewer. Pretty cool...

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: Using openGL?

Wed Apr 25, 2012 11:43 am

oh nice.. does it do that thing i think fractint did where it shows the julia for each point on a mandelbrot?

(Link to the site for the book, some nice screenshots in the preview pages http://www.maz-sound.com/FREAX/ )
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

AlArenal
Posts: 141
Joined: Sun Feb 26, 2012 6:58 pm
Location: Germany
Contact: Website

Re: Using openGL?

Wed Apr 25, 2012 11:51 am

Reminds me of the good old days when we were sitting infront of our 8 MHz machines without FPU patiently waiting to get some fractals finished. And of course some of my first programs ever painted simple fractals. Therefore I had to understand some obscure code written in another language or dialect and transfer it into code my system could interprete or compile.

peterpi
Posts: 42
Joined: Wed Jan 04, 2012 3:28 pm

Re: Using openGL?

Wed Apr 25, 2012 11:53 am

Demos and homebrew games are an area that excites me, and one that the Pi ought to excel at; partly because of the uniformity of hardware.  If I write something that works to my satisfaction on my Pi, then it'll run exactly the same on anybody else's.  For graphics code especially, there are no such guarantees on the PC.

I like to think of the Pi as a tiny, homebrew games console.  Think of the model B as the devkit and the model A as the 'retail' kit.  OpenGLES is at a similar low level to the libraries you get on consoles.

Hopefully it'll be fairly easy to bodge the init scripts so that the Pi boots, fires up X (sans window manager) and have your own game set up a full screen GLES context.  Strip out as much of the distro as you can, and there's your redistributable game image.

The combination of just enough RAM, just enough CPU, big storage and a stonking GPU makes me think of PS2 development.

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: Using openGL?

Wed Apr 25, 2012 11:57 am

exactly, its perfect for showing off stuff like that..

you know how people pull faces when you say "can i run this test program on your laptop"..

with pi.. you just use the other card.. no risk!
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Using openGL?

Wed Apr 25, 2012 6:39 pm

peterpi said:


Hopefully it'll be fairly easy to bodge the init scripts so that the Pi boots, fires up X (sans window manager) and have your own game set up a full screen GLES context.  Strip out as much of the distro as you can, and there's your redistributable game image.


This is precisely the scenario we envision for Pi-finity!  Having a fixed hardware and software baseline makes development much easier, as anyone who has done game console, OS X, or iOS development can attest.  This is true all the way up to the ultimate in embedded hardware and software.  When the U.S. Air Force was developing flight control, engine, and weapons system software for the F-22 stealth fighter, they mandated that all contractors use precisely the same hardware, OS, programming language, ancillary development tools, etc.

The cost of software development constituted 75% of the entire cost of the development of the aircraft (not the cost of series aircraft production beyond prototypes) - yeah, three times the cost of developing the airframe, maneuverable-nozzle engines, stealth materials and structural configuration, avionics, weapons hardware, etc., combined.

Yes, there are definitely going to be aircraft flight elements in Pi-finity!  I'm a fixed-wing and helicopter pilot, so, they're going to be very realistic.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Using openGL?

Wed Apr 25, 2012 7:07 pm

peterpi said:


Hopefully it"ll be fairly easy to bodge the init scripts so that the Pi boots, fires up X (sans window manager) and have your own game set up a full screen GLES context.


Actually, there should be no need to run X at all, as we will be able to run ES directly, if I understand the execution stack hierarchy correctly.  Just declare the entire display area as the viewport (e.g., gl.viewport(0,0,1920,1080); ) and render away!

For those who may not have seen it, here"s a WebGL quickie I put together that shows the level of 3-D realism and image quality I"m shooting for in Pi-finity! (a WebGL capable browser is needed, such as a recent version of Chrome or Firefox)

http://everreal.zxq.net/Pi-fin.....rth_1.html

You can click and drag to rotate the planet up/down/left/right, and zooming in/out is accomplished by holding down the Shift key and clicking and dragging up/down (zoom in/out to any level by successive click/drag motions in one direction).  A giant "Pi-finity! Coming soon to a Raspberry Pi near you!" message now blots out the Sun across most of the equatorial areas of Earth

The Rasp-olution will not be televised, but, it will be available as a 1080p download from the Internet
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

Return to “General discussion”