Tip:
Highlight text to annotate it
X
[MUSIC PLAYING]
TODD KERPELMAN: Hello and welcome to Game On!
Episode 4.
I am Todd Kerpelman.
I'm a developer advocate here on Play Games.
HAKURO MATSUDA: Hello.
My name is Hakuro Matsuda, Android developer advocate for
Game Technology.
TODD KERPELMAN: And today we're going to be talking
about OpenGL ES 3.0.
Before we get into that, let's jump into
some news and updates.
Not a whole lot, this time, in terms of news and updates.
Except that we've got more info on Cloud Save.
This guy, Tom Fitzgerald, who happens to be a googler,
emailed me earlier today and said, hey, I saw your show--
so we have at least one viewer.
Thanks, Tom.
--about Cloud Save.
And I went and added it into my own HTML5 game.
And he put up a YouTube video where he talks about the
process, shows you his code.
It's pretty quick.
It's all of about three and a half minutes.
But if you're at all interested in doing more with
Cloud Save, particularly in a web-based game, I encourage
you to check it out.
And I suppose this is something that's important to
point out, is Cloud Save, it's not just for mobile games.
It's also very useful in a browser-based game.
Local storage is very cool for HTML5.
But it does have the disadvantage that you,
basically, can't keep your storage between browsers or,
obviously, across different computers.
That's why it's called local storage.
And so, if you have to deal with a player that is either
playing on different browsers, or on different computers, or
on a tablet and a computer, again, look into Cloud Save.
And you can look into what this guy, Tom, has done in his
YouTube video.
So with that, let's get into the main subject of today's
talk and that is OpenGL ES 3.
Hakuro, you're an expert.
So I'll let you take it away.
HAKURO MATSUDA: OK.
So for today, I'd like to introduce you to new API
Android 4.3, OpenGL ES 3.
OpenGL ES 3 is a superset of existing OpenGL ES 2, so that
you can use your existing game code for OpenGL ES 2 without
any changes.
You can adopt some of the advanced features of OpenGL 3
and get benefit of them quite easy.
In ES 3, it supports multiple new features, which can be
categorized into three areas--
performance, quality, and flexibility.
For performance, ES 3 supports several advanced features such
as the transform feedback, geometric instancing,
occlusion query, and multiple rendering target.
The transform feedback is quite useful feature to the
math in GPU side rather than CPU side.
You can update your vertex [? performed ?] project
entries directory based on the math done at GPU without
involving any CPU.
This is good for using the particle engine, or such as
the skinning done in GPU with multiple rendering
[? targets. ?]
Also, geometry instancing is a feature that can render
multiple instances of geometry with just one API call with
different parameters.
The feature is good for both CPU and GPU performance,
because you don't have to call API multiple times.
And also, GPU has hardware support to handle the same
efficiently.
For games that render the same object multiple times, you
should use that feature.
Other features, such as MRT, which can render to multiple
renderable files at the same time, and occlusion query,
which can check GPU if geometry is visible or not.
GL also great to reduce both CPU and GPU load dramatically.
Let's talk about quality side.
In ES 3 it supports ETC 2 as the standard texture
compression format.
ETC 2 supports the alpha channel and produces better
quality for bit part channel, which is quite smaller than
regular texture format.
It replaces ETC 1 and various other GPU dependent
formats, like DXT.
So that you can finally use one single texture compression
format in your games with GL ES 3.
Also, as an optional feature, you can have ASTC, Adaptive
Scalable Texture Compression format, texture format, that
is much more advanced and better quality texture format.
ASTC is supported in some GPUs such as Mali GPU.
ES 3 also supports floating point textures so that you can
do real High Dynamic Range rendering video games,
not the fake HDR.
For flexibility side, it supports features like
non-power-of-two textures so that you can have [INAUDIBLE]
dimension of the textures, not limited to the
power-of-two size.
And it's supports more than the target format and the
texture format, as well.
Also, you can attach depth for the texture.
In ES 3, shading language is also updated to GLSL ES 3.0,
which support integer and has new language features.
So in general, ES 3 supports comparable features of the
desktop version of OpenGL 3.1 or DirectX 10, except support
of geometry shader which can produce more triangles after
vertex shader stage.
So that with GL ES 3 you can port your games quite easy to
mobile port form.
In performance wise, mobile GPUs with GL ES 3 support has
comparable performance range of low or middle range desktop
GPU, which is quite surprising for me, because mobile GPU
works on 1/10 low-energy usage.
Currently, SDK 18 and NDK R9, both supports GL ES 3.
And all of Nexus 4, 7, 10 supports GL ES 3.
Please try new feature set of GL ES 3, and enjoy them.
TODD KERPELMAN: Well, cool.
That all sounds very exciting to--
HAKURO MATSUDA: Yes.
TODD KERPELMAN: --somebody that likes good
graphics in my games.
I wanted to ask about when you talked about some of the
performance improvement.
So geometry instancing, I think I understand.
Like if I had 15 cars in my game that all were essentially
the same, I would essentially only define one car model--
HAKURO MATSUDA: Yes.
TODD KERPELMAN: --and kind of save on a whole lot of
geometry passing by saying, just reuse this car model in
multiple places.
HAKURO MATSUDA: In GL ES 2, you had to code the API 15
times in this example, but with GL ES 3, you can render
15 cars at one single API code.
TODD KERPELMAN: That's cool.
HAKURO MATSUDA: Yeah, in Android, basically, API code,
it's not quite cheap, so that it's a great performance
[INAUDIBLE].
TODD KERPELMAN: Gotcha.
Now, could I have different textures or different colors
on top of these cars and still take advantage?
HAKURO MATSUDA: Yes, exactly.
So you can have different parameters, like transform
texture UVs, and any other parameter can be different by
model instance.
TODD KERPELMAN: Gotcha.
So I feel like at one point there was a lot of games that
featured crowd scenes where, all of a sudden, they were
drawing a lot of people.
They're basically taking advantage of this technique,
and putting different skins on the same model so that you get
the impression of a lot of people.
HAKURO MATSUDA: Exactly.
TODD KERPELMAN: OK.
Well, that's very clever.
I still don't quite understand what transform feedbacks are.
Is that something you can explain further, or is that
really just like--
HAKURO MATSUDA: Yes.
So in general, in ES 2, the transform or GPU method is
just one way.
So CPU issues a render command.
And the GPU does some work and render it.
That was it.
But in OpenGL ES 3, you can [? feed back ?]
the output math of the GPU into the buffer again, so that
you can update the geometry skin or you can update
particle position inside GPU and right back to the buffer.
So that in each way you can do the math
completely in the GPU side.
TODD KERPELMAN: Oh, OK.
That's starting to make more sense to me.
So would that work if I had to, say, perform the same kind
of transform in-scale to multiple objects?
Could I take advantage of that feature there?
HAKURO MATSUDA: Exactly.
TODD KERPELMAN: OK.
And MRT, Multiple Render Targets, is that like the
feature where I can--
sometimes in the background you might see a TV that's
showing what's going on in my game?
Is that that technique or--
HAKURO MATSUDA: Oh, well, it's mainly for the multiple paths.
In GL ES 2, to do the multiple path rendering effect, you had
to render the normal at this path, and the
color at this path.
And that's the final gathering path you need to fetch these,
then the result, that's the final gathering path.
But in the MRT you can output two different values in two
different target.
So that you don't have to draw same thing
twice, but just once.
And at the final gathering path before the rendering
path, you can get two result at the same time.
TODD KERPELMAN: Gotcha.
So what techniques would you see making use of MRT?
HAKURO MATSUDA: Well, we said, before the rendering
technique--
several parameters of objects into several buffers, and to
get that final path, you can get a great benefit through
MRT in terms of the performance.
TODD KERPELMAN: OK.
HAKURO MATSUDA: Yes.
TODD KERPELMAN: OK.
Well, let's see.
I think we have--
let's move on to a demo.
We've got a cool demo that was put together by the good folks
at Silicon Studio.
I guess this is--
I don't know if it has a name, except maybe "Rings and
Jewels," that we showed off at the Nexus 7 watch event, just
last month, that makes use of some fairly cool ES 3.0
techniques.
Let's bring this up.
This is recorded on a new Nexus 7 device that I think
Dan said I could keep after this session is done.
He's laughing, which I think means yes.
So we've got these very cool shiny rings.
And I can click this Add button, and add in a few
jewels, and they fall down and knock over the rings.
And it looks very cool.
HAKURO MATSUDA: Yeah, physics simulation in the CPU side.
It's really cool physics.
TODD KERPELMAN: Yeah, it's nice physics.
So what are we seeing here that's being done by GL ES 3?
HAKURO MATSUDA: Well, in GL ES 3 mode, they are using a
floating texture so that everything is rendered in the
high dynamic range.
TODD KERPELMAN: OK I've noticed there, there's a
switch here.
I can switch ES 3 on and off.
And I notice, when I turn it off, there's a
few things that happen.
One, you don't get the nice shine on the
rings like you do before.
You get a little bit of lens flare off the ring
reflections, and that goes away.
I've also noticed the table texture looks much blurrier.
What's happening there?
HAKURO MATSUDA: Right, so in the fake HDR mode, which is
with OpenGL ES 2, everything had to be in the range of the
0 to 255, which is 1 byte range.
But in OpenGL ES 3, it can have the float dynamic range
so that it can show more details on everything.
TODD KERPELMAN: Gotcha.
And so that's why, when I turn on the GL ES 3.0--
we need a cooler code name for that--
that's why the table suddenly looks so much more detailed,
is we're able to suddenly spend more--
basically more data per pixel on--
HAKURO MATSUDA: Right, precisely.
TODD KERPELMAN: OK.
I notice something also seems to be happening with the gems.
I'm not quite sure.
Is it somehow doing different type of refraction?
HAKURO MATSUDA: Mm-hmm.
TODD KERPELMAN: When I switch on and off ES 3.0, I notice
that there's something that I can't quite articulate with
the gems where they look much better with it on.
And I don't quite know what's going on there.
HAKURO MATSUDA: Basically, it's also thanks to the high
dynamic range.
So the edge of the jewels can be sharper and the friction
can be clearer in the GL ES 3.
TODD KERPELMAN: Gotcha.
All right, well cool.
I could play with this for a long time, but I won't because
we have other stuff to do in our show.
But excellent.
So let's see-- other Q&A. So in terms of what devices
support OpenGL ES 3, you had mentioned the Nexus 4,
the new Nexus 7.
HAKURO MATSUDA: Nexus 7, yes.
TODD KERPELMAN: And the Nexus 10.
Are there other devices out there?
How would I know if a device supports--
HAKURO MATSUDA: Well, in general, as of today, GPU from
Qualcomm, like Adreno 320 and 330 should
support the GL ES 3.
Also, GPU from ARM, Mali-T600, should support the GL ES 3.
TODD KERPELMAN: OK, well maybe that brings us
to our third question.
So if I'm a developer, and maybe I want to add in some of
this OpenGL ES 3 techniques to my game.
But at the same time, you actually want to support a
large range of devices, what do you do with your code to
make sure that you can still--
basically, to make sure that I can kind of have an engine
that looks really nice on the machines that support it, but
doesn't crash or something on the [INAUDIBLE].
HAKURO MATSUDA: Yeah, that's a great question.
TODD KERPELMAN: Thanks.
HAKURO MATSUDA: Yeah, so as of today, almost all of the
Android devices, like 99% of the devices, supports the
OpenGL ES 2.
But just a fraction of a percent supports the GL ES 3.
TODD KERPELMAN: That number will probably grow now that
we've announced it.
HAKURO MATSUDA: Yeah, in the future inevitably.
That's my hope.
But as of today, you need to have the two code per line for
GL ES 3, and another one for GL ES 2.
Also, you can check the existence of some OpenGL GPU
extension, so that you can, even with GL ES 2, you can
still utilize some of the advanced feature set available
for GL ES 3.
TODD KERPELMAN: So I might, for instance--
some hardware manufacturer might have a chipset that
officially supports GS 2, but might support one or two
features from the OpenGL ES 3?
HAKURO MATSUDA: Right.
TODD KERPELMAN: And so that's something that a developer
could check on a feature by feature basis?
HAKURO MATSUDA: Yeah, exactly.
So it sounds very complicated.
But it's kind of like PC gaming models.
So in the PC, you need to check all of the features
existing to utilize most out of GPU hardware, so that you
need to do the same thing in Android device.
TODD KERPELMAN: So yeah, it's really not much different than
what a lot of PC developers are already doing today.
HAKURO MATSUDA: Right.
TODD KERPELMAN: And maybe that brings us to our second
question, which is, I might decide, as a game developer,
this sounds like a lot of work.
Maybe I'll find an engine to do this for me.
Are there other engines out there that
support this already?
HAKURO MATSUDA: Yes, so many game engines, like Unity and
the Unreal engine already support GL ES 3 so that, for
me, GL ES 3 is really easy to use.
But for somebody, it might not, so that you can still use
a game engine to support the GL ES 3 advanced feature set.
TODD KERPELMAN: OK.
And I guess, actually, that might bring up--
good segue.
We do have one other demo, which is the Unity engine.
And I suppose maybe some of this really isn't so much
showing OpenGL ES 3 features so much as kind of showing how
nice things look on the Nexus 7.
But it sounds like they are probably doing a fair amount
of OpenGL ES 3 performance improvements.
HAKURO MATSUDA: Yeah, exactly.
TODD KERPELMAN: We're going to run this.
This is called "The Chase." And I noticed they are showing
a fair number of features going on here in terms of
atmospheric scattering, a four kilometer draw distance.
I think they talk about sub--
yeah.
HAKURO MATSUDA: Yes.
They are using a really high-polygon model.
And the entire scene, it's rendering more than 250,000
polygons in that scene, which is an incredibly high number
in terms of mobile gaming.
TODD KERPELMAN: Yeah, I mean, this looks
like a console game.
HAKURO MATSUDA: Yeah, exactly.
And also, they are using some advanced features [INAUDIBLE]
OpenGL ES 3 for performance improvement, mainly.
So that with ES 2 devices, the demo still works.
But with ES 3, it can utilize features like occlusion
coloring to check if a sign is visible in the scene.
And also, it's using geometry instanced rendering so that it
can benefit the performance of the GL ES 3 feature set.
TODD KERPELMAN: All right, well that's very cool.
My biggest complaint with this demo is, I can't figure out
who the good guy and who the bad guy is.
They both sort of look kind of sinister.
They are both shooting in amongst all the civilian
traffic, which really isn't all that safe.
Maybe neither one is actually the good guy.
HAKURO MATSUDA: Maybe.
TODD KERPELMAN: But I suppose that's a little off topic.
So awesome.
This looks great.
I can't wait to try out more games on this device that Dan
is letting me take home.
So thanks again, Dan.
And we'll bring up our final slide, which is, if you want
more information about OpenGL ES 3, this is basically our
OpenGL page on developer.android.com.
HAKURO MATSUDA: Yes, also we are releasing some more sample
code for [INAUDIBLE]
for OpenGL ES 3.
TODD KERPELMAN: That would be fantastic.
HAKURO MATSUDA: Yes.
TODD KERPELMAN: Awesome.
All right, well thank you very much for joining us.
HAKURO MATSUDA: Thank you.
TODD KERPELMAN: Thank you out there for joining us.
And we will see you in a couple weeks with our next
"Game On" session--
if we don't get cancelled.