opengl-es-2.0

Font rendering onto off-screen FBO not working. (Note: fonts are loaded by creating textures using Freetype lib with glTexImage2D)

人走茶凉 提交于 2020-05-16 06:31:51
问题 I have the following code to render a rectangle and few texts onto an offscreen FBO. And then I try to bind the texture (attached to FBO) in default/ display framebuffer. I am able to render the rectangle but the fonts are not getting rendered. I tried debugging, but so far could not. I have to do this in OpenGL ES 2.0 only. My rectangle is of orange color. The texts/fonts are of red color. I use Freetype lib and glTexImage2D call to create individual textures for each font. When I render

Attaching multiple textures to single FBO (and)multiple FBOs in OpenGL ES 2.0

孤人 提交于 2020-05-15 09:24:07
问题 Initially, I wanted to have 2 texture attachments to one FBO but I see in OpenGL ES 2.0 GL_COLOR_ATTACHMENTi is not supported (only GL_COLOR_ATTACHMENT0 is supported). But just to see what happens with 2 texture attachment with the same GL_COLOR_ATTACHMENT0, I could see only the second texture's content visible. Then I thought to have multiple FBOs with respective textures. But I still only see the 2nd texture (attached to 2nd FBO). GLuint fbo; glGenFramebuffers(1, &fbo); glBindFramebuffer(GL

OpenGL ES and OpenGL compatible shaders

心不动则不痛 提交于 2020-04-13 02:49:11
问题 I want to have same shader source for OpenGL ES and OpenGL (Windows). To do this I want to define custom data types and use only OpenGL ES functions. One approach is to define: #define highp #define mediump #define lowp for Windows shader and write the shader as it is for OpenGL ES. Other approach is to define custom data types like this for OpenGL ES: #define hvec2 highp vec2 and like this for Windows #define hvec2 vec2 What do you think is better? Do you have other solutions for this

Not working OpenGL ES shader, call glLinkProgram every frame?

时光总嘲笑我的痴心妄想 提交于 2020-03-25 19:07:26
问题 I'm trying to make transparent object in OpenGL ES 2.0. It's a live wallpaper, I'm using GLWallpaperService as a base class for this. I'm setting up OpenGL in this way: GLES20.glEnable(GLES20.GL_DEPTH_TEST); GLES20.glDepthFunc(GLES20.GL_GEQUAL); GLES20.glClearDepthf(0.0f); GLES20.glClearColor(0.0f, 0.0f, 1.0f, 1.0f); Shaders I use are taken from PowerVR sample OGLES2AlphaTest for alpha testing, which works fine on my HTC Desire device. Here is the code for shaders: private final String

Normal mapping GLSL using LibGDX

一世执手 提交于 2020-02-23 09:30:47
问题 I try to implement normal mapping using LibGDX. So I got some positive results when I calculate diffuse and specular color in vertex shader (at least I think so). Vertex shader: attribute vec4 a_position; attribute vec2 a_texCoord0; attribute vec3 a_normal; varying vec2 v_texCoord; varying float v_diffuse; varying vec3 v_specular; varying vec3 v_lightVec; uniform mat4 u_worldTrans; uniform mat4 u_projTrans; uniform mat4 u_matViewInverseTranspose; uniform mat4 u_matModelView; const vec3

OpenGL ES 2.0 / GLSL not rendering data (Kotlin)

本秂侑毒 提交于 2020-02-05 02:53:50
问题 I am trying to implement a basic shading program with GLES 2/3, and have pieced together this code from various tutorials. Everything looks correct to me, and it compiles fine, but nothing appears on my screen. It rendered fine until I added Normal and Light Position data, then it broke and I haven't been able to find a way to fix it. Can anyone see what's wrong here? class MyRenderer:GLSurfaceView.Renderer{ var glProgram = -1 var uMV = -1 var uMVP = -1 var uLightPos = -1 var aPosition = -1

GLKTextureLoader fails when loading a certain texture the first time, but succeeds the second time

落花浮王杯 提交于 2020-02-01 01:35:13
问题 I'm making an iPhone application with OpenGL ES 2.0 using the GLKit. I'm using GLKTextureLoader to load textures synchronously. The problem is that for a certain texture, it fails to load it the first time. It gives this error: The operation couldn’t be completed. (GLKTextureLoaderErrorDomain error 8.) For this error code, the apple documentation says the following: GLKTextureLoaderErrorUncompressedTextureUpload An uncompressed texture could not be uploaded. Available in iOS 5.0 and later.

Drawing a gradient in Libgdx

半城伤御伤魂 提交于 2020-01-29 04:29:04
问题 Ok I have this code @Override public void render() { // do not update game world when paused if (!paused) { // Update game world by the time that has passed // since last render frame worldController.update(Gdx.graphics.getDeltaTime()); } // Sets the clear screen color to: Cornflower Blue Gdx.gl.glClearColor(0x64/255.0f, 0x95/255.0f, 0xed/255.0f, 0xff/255.0f); // Clears the screen Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); // Render game world to screen worldRenderer.render(); } And it draws a

Fast Screen Recording of iOS App

坚强是说给别人听的谎言 提交于 2020-01-26 01:18:26
问题 I'm new to OpenGL ES. I'm trying to write code for screen recording of iOS apps, especially games. I'm using the 'render to texture' method described with code in this answer to capture screen and write the video for a cocos2d game. One modification I made was that, when I call CVOpenGLESTextureCacheCreate then I'm using [EAGLContext currentContext] instead of [[GPUImageOpenGLESContext sharedImageProcessingOpenGLESContext] context] It does record the video but there are two issues (1)- When