Professional Documents
Culture Documents
Graphics, Audio, Sensor: Tips For Game Development
Graphics, Audio, Sensor: Tips For Game Development
Graphics, Audio, Sensor: Tips For Game Development
Contents
Games in bada Audio tips Sensor tips 3D rendering tips Summary
Games in bada
Many games in Appstore
Videos or live demos
Sensors
Weather
Graphics
Vibration
Audio
Audio tips
Player AudioOut
Player
Step 1: Create a Player instance
pPlayer = new Player; pPlayer->Construct(*pListener); // IPlayerEventListener
AudioOut
Step 1: Create an AudioOut instance
pAO = new AudioOut(); pAO->Construct(*pListener);// IAudioOutEventListener //Prepares the audio output device pAO->Prepare(AUDIO_TYPE_PCM_S16_LE, AUDIO_CHANNEL_TYPE_MONO, SAMPLERATE);
AudioOut
Step 4: Process events
void EventListener::OnAudioOutBufferEndReached (Osp::Media::AudioOut &src) { //Write Next PCM data }
Audio tips
Preferred PCM format Double buffering Sound mixing Handled by platform Handled by application
10
Audio tips
Preferred PCM format Double buffering Sound mixing Handled by platform Handled by application
Event: Buffer End Reached Buffer1 Buffer2 Buffer3 Step 1. Initialize AudioOut Step 2. Write a buffer two times Step 3. Start playback Step 4. Playback is ended Step 5. Event is fired Buffer2 is used by AudioOut
Reduce latency
AudioOut Device
Application
Audio tips
Preferred PCM format Double buffering Sound mixing Handled by platform Handled by application
Sound mixing by application reduces the internal resource and event processing
12
Audio tips
Preferred PCM format Double buffering Sound mixing Handled by platform Handled by application
Incoming call
Player and AudioOut are stopped by the platform** The application should resume them***
* Osp::System::DeviceManager ** IAudioOutEventListener::OnAudioOutInterrupted *** IAudioOutEventListener::OnAudioOutRelased
13
Audio tips
Preferred PCM format Double buffering Sound mixing Handled by platform Handled by application
Silent mode
No event is fired Check the silent mode*
Sensor tips
Sensor
Sensors
Type Acceleration sensor Proximity sensor Tilt sensor Properties x, y, z 1 (on) or 0 (off) Azimuth, Pitch, Roll
SensorManager
Manages built-in sensors Polls sensors for data and delivers it to applications at specified intervals.
16
Multi-touch
The number of points depends on the hardware
18
Multi-touch
Step 1: Enable multi-touch
Touch touch; touch.SetMultipointEnabled(*this, true);
19
3D rendering tips
3D rendering in bada
bada supports
OpenGL ES 1.1/2.0
1.1 Fixed function hardware 2.0 Fully programmable 3D graphics
EGL
Manages contexts and drawing surfaces
21
3D rendering in bada
Timer-based rendering loop
Step 1: Create a timer
pTimer= new Timer; pTimer->Construct(*this); pTimer->Start(TIME_OUT);
3D rendering in bada
Initialize EGL
bool GlesCube11::InitEGL() { EGLint numConfigs = 1; EGLint eglConfigList[] = {/**/}; EGLint eglContextList[] = {/**/}; eglBindAPI(EGL_OPENGL_ES_API); eglDisplay = eglGetDisplay( (EGLNativeDisplayType)EGL_DEFAULT_DISPLAY); eglInitialize(eglDisplay, null, null); eglChooseConfig(eglDisplay, eglConfigList, &eglConfig, 1, &numConfigs); eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, (EGLNativeWindowType)pForm, null); ... }
23
3D rendering in bada
Checks OpenGLES version of device
void Test1::CheckGLES(void) { String key(L"OpenGLESVersion"); String GLESVersion; SystemInfo::GetValue(key,GLESVersion); AppLog("%ls", GLESVersion.GetPointer()); }
Result string
Device Wave/Wave II Wave525
24
Result 1.1/2.0
3D accelerator of Wave/Wave II
POWERVR SGX
Unified Shader Architecture
Load balancing Mostly identical capabilities of shaders
25
3D accelerator of Wave/Wave II
Related resources
Visit http://www.imgtec.com
26
Geometry
Represents 3D object using geometric entities such as triangles, lines, and so on
Shader
Program to add special effects to 3D rendering
27
Texture tips
Use texture atlas Use mipmap Load all textures on loading time Use FBO instead of pbuffer
28
Texture tips
Use texture atlas Use mipmap Load all textures on loading time Use FBO instead of pbuffer
Texture tips
Use texture atlas Use mipmap Load all textures on loading time Use FBO instead of pbuffer
30
Texture tips
Use texture atlas Use mipmap Load all textures on loading time Use FBO instead of pbuffer
Geometry tips
Simplify geometry Order 3D geometry optimally Use VBO if possible Use object culling
4M triangles
500 triangles
32
Geometry tips
Simplify geometry Order 3D geometry optimally Use VBO if possible Use object culling
V0
V6 V2
V4
Geometry tips
Simplify geometry Order 3D geometry optimally Use VBO if possible Use object culling
Geometry tips
Simplify geometry Order 3D geometry optimally Use VBO if possible Use object culling
Viewpoint View Frustum
Improve speed
35
Geometry tips
Simplify geometry Order 3D geometry optimally Use VBO if possible Use object culling
Viewpoint View Frustum
Improve speed
36
Shader tips
Prefer vertex shader to fragment shader Choose the appropriate precision Vector and scalar operation Avoid discard operation
Pixel Operations
Rendering pipeline
Evaluator
Vertex shader Rasterizati on Fragment shader Frame Buffer
Texture Memory
Shader tips
Prefer vertex shader to fragment shader Choose the appropriate precision Vector and scalar operation Avoid discard operation
Consider the tradeoff between speed and quality highp: 32-bit Midiump: 16-bit
Reduce the storage space Texture coordinate
Lowp : 10-bit
Color, normal..
38
Shader tips
Prefer vertex shader to fragment shader Choose the appropriate precision Vector and scalar operation Avoid discard operation
39
Shader tips
Prefer vertex shader to fragment shader Choose the appropriate precision Vector and scalar operation Avoid discard operation
discard
40
Summary
Games in bada
42
Weve learned..
Audio tips
Sensor tips
3D rendering tips
Texture Geometry Shader
bada games
43
POWERVR SDK
SGX 3D Application Recommendations
44
Thank you.