Having Trouble Getting Started With Gl Es 2...


wermy

Active Member
Joined
May 18, 2009
Messages
702
Location
Arkansas, United States
As the topic says, I'm having some trouble getting started with GLES2. I looked on the wiki, but could only really find ES 1.1 info.
I've programmed using OpenGL before (it's been a while), but am new to OpenGL ES 2 (specifically programmable shaders, which I'd like to learn), and am having some trouble getting started with a dev environment. I first tried downloading and setting up the PowerVR SDK, but I run into issues of not having the actual GLES libraries installed -- come to find out in the readme it says you have to get those from your distro (I'm using Ubuntu 9.04), which I can't find. Then I found Cpajstu's (sp?) SDL1.3/GLES pack on his git repository. Trying to make it gives me the same issue of being unable to find GLES/gl.h and GLES/egl.h.
Anyway, there could be something very stupid I'm missing here, but I've been trying to get started for a couple of days with no luck. Is it best to just use desktop OpenGL for now, and port to ES whenever the Pandora ships? I doubt I'll be using any features that aren't included with ES 2, but wanted to develop with it from the beginning just to be on the safe side. Thanks for any info.
 
wermy said:
I first tried downloading and setting up the PowerVR SDK, but I run into issues of not having the actual GLES libraries installed -- come to find out in the readme it says you have to get those from your distro (I'm using Ubuntu 9.04), which I can't find. Then I found Cpajstu's (sp?) SDL1.3/GLES pack on his git repository. Trying to make it gives me the same issue of being unable to find GLES/gl.h and GLES/egl.h.
Doesn't the SDK include the libraries (.so files) and headers? (I actually haven't checked it out because I haven't found a need for an ES emulator)
wermy said:
Anyway, there could be something very stupid I'm missing here, but I've been trying to get started for a couple of days with no luck. Is it best to just use desktop OpenGL for now, and port to ES whenever the Pandora ships? I doubt I'll be using any features that aren't included with ES 2, but wanted to develop with it from the beginning just to be on the safe side. Thanks for any info.
If you'll be using any form of "glBegin"..."glEnd", you're out of luck. Also, if you want more than just texturing your scene, you'll have to give up the whole OpenGL fixed pipeline including the matrix stacks to get access to shaders. So no, I would not recommend first writing your game using OpenGL 2.0.
 
Last edited by a moderator:
dflemstr said:
If you'll be using any form of "glBegin"..."glEnd", you're out of luck. Also, if you want more than just texturing your scene, you'll have to give up the whole OpenGL fixed pipeline including the matrix stacks to get access to shaders. So no, I would not recommend first writing your game using OpenGL 2.0.

Hey, thanks for the reply. I wasn't planning on using glBegin/glEnd (and the whole fixed pipeline alltogether) for the very reasons you mentioned -- I was planning on using shaders all around. This raises another question I hadn't thought of: is GLSL different (other than the features supported) for GL and GLES? As far as syntax and everything goes, that is. Could I write a simple vertex shader in GL and it should work in GLES? My program will be fairly basic graphics-wise -- in fact the only reason I can see me needing any kind of texture would be for a particle system and perhaps a skybox. The bulk of the game will be nice and retro line-based. I'd just really like to learn to use shaders. :)
 
Last edited by a moderator:
I think ES 2.0 uses generic "vertex attributes" instead of the fixed function "vertex position, color, tex coords, etc."

So in GLSL ES, you'd have to map those things to attributes.
 
lulzfish said:
I think ES 2.0 uses generic "vertex attributes" instead of the fixed function "vertex position, color, tex coords, etc."

So in GLSL ES, you'd have to map those things to attributes.
that, plus es 2.x does not have any built-in uniforms. basically, anywhere where a desktop-2.x-based GLSL shader accesses built-in attributes or uniforms ("gl_*") you will have to re-implemented those through custom counterparts.
 
Last edited by a moderator:
darkblu said:
lulzfish said:
I think ES 2.0 uses generic "vertex attributes" instead of the fixed function "vertex position, color, tex coords, etc."

So in GLSL ES, you'd have to map those things to attributes.
that, plus es 2.x does not have any built-in uniforms. basically, anywhere where a desktop-2.x-based GLSL shader accesses built-in attributes or uniforms ("gl_*") you will have to re-implemented those through custom counterparts.
Yeah, well I count that as belonging to the fixed function pipeline so I meant to say so implicitly :p

There's a spec sheet somewhere that lists all of the OpenGL2.0 and OpenGL ES 2.0 intersections, but I can't find it ATM.

I did find an old Java interface specification that lists all of the functions from a Java POV though. It's not of much use unless you program in Java though...
 
Last edited by a moderator:
dflemstr said:
There's a spec sheet somewhere that lists all of the OpenGL2.0 and OpenGL ES 2.0 intersections, but I can't find it ATM.
everything you need is here
http://www.khronos.org/registry/gles/

edit: heh, i was wrong - as a matter of fact, es' GLSL has one built-in uniform: depth range in window coordinates. i don't think i've ever used it, or seen anybody using it in a desktop GLSL shader ; )
 
Last edited by a moderator:
darkblu said:
dflemstr said:
There's a spec sheet somewhere that lists all of the OpenGL2.0 and OpenGL ES 2.0 intersections, but I can't find it ATM.
everything you need is here
http://www.khronos.org/registry/gles/

edit: heh, i was wrong - as a matter of fact, es' GLSL has one built-in uniform: depth range in window coordinates. i don't think i've ever used it, or seen anybody using it in a desktop GLSL shader ; )

The PowerVR SDK has good step by step tutorials, I had no trouble installing it and getting it working under XP, I haven't tried Linux but if it follows the same directory structure the libs & headers should be under the 'builds' folder in the SDK root.
I also found this book helpful: http://www.amazon.co.uk/OpenGL-ES-2-0-Programming-Guide/dp/0321502795/ref=sr_1_1?ie=UTF8&s=books&qid=1255626540&sr=8-1
 
Last edited by a moderator:
Thanks for all the input guys. :) I guess I'll stick at it and try getting GLES2 code compiling and running on my machine -- I don't want to have to do a whole lot of changes for the Pandora.

TheGoodDoktor said:
The PowerVR SDK has good step by step tutorials, I had no trouble installing it and getting it working under XP, I haven't tried Linux but if it follows the same directory structure the libs & headers should be under the 'builds' folder in the SDK root.
I also found this book helpful: http://www.amazon.co.uk/OpenGL-ES-2-0-Programming-Guide/dp/0321502795/ref=sr_1_1?ie=UTF8&s=books&qid=1255626540&sr=8-1
I guess I gave up looking too quickly (although, to be fair, it does say on page 15 of the PowerVR SDK user guide "OpenGL ES 2 Libraries are not distributed with the POWERVR Linux SDKs. Ask your platform provider for these libraries if you do not have the."). But you're right, they are right there in the Builds folder... Weird. Anyway, I'm off to tinker with them now. Thanks! :)

P.S I'm about a third of the way through that book you mentioned (I picked it up a while back). You're right, it is very helpful, I recommend it to anyone looking to get into GLES.
 
Last edited by a moderator:
Could I write a simple vertex shader in GL and it should work in GLES?
ES 2.0 require precision specifiers on all attrib/uniform/temp declarations except scalars/texunits. Apart from the lack of most inbuilt uniforms/attribs and the ftransform() function its pretty much the same or better.

I guess I gave up looking too quickly (although, to be fair, it does say on page 15 of the PowerVR SDK user guide "OpenGL ES 2 Libraries are not distributed with the POWERVR Linux SDKs. Ask your platform provider for these libraries if you do not have the."). But you're right, they are right there in the Builds folder... Weird.
I think they're talking about the libraries for GLES development on hardware which has native support for ES, not the emulation layer you use on your PC.
 
Adventus said:
Could I write a simple vertex shader in GL and it should work in GLES?
ES 2.0 require precision specifiers on all attrib/uniform/temp declarations except scalars/texunits. Apart from the lack of most inbuilt uniforms/attribs and the ftransform() function its pretty much the same or better.

I guess I gave up looking too quickly (although, to be fair, it does say on page 15 of the PowerVR SDK user guide "OpenGL ES 2 Libraries are not distributed with the POWERVR Linux SDKs. Ask your platform provider for these libraries if you do not have the."). But you're right, they are right there in the Builds folder... Weird.
I think they're talking about the libraries for GLES development on hardware which has native support for ES, not the emulation layer you use on your PC.

Sorry, in that case you want to do something similar to what is outlined for the Beagleboard:
http://code.google.com/p/beagleboard/wiki/HowtoUseSGXunderAngstrom
I'm a Beagleboard developer rather than a Pandora developer so I apologise if this information is way off the mark but as far as I know they are very similar.
Someone please correct me if I'm wrong as the last thing I want to do is spread false information.
 
Last edited by a moderator:
just a heads-up:

the latest IMG insider's newsletter has a short (but instructive) piece on what the SGX pipeline looks like. i think it would be interesting for many here (insider's subscription is free).
 
darkblu said:
just a heads-up:

the latest IMG insider's newsletter has a short (but instructive) piece on what the SGX pipeline looks like. i think it would be interesting for many here (insider's subscription is free).

Interesting, but nothing especially surprising for me. Except that the tiling coprocessor performs clipping - is this accessible in OGL ES 2?

I think I'll be more looking forward to next issue since it's supposed to go into more detail.
 
Last edited by a moderator:
Exophase said:
Interesting, but nothing especially surprising for me.
indeed, things are more or less as people have been suspecting for a long time now. it's nice to hear it from the horse's mouth, though.

Exophase said:
Except that the tiling coprocessor performs clipping - is this accessible in OGL ES 2?
not in 2.x afaik, just in 1.1 (and an obsolete IMG extension in 1.0).

Exophase said:
I think I'll be more looking forward to next issue since it's supposed to go into more detail.
yes, so am i.
 
Last edited by a moderator:
PokeParadox said:
Seemed to have overlooked this topic, but I'm having trouble getting the PVR SDK to play nice in x64 Xubuntu.
Any help appreciated!

OK, I've never actually installed the SDK myself, but will do so now (On my Arch x86_64 computer) and report live on what I do (and how I handle problems etc).

OK? Go!

1. I go to http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp#GLES2
2. I click this link: http://www.imgtec.com/powervr/insider/powervr-login.asp?SDK=LinuxOGLES2
3. I log in using my imgtec login details
4. I agree to the terms and conditions + start the download

...waiting for download...

5. 'cd Download/; tar xvf SDK_OGLES2_LINUX_PCEMULATION_2.05.25.0804.tgz'
6. 'cd SDKPackage/Binaries/X11/Demos/Coverflow'
7. ./OGLES2Coverflow
Output: error while loading shared libraries: libGLESv2.so: cannot open shared object file: No such file or directory
8. 'export LD_LIBRARY_PATH=../../../../Builds/OGLES2/LinuxPC/Lib/'
9. './OGLES2Coverflow'
Output: error while loading shared libraries: libjpeg.so.62: wrong ELF class: ELFCLASS64
10. 'yaourt -S lib32-libjpeg6' (Use a different package on Ubuntu)
11. './OGLES2Coverflow'
Output:
PVRShell: EGL 1.3 initialized
Profile Chosen: SGX530
devd.png


12. 'cd ../OGLES2Shaders; ./OGLES2Shaders'
Output:
PVRShell: EGL 1.3 initialized
Profile Chosen: SGX530
dev1d.png


13. 'cd ../Skybox2/; ./OGLES2Skybox2'
Output:
PVRShell: EGL 1.3 initialized
Profile Chosen: SGX530
dev2.png


Pretty simple if I may say so myself.
 
Last edited by a moderator:
dflemstr said:
Pretty simple if I may say so myself.
It should be simple unfortunately, I'm having problems here:
Code:
kevin@kevin-desktop:/opt/PowerVR_SDK/Binaries/X11/Demos/Shaders$ getlibs -p libjpeg62
The following i386 packages will be installed: libjpeg62
Continue [Y/n]? Y
Downloading ...
Installing libraries ...
kevin@kevin-desktop:/opt/PowerVR_SDK/Binaries/X11/Demos/Shaders$ ./OGLES2ShadersPVRShell: EGL 1.3 initialized
Segmentation fault
 
Last edited by a moderator:
PokeParadox said:
dflemstr said:
Pretty simple if I may say so myself.
It should be simple unfortunately, I'm having problems here: [...]
What is the output of your glxinfo? Does 3D work in general inside of the VM? Do you have full OpenGL 2.0 support? Especially a list of extensions (also from glxinfo) would be helpful.

Also, Ubuntu is in general (relatively) a bit behind when it comes to library versions and kernel ABIs etc. I'm using the git libdrm (20091028) version, and the 2.6.31 kernel, for example (but I don't think that that'll make a difference).

BTW, have you tried to compile the demos yourself (in SDKPackage/Demos/Coverflow/OGLES2 for example; there's a makefile in .../Coverflow/OGLES2/Build/LinuxGeneric)?
 
Last edited by a moderator:
darkblu said:
not in 2.x afaik, just in 1.1 (and an obsolete IMG extension in 1.0).

In that case I think IMG definitely needs to do something to expose this to OGL ES 2, since you can't do geometry level clipping in either vertex or pixel shaders, and even if you could (w/geometry shaders for instance) here it's being done with no shader utilization at all. It's my utmost hope that we'll be seeing a lot of new extensions in the future, like support for depth textures. I'd also like the ability to render to all of the formats supported by textures, especially if 16:16 dual channel ones are really supported in hardware like the OMAP3530 documentation claims, but also single 8bit or 16bit textures. Would be nice to have a lot of options for custom render formats, for rendering things beyond colors.

It's going to be pretty bad if we're routinely held back by the API instead of the hardware, especially when SGX is going to be a fixed platform for all sorts of mobile applications, not least of all those for iPhone 3GS. Best to be able to take the most advantage of it rather than be shoe horned into a lowest common denominator platform.

That, or Maciek succeeds with his alternative.

I asked a bunch of questions on the PowerVR Insider board but I haven't gotten a response yet :(
 
Last edited by a moderator:
Back
Top