opengl-es

How to Render text to bitmap and draw it

谁说胖子不能爱 提交于 2019-12-12 15:23:18
问题 I am new to android, and my group is currently creating a graphing application using a GlSurfaceView using opengl es 2.0. We have recently displayed the grid and tickmarks on the plot and now I have been assigned the task to implement a numeric scale and labeling the x and y axis as "X" and "Y". After doing a lot of research I have determined to accomplish this by rendering a string of characters to a bitmap. I have encountered many problems in achieving this. I understand the basic concept.

Does Google MapView in Android use OpenGL?

亡梦爱人 提交于 2019-12-12 15:04:35
问题 Does Google MapView in Android use OpenGL? 回答1: No, it does not, as far as I can ascertain. As a side bit of interest, the original google maps was written in C++, but the mobile version was written in Java and intended to run on any phone and platform combination. However, Android graphics gives you OpenGL capabilities for 2d and 3d graphics, which in theory you could combine with it as an overlay. http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView

Cannot load progressive jpeg images in libgdx

久未见 提交于 2019-12-12 14:07:46
问题 Here's my source package com.effect.bio; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Mesh; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.maps.tiled.TiledMap; import com.badlogic.gdx.maps.tiled

Optimizing performance of a heavy fragment shader

青春壹個敷衍的年華 提交于 2019-12-12 14:06:16
问题 I need help optimizing the following set of shaders: Vertex: precision mediump float; uniform vec2 rubyTextureSize; attribute vec4 vPosition; attribute vec2 a_TexCoordinate; varying vec2 tc; void main() { gl_Position = vPosition; tc = a_TexCoordinate; } Fragment: precision mediump float; /* Uniforms - rubyTexture: texture sampler - rubyTextureSize: size of the texture before rendering */ uniform sampler2D rubyTexture; uniform vec2 rubyTextureSize; uniform vec2 rubyTextureFract; /* Varying

XML FrameLayout has lowered my OpenGL SurfaceView framerate (fps)

☆樱花仙子☆ 提交于 2019-12-12 13:07:21
问题 I have extended the GLSurfaceView and implemented my own GLSurfaceView.Renderer to create my first relatively simple 2D OpenGLES game for android. I have been testing my game using the following code on the activities onCreate method which sets the surface view as the content view, from which I have obtained a constant 60fps. 60fps activity : mGLView = new OpenGLTest1SurfaceView(this); setContentView(mGLView); However now I have moved to an XML layout so I can place an admob overlay in the

Binding a second vertex buffer seems to spoil my first vertex buffer, OpenGL OES ios 5.1

♀尐吖头ヾ 提交于 2019-12-12 11:22:04
问题 I'm creating two different vertex buffers, that use two different shaders to render them . As soon as I bind the second vertex buffer, the data I parked in the first vertex buffer seems to be corrupted or lost. If I generate and draw one vertex buffer only, like so: glGenBuffers( 1, &vb1 ) ; glBindBuffer( GL_ARRAY_BUFFER, vb1 ) ; // fill it.. glBufferData( .. ) Then, in the draw() loop, glUseProgram( shader1 ) ; glBindBuffer( vb1 ) ; // make sure it is bound glDrawArrays( ... ) // draw it

iOS: transforming a view into cylindrical shape

折月煮酒 提交于 2019-12-12 11:16:39
问题 With Quartz 2D we can transform our views on the x , y and z axis. In some cases we could even make them look 3D by changing the values of the matrixes. I was wondering if it could be possible to transform a view into a cylinder shape like in the following picture? Please ignore the top part of the cylinder. I am more curious to know whether it would be possible warping an UIView around like the side of the cylinder as in the image. Is that possible only making use of Quartz 2D, layers and

How to change the Center-of-Rotation in OpenGL

喜欢而已 提交于 2019-12-12 11:14:43
问题 I have a 3D Model (OpenGL ES 1.1 iPhone SDK v3.0) that is somewhat complex ( i.e. Thousands of Vertexes and Faces ) and I'd like to rotate this model around the Y-axis at or near the center of the Model. The problem is that glRotate rotates my model around a point at/near the center of one of its bottom edges , NOT near the center of the Model . Imagine a car driving very tight circles around a light-post, and that is basically what I've got. I want the car to be impaled on the light-post and

Android OpenGLRenderer “Dirty” error

白昼怎懂夜的黑 提交于 2019-12-12 11:10:09
问题 While programming an Android wear application I ran into the following log message(Well, 15 of them in a row): ... W/OpenGLRenderer: Dirty 145.00 306.00 175.00 320.00 doesn't intersect with 0 0 320 290 ? (The question mark is part of the log message) I am not explicitly using OpenGl in my application, this error is generated when a fragment with an animated custom view is swiped to in a GridViewPager. Whether or not this appears depends on the device, this does not occur on an Android

How do you implement glOrtho for opengles 2.0? With or without tx,ty,tz values from the glOrtho spec?

怎甘沉沦 提交于 2019-12-12 11:07:43
问题 Im trying to implement my own glOtho function from the opengles docs http://www.khronos.org/opengles/documentation/opengles1_0/html/glOrtho.html to modify a Projection matrix in my vertex shader. It's currently not working properly as I see my simple triangles vertices out of place. Can you please check the code below and see if i'm doing things wrong. I've tried setting tx,ty and tz to 0 and that seems to make it render properly. Any ideas why would this be so? void ES2Renderer::_applyOrtho