OpenGL ES & Q1 Tutorials

195 views
Skip to first unread message

Michael Leahy (Tactel US)

unread,
May 5, 2009, 12:07:25 AM5/5/09
to Android Bounty II Mobile Quake
Greets,

Well I have some exciting news as my next project at Tactel US (I'm a
software architect working on Android projects) is to start a
technology blog/tutorial site for Android. I proposed basing the first
tutorial sections on OpenGL ES and with a section on a Java port of
Quake 1 as there is very little information specifically targeting
Android, OpenGL ES, and 3D engines (let alone for desktop Java on this
topic). With a bit of good fortune this topic was approved and I'll be
providing educational tutorials on core OpenGL ES techniques and
dissect a bit of the Q1 engine and initially provide a port for the
level renderer and model loader. This will provide a kick start for
the native Java Q1 port effort and a foundation to complete the rest
of the port to Android for those inclined to do so.

Here is an overview of the sections. Note Section 3 will draw from
the NeHe tutorials that are pertinent to Q1 tech and may include new
material for Android that is not a part of the NeHe tutorials. Section
4 is on the Q1 engine and will likely contain more sections.

I'd like you guys to review this outline and let me know if there are
additional topics you'd like to see covered that fit into the general
goals of the site.

My plan is to work pretty furiously on this project and launch it by
Google I/O with at least the Q1 level renderer and model loader
completed if possible and all goes well.

Regards,
--Mike

Section 1: General Information
-----------------------------------------------

1. Android Development Setup – This tutorial describes how to set up
the Android developer environment for Eclipse and command line Ant
compilation. Links to relevant information will be provided.

2. AndroidManifest.xml – There are a lot of parameters in
AndroidManifest.xml and some that are quite useful for the life cycle
of an Android activity.

3. Timing and Control – One of the most important aspects of near real
time software development is accurate timing control. This tutorial
will cover the EGR Software / Typhon timing mechanism that will be
reused in all OpenGL examples and the Q1 engine.

4. Setting up Android / OpenGL ES – Describes the base code used to
setup the rendering context that will be used in all OpenGL ES
examples including the Q1 engine.

5. Testing capabilities of the device and OpenGL ES specific support.

6. Input control – Describes framework code that will be used to
gather input control from various sources such as the keyboard,
trackball, and accelerometer. This tutorial also covers how to setup
the standard menu system.

7. An overview of the T-Mobile G1 – Pertinent information on the G1
and HTC Magic (“G2”) will be covered in this tutorial from processor
information to OpenGL performance metrics.

8. Android 1.0 API vs Android 1.5 API – Discuss the differences
between both API versions and any ramifications on supported OpenGL ES
functionality.

9. NIO NIO NIO – Discussed Java NIO and why it is important for OpenGL
rendering and networking. Also discusses performance issues when using
NIO on Android.


Section 2: Math and Algorithms
-----------------------------------------------
1. Vectors / Matrices / Normals – Provides an overview with links to
other online material covering the basics of linear algebra including
vectors and normals and some applied information. Discussion on the
framework code that provides this functionality is discussed.

2. Coordinate systems and units – Discusses the left hand and right
hand coordinate systems and the concept of unit measurement in OpenGL.

3. Faster math shortcuts - Including lookup tables and approximations
for common functions

4. Radix Sort – A fast sorting technique useful for alpha blending

5. BSP Trees – A general introduction to binary space partitioning
trees.


Section 3: OpenGL ES fundamentals & NeHe Tutorial Ports – One demo APK
with all tutorials in finished form available for download
-----------------------------------------------

1. Tutorial 1 – Vertex Arrays & Your First Polygon –
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=02
In addition to the basic NeHe lesson OpenGL ES specific information
will be covered including vertex arrays. A discussion on the various
primitive drawing modes.
Deliverables – source code for tutorial 1

2. Tutorial 2 – Adding Color – http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=03
Deliverables – source code for tutorial 2

3. Tutorial 3 – Projection, Model View Matrices including orthographic
projection and basic camera functionality
Deliverables – source code for tutorial 3

4. Tutorial 4 – Rotation – http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=04
Deliverables – source code for tutorial 4

5. Tutorial 5 – 3D Shapes – http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=05
Deliverables – source code for tutorial 5

6. Tutorial 6 – Texture Mapping – http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06
Deliverables – source code for tutorial 6

7. Tutorial 7 – Texture Filters, Lighting –
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=07
Deliverables – source code for tutorial 7

8. Tutorial 8 – Blending – http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=08
Deliverables – source code for tutorial 8

9. Tutorial 9 – Fonts – Provides a discussion on font rendering with
OpenGL ES and creating font textures dynamically from installed
Android fonts.
Deliverables – source code for tutorial 9

10. Tutorial 10 – Masking – http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=20
Deliverables – source code for tutorial 10

11. Tutorial 11 – Bump-Mapping, Multi-Texturing & Lightmapping –
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=22

In addition to covering the standard NeHe lesson lightmapping will be
discussed as part of multi-texturing.
Deliverables – source code for tutorial 11

12. Tutorial 12 – Alpha Blending / Alpha Testing / Sorting –
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=32
Deliverables – source code for tutorial 12

13. Tutorial 13 – Billboarding – Billboarding is one of the most
crucial techniques to use to fake 3D shapes and allow for better
rendering performance. Discusses the different types of billboarding
and the math behind it.
Deliverables – source code for tutorial 13

14. Tutorial 14 – Point Sprites – Covers point sprite functionality
and limitations with the G1.
Deliverables – source code for tutorial 14

15. Tutorial 15 – Particle Engine Using Triangle Strips –
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=19
Deliverables – source code for tutorial 15

16. Tutorial 16 – Bounding Geometry / Basic Collision Detection /
Picking –
Deliverables – source code for tutorial 16

This tutorial will cover basic bounding geometry including AABB, OBB,
Sphere, Cylinder, Plane geometry primitives and collision detection
between the various types and finally a picking example.

17. Tutorial 17 – Advanced Picking w/ Touch Screen Interaction – The
orientation of 3D objects on screen are not coordinated with touch
screen interactions. This tutorial discusses how to find the
orientation of a 3D object and adjust picking accordingly.

Deliverables – source code for tutorial 17

18. Tutorial 18 – Frustum Culling – Discusses how to create a frustum
which defines the viewing area. Tricks are necessary to complete this
with Android / G1. Once a frustum is defined the first level of
culling optimization is to remove objects that are not within the
frustum.

19. Tutorial 19 – Vertex Buffer Objects – http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=45

Defines the fastest way to render vertex data.
Deliverables – source code for tutorial 19

20. Tutorial 20 – Time based state management / animation – This
tutorial discusses animation and the importance to base all animation
on time.

Deliverables – source code for tutorial 20


Section 4: Quake 1 Java Source Port – A demo APK will be available on
the market.
-----------------------------------------------

1. Historical background on Quake 1 – Discusses the state of computer
graphics / OpenGL in 1999 when the Q1 source was released.

2. Q1 level loader – Discusses the data structures and loading process
to read in Q1 data

3. Q1 level rendering – Discusses rendering a Q1 level including
applications of frustum culling, state sorting, and other pertinent
optimization techniques including how BSP trees play a major role in
culling out unseen surfaces.

4. Q1 model loading / rendering / animation – Discusses rendering a Q1
model and animation capabilities possible

5. Q1 collision detection – BSP trees are used in both rendering
optimization and collision detection. This tutorial will cover how to
do collision detection with BSP trees and the bounding geometry
primitives

6. Basic player movements – Running, jumping, stair climbing,
strafing in 3D and the necessity to do smoothing of trackball input to
accomplish circle staffing.

Further topics TBD

Taylor Wimberly

unread,
May 5, 2009, 12:18:08 AM5/5/09
to android-bounty-...@googlegroups.com

Mike looks like a great outline. Is it ok for me to share this info on the site to get more feedback?

Sent from my G1 - http://androidandme.com

nEx.Software

unread,
May 5, 2009, 12:31:43 AM5/5/09
to android-bounty-...@googlegroups.com
Wow, ambitious. Looking forward to seeing these tutorials. I had tried to go through the NeHe tutorials but got lost in the c++.

Michael Leahy (Tactel US)

unread,
May 5, 2009, 12:36:05 AM5/5/09
to Android Bounty II Mobile Quake
On May 4, 9:18 pm, Taylor Wimberly <wim...@gmail.com> wrote:
> Mike looks like a great outline. Is it ok for me to share this info on the
> site to get more feedback?

Sure thing. I'm just posting the outline on AndDev.org and
JavaGaming.org also to get some feedback.

Clark Scheff

unread,
May 5, 2009, 2:16:39 AM5/5/09
to android-bounty-...@googlegroups.com
Sweet, I think I know where my area of expertise can be.  Don't get me wrong, Java is a great language and has its uses, and I do use it when it is easy and gets the job done, but.....  I'm a C/C++ guy at heart.  Oh, and some assembly, but that's just because I do embedded design during the day.  If we go the route of implementing this all in Java, which I think we should so it can work on many Android devices, then I guess there will be some of the original code to be translated over.  I'm willing and able to add my time to that, as well as some of the OpenGL stuff.  Too bad no shaders, I liked writing vertex and pixel shaders in school.


~Clark
--
.-=8{ Clark }8=-.
Check out Team Rico Suave's Site for updates on our new game "Blockbuster 3D"
http://public.csusm.edu/schef001/ricosuave/

Michael Leahy (Tactel US)

unread,
May 5, 2009, 3:15:13 AM5/5/09
to Android Bounty II Mobile Quake
Right on.. There actually will be a bit of work to do porting the game
content/logic and making all of the setup, menus, in game console,
game play and many more features of a total Java source Q1 port beyond
the level / model loader and renderer which for now is probably the
extent of my involvement though given more resources through Tactel I
can also greatly contribute on making the networking code speedy and
other tasks mentioned above. However having a fast Java level/model
renderer is the bulk of what will determine FPS and the like.

As things I have a lot of original Java source code for a Q3 class
engine already running, so modifying parts of it to load Q1 data won't
be too hard I imagine. I'll talk to the folks at Tactel in regards to
releasing my source efforts as LGPL, BSD, or MIT license, so folks can
use it at their own risk in their own games and then deal with iD on
their own regarding any conflicts.

MarcusMaximus

unread,
May 5, 2009, 12:18:04 PM5/5/09
to Android Bounty II Mobile Quake
Ditto on that, you almost perfectly described my background. I was
actually worried about shaders being necessary though since there
aren't any phones whose graphics chips support them (AFAIK)

On May 4, 11:16 pm, Clark Scheff <clarkd...@gmail.com> wrote:
> Sweet, I think I know where my area of expertise can be.  Don't get me
> wrong, Java is a great language and has its uses, and I do use it when it is
> easy and gets the job done, but.....  I'm a C/C++ guy at heart.  Oh, and
> some assembly, but that's just because I do embedded design during the day.
> If we go the route of implementing this all in Java, which I think we should
> so it can work on many Android devices, then I guess there will be some of
> the original code to be translated over.  I'm willing and able to add my
> time to that, as well as some of the OpenGL stuff.  Too bad no shaders, I
> liked writing vertex and pixel shaders in school.
>
> ~Clark
>
> On Mon, May 4, 2009 at 9:31 PM, nEx.Software
> <email.nex.softw...@gmail.com>wrote:
>
> > Wow, ambitious. Looking forward to seeing these tutorials. I had tried to
> > go through the NeHe tutorials but got lost in the c++.
>
> > On Mon, May 4, 2009 at 9:18 PM, Taylor Wimberly <wim...@gmail.com> wrote:
>
> >> Mike looks like a great outline. Is it ok for me to share this info on the
> >> site to get more feedback?
>
> >> Sent from my G1 -http://androidandme.com
>
> >> On May 4, 2009 11:07 PM, "Michael Leahy (Tactel US)" <
> ...
>
> read more »

Michael Leahy (Tactel US)

unread,
May 5, 2009, 3:14:08 PM5/5/09
to Android Bounty II Mobile Quake
On May 5, 9:18 am, MarcusMaximus <MarcusMaximu...@gmail.com> wrote:
> Ditto on that, you almost perfectly described my background. I was
> actually worried about shaders being necessary though since there
> aren't any phones whose graphics chips support them (AFAIK)

Things are in the clear and not until Doom 3 / "id tech 4" are
hardware shaders used.

On the near horizon though OpenGL ES 2.0 supports shaders and in fact
removes fixed pipeline functionality all together, so it is mandatory
to use shaders in place of the fixed function transformation and
fragment pipeline and this will be a large change for folks just
learning and used to OpenGL ES 1.X. Hint hint.. more tutorials. There
are SoCs out now and coming out soon that Android already runs on
including the TI OMAP 3 and NVidia Tegra that support OpenGL ES 2.0. I
have the hots for the OMAP 3...

http://www.youtube.com/watch?v=24TXpqa9jG0&feature=related

Netbooks such as this one will run the OMAP 3 (http://
www.alwaysinnovating.com/touchbook/) and you can get a Beagle Board
(http://beagleboard.org/) and run Android on both.

I'm just curious how Google is going to manage the switch / exposure
of OpenGL ES 2.0 API in Android cause really that should be addressed
right now as there are SoCs outside of the G1 / "G2" that have Android
ported to it. I have a feeling OpenGL 2.0 will be stifled/overlooked
until the Android 2.0 API which may be 6 months+ out. Lets just hope
that is the max wait.

wimbet

unread,
May 8, 2009, 4:44:08 PM5/8/09
to Android Bounty II Mobile Quake
Michael, I saw you say you were trying to finish before Google I/O.
Does that mean you plan on attending? I just registered today so
maybe I'll see you there.

Also, I'm about to publish a story on your OpenGL ES tuts. Any more
information about where you plan to host them?

On May 5, 2:14 pm, "Michael Leahy (Tactel US)"
<michael.le...@tactelus.com> wrote:
> On May 5, 9:18 am, MarcusMaximus <MarcusMaximu...@gmail.com> wrote:
>
> > Ditto on that, you almost perfectly described my background. I was
> > actually worried about shaders being necessary though since there
> > aren't any phones whose graphics chips support them (AFAIK)
>
> Things are in the clear and not until Doom 3 / "id tech 4" are
> hardware shaders used.
>
> On the near horizon though OpenGL ES 2.0 supports shaders and in fact
> removes fixed pipeline functionality all together, so it is mandatory
> to use shaders in place of the fixed function transformation and
> fragment pipeline and this will be a large change for folks just
> learning and used to OpenGL ES 1.X. Hint hint.. more tutorials. There
> are SoCs out now and coming out soon that Android already runs on
> including the TI OMAP 3 and NVidia Tegra that support OpenGL ES 2.0. I
> have the hots for the OMAP 3...
>
> http://www.youtube.com/watch?v=24TXpqa9jG0&feature=related
>
> Netbooks such as this one will run the OMAP 3 (http://www.alwaysinnovating.com/touchbook/) and you can get a Beagle Board

Michael Leahy (Tactel US)

unread,
May 9, 2009, 5:54:32 PM5/9/09
to Android Bounty II Mobile Quake
Yeah... I actually have my (EGR) live/work studio facility 3 blocks
from Moscone in SF, so I'll be there. We're (the folks @ Tactel)
thinking of getting a bunch of color fliers to distribute for the
tutorial site with an "FPS theme" at Google I/O and JavaOne and this
will lead folks here to the Quake bounty.. :) Let's definitely grab
lunch or/and a beer during I/O. If more folks happen to be there that
are interested in the Quake bounty perhaps an impromptu meetup could
be fun.

We have a location for the tutorials and I'm jamming on getting the
site up. We probably would rather not give out the site address yet as
I'd like to do a little dry run testing with a smaller group of folks
(folks here and perhaps the JavaGaming community) first before
blasting it out there. There is an htaccess password on it until the
site goes live and that can be a turnoff for folks passing by trying
to bookmark. Perhaps let folks know to bookmark the blog post and by
Google I/O info will be updated in the blog post you make on the
location. I'll also be glad to accept suggestions and communicate by
blog comments. We're using UserVoice on the tutorial site to allow
folks to suggest and vote on new tutorial content.

Definitely let folks know that the tutorial site will be for beginners
to more advanced devs even those interested in porting iPhone apps et
al to Android. The idea is to take folks from first plugging in an
Android device to develop with through to the Q1 class engine.
Reply all
Reply to author
Forward
0 new messages