opengl-es

Does OpenGL ES 2.0 require a shader for any vertex rendering?

孤者浪人 提交于 2019-12-11 03:19:19
问题 GL10 class has glVertexPointer method. GLES20 does not have this method, but has glVertexAttribPointer . Does this mean that OpenGL ES 2.0 requires a having shader for rendering vertices? 回答1: Yes, you need to create a vertex shader to handle the transformations, and a fragment shader that assigns the final color to a fragment (using texture sampling for example). The whole fixed-function pipeline has been removed in OpenGL-ES 2.0. 来源: https://stackoverflow.com/questions/5590335/does-opengl

Bitmap too large to be uploaded into a texture

北战南征 提交于 2019-12-11 03:17:58
问题 When I trying to render a bitmap in imageview mImageView.setImageBitmap(mBitmap); I would see Bitmap too large to be uploaded into a texture in log. Ok, I know there is limit on OpenGl that would throw this warning message. But can I know whether the image is rendered success or not? 回答1: You should check maximum texture size by getting value of GL_MAX_TEXTURE_SIZE environment value. You can review this value for various Android devices on site of GLBEnchmark: http://www.glbenchmark.com

iPhone OpenGLES 2.0 Text Texture w/ strange border (not stroke) issue

▼魔方 西西 提交于 2019-12-11 03:17:51
问题 I'm using the CoreGraphcis to create a text texture. Unfortunately the text renders like this (Text color is same as background to demonstrate the strange border). I've tried playing with stroke colors and borders to I think it is do to OpenGLES 2.0 and not CoreGraphics. // Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer glGenFramebuffers(1, &defaultFramebuffer); glGenRenderbuffers(1, &colorRenderbuffer); glBindFramebuffer(GL

Can't link compiled shaders to program OpenGL ES 2.0 Android

左心房为你撑大大i 提交于 2019-12-11 03:14:39
问题 I have a problem with linking shaders to program in OpenGL ES 2.0. Here's my code package pl.projekcik; import android.content.Context; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.util.logging.Logger; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import util.LoggerConfig; import util.ShaderHelper; import util.TextResourceReader; import static android.opengl

Clearing/releasing OpenGL ES buffers

不打扰是莪最后的温柔 提交于 2019-12-11 03:09:44
问题 I'm creating an extra framebuffer and renderbuffer for offscreen rendering in my OpenGL ES 1.1 iOS app. When I render into the additional renderbuffer I start to see memory warnings in the XCode console. What is the proper way to "release", "clear" etc these additional buffers? I experimented with glClear(GL_COLOR_BUFFER_BIT) but the memory warnings continued. Commenting out the rendering code causes the warnings to go away. 回答1: I don't know what you mean, glClear clears the content of the

glMapBufferRange returning all zeros in Android

房东的猫 提交于 2019-12-11 03:09:02
问题 I am having trouble reading out from a buffer mapped with glMapBufferRange If I simply put some data in a buffer // Create input VBO and vertex format int bufferLength = 5 * 4; //5 floats 4 bytes each FloatBuffer data = ByteBuffer.allocateDirect(bufferLength) .order(ByteOrder.nativeOrder()).asFloatBuffer(); float[] floatData = { 1.0f, 4.0f, 9.0f, 16.0f, 25.0f }; data.put(floatData).position(0); Generate a Array Buffer in GL and fill it with the data int[] vbo = new int[1]; GLES30.glGenBuffers

How to execute 2 passes for a blur effect in openGL ES 2.0

假装没事ソ 提交于 2019-12-11 03:06:14
问题 In order to create a blur effect the theory says to create 2 vertex shaders, one for the horizontal pass, and the second for the vertical pass. And then one fragment shader for actual sampling. My question is, how to actually to execute the 2 vertex shaders? Do I need to render, then get back the pixels via the glReadPixels and then to render again? My environment is Android, OpenGL ES 2.0 Thanks 回答1: You can render the first pass to an FBO, and then use the resulting texture when rendering

OpenGL ES 2.0 Vertex Shader Texture Reads not possible from FBO?

為{幸葍}努か 提交于 2019-12-11 02:59:51
问题 I'm currently working on a GPGPU project that uses OpenGL ES 2.0. I have a rendering pipeline that uses framebuffer objects (FBOs) as targets, i.e. the result of each rendering pass is saved in a texture which is attached to an FBO. So far, this works when using fragment shaders. For example I have to following rendering pipeline: Preprocessing (downscaling, grayscale conversion) -> Adaptive Thresholding Pass 1 -> Adapt. Thresh. Pass 2 -> Copy back to CPU However, I wanted to extend this

OpenGL ES 2.0 / MonoTouch: Texture is colorized red

☆樱花仙子☆ 提交于 2019-12-11 02:57:40
问题 I'm currently loading a cube-map into my application but it's shown in a red tone. Edit: The channel problem is also present when using 2D-Textures, it seems the channels are not in the correct order. Is there any way to change the order of the channels using the iOS methods? That's the code for texture loading: public TextureCube (Generic3DView device, UIImage right, UIImage left, UIImage top, UIImage bottom, UIImage front, UIImage back) : base(device) { _Device = device; GL.GenTextures (1,

Updating only a horizontal subregion of a texture in OpenGL ES 2.0

我的未来我决定 提交于 2019-12-11 02:54:46
问题 This question is specific to OpenGL ES 2.0 on Android, but there may be work-arounds that use common GL functionality so I'm tagging this as "opengl". tl;dr: is there another way to specify glPixelStorei(GL_UNPACK_ROW_LENGTH) in OpenGL ES 2.0? Because according to the spec, the GL_UNPACK_ROW_LENGTH doesn't exist in OpenGL ES 2.0. I have a texture that I update frequently by calling glTexImage2D , from a fixed region of client memory that is being updated independently. In some cases I know