3. PC/DIRECTX 11 TO OPENGL ES2
• Vertex and Pixel Shaders are unified objects
- Thank goodness this will be fixed in OpenGL ES 3
• Shaders need precision qualifiers
- Most of the time “precision mediump float” does the job
- DirectX 11 is “precision highp float” everywhere but the performance on mobile devices suffer
dramatically from this
- Terrain shader textcoords need high precision.
- For high you need GL_OES_fragment_precison_high
• Depth textures require GL_OES_depth_texture
4. WHAT WAS KEPT AND WHAT WAS CUT?
• No Shadow Maps
• No Normal or Specular Maps
• Yes Terrain Shader
• Yes Post Processing Effects
• No SSAO though
• Yes Unique shaders everywhere
5. WHAT RB DOES?
• No “Start Benchmark” SORRY!
• Change features, restart !
• Change resolution for direct device comparisons
• Fastest GPU out there : Mali-400
• Most feature rich GPU out there : Adreno
6. Thank you for your attention!
Contact • cippyboy@gmail.com
• http://www.facebook.com/relativegames
Download it from • bit.ly/VG6uiE
Google Play
Notas do Editor
My name is CiprianStanciu, or just Chip for short. Today I will present to you Relative Benchmark.You can get the demo and visit our facebook page for updates & stuff.
It all started in 2011 when I was developing my third generation engine. This was and still is hobby work so I didn’t had any deadline for it, just a goal, to make a modern game engine with which to potentially foster a game.After I became an app developer I noticed that there aren’t too many graphic intensive benchmarks. The most widely known app is still doing lightmapping and its most complex feature is skinned animations. It had no post processing effects and looked like it’s based on OpenGL 1.1 .So I decided to port my DirectX 11 engine to mobile platforms under OpenGL ES 2.
So I had to port from DirectX 11 to OpenGL ES 2While initially thinking I will just need to port shaders from HLSL to GLSL things are a bit more complicated than that.First, I needed an extra step to link vertex shaders with pixels shaders into GL2s unified shader programs.Then, you need to define precision qualifiers. Vertex shaders have medium precision by default. Pixel shaders work pretty well with medium precision but sometimes you need high precision. The terrain shader in RE3B needs high precision because of the texture repeats per each layer of texture (somewhere between 50 and 300). However, in order to get high precision your GPU needs GL_OES_fragment_precision_highwhich is not exactly available to all android devices out there.Depth textures are also optional features in OpenGL ES 2. It is required to have the GL_OES_depth_texure extension to have them supported. Depth textures are required for effects such as Depth of field, Screen Space Ambient Occlusion or Shadow Maps.
Evidently, the mobile version doesn’t look quite like the PC/DirectX version because of the low performance. You might think the mobile chips are getting closer in performance to the desktop chips but that isn’t the case yet.The first feature withdrawn was the shadow maps. Having to render all the polygons twice (aprox 300 000 in the scene) seemed like an overkill for a mobile GPU.No normal or specular maps. Having to require another 6 floats per vertex (for TBN matrix) would double the required bandwidth, and then sampling 2 more textures in the pixel shader would triple the pixel shader operations. A definite performance hog.The Terrain shader was kept as mobile GPUs seem to be moderately efficient at sampling more than one texture at a time, and because it covered such a large surface, the scene would feel too empty without it.The Post processing effects were kept because they are the unique factors of this benchmark. I am yet to see another mobile benchmark or game use post processing features like High Dynamic Range, Bloom or Depth of Field, however, the Screen Space Ambient Occlusion was removed as it reduced performance to 1/6, pretty heavy .The unique shader generation for each surface was also kept as GL ES 2 is quite capable of compiling shaders relatively fast. Each material in the scene has a few variable properties like Blending, alpha testing, different material colors that require a shader to be compiled specifically for it.Some shaders have reduced complexity to achieve higher framerates like the blur on the bloom and depth of field effect.
- Since it started as a tech demo, it doesn’t quite present a screen to start the bechmark for a specific resolution. I should have probably done that, I know, I’m sorry .Being a tech demo initially, it starts off with a cinematic animation and records the framerateAfter the animation is done, it calculates an average framerate based on the total frames rendered. This framerateofcourse depends on the features you have enabled. If you want to have some in depth tests with certain features on I recommend you restart the animation after you change the features and let it complete.You can also change resolution to match a specific device’s resolution. If you’re wondering how that’s done, the scene is rendered into an offscreen render target, and then all effects are calculated relative to that specific resolution and in the final step, a full screen quad is drawn with it so that it stretches along your screen.From some tests I made, Mali-400 seems to be the fastest GPU on Android systems, while the Adrenofamilty is the most feature rich family of devices. You might wonder if Mali is missing something, well, on some devices (may have something to do with the manufacturer) it misses the high precision on pixel shaders.Also, if you compare 2 devices, check if the terrain texture is nice and smooth in the opening. If it isn’t, it means the device doesn’t support high precision in pixel shaders so it basically doing less operations than devices that do.