opengl-es

Blend negative value into framebuffer 0 opengl

不想你离开。 提交于 2019-12-11 06:45:34
问题 The program renders a bunch of things into an intermediate framebuffer that uses an unsigned normalized texture to store the data. The intermediate framebuffer is blended with the default framebuffer. The pixel shader used to render the intermediate for the blend with framebuffer 0 is the following: #version 300 es precision mediump float; out vec4 fragColor; in vec2 texCoords; uniform sampler2D textureToDraw; void main() { vec4 sampleColor = texture(textureToDraw, texCoords); fragColor =

Android OpenGL ES - I can't make gluLookAt/gluPerspective work

风格不统一 提交于 2019-12-11 06:42:31
问题 the following text is a bit lenghty as I wanted to make sure that people with similar problems that e.g. google this page can easily follow the exact problem and its solutions easily. But now on to my issue: I recently started programming OpenGL ES on an Android smartphone and ran into problems understanding how gluPerspective and gluLookAt are used. I think I understand what they do, however I cannot see the triangle I draw. I run the following code in the onDrawFrame-method of my activity.

Detecting good GPU on Android

久未见 提交于 2019-12-11 06:41:54
问题 I am looking for a safe way to detect whether the current GPU belongs to the current high end profile (such as Motorola's Atrix or Galaxy s2) so I can, in run-time, enable some more sophisticated visual effects in my game. Has anyone successfully done anything similar? I though about detecting dual-core CPU, which would usually come with a good GPU, but I don't have enough devices to test if it is going to work OK on most situations. 回答1: If those "more sophisticated visual effects" require

OpenGL, how to set a monochrome texture to a colored shape?

柔情痞子 提交于 2019-12-11 06:37:01
问题 I'm developing on Android with OpenGL ES, I draw some cubes and I change their colors with glColor4f. Now, what I want is to give a more realistic effect on the cubes, so I create a monochromatic 8bit depth, 64x64 pixel size PNG file. I loaded on a texture, and here is my problem, which is the way to combine the color and the texture to get a colorized and textured cubes onto the screen? I'm not an expert on OpenGL, I tried this: On create: public void asignBitmap(GL10 gl, Bitmap bitmap) {

OpenGLES blending code to Metal translation

给你一囗甜甜゛ 提交于 2019-12-11 06:36:08
问题 I have this simple OpenGLES blending code to Metal: glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_ONE, GL_ONE); glEnable(GL_BLEND); I wrote code in Metal but am confused if it is exactly does the same job. Specifically, do I need to mention alpha blending factors or no. Because I see performance of this code in Metal worse than OpenGLES which is weird. Please let me know if there is anything missing in this code. let renderPipelineDescriptorGreen = MTLRenderPipelineDescriptor()

Opengl ES 3.0 shader functions unimplemented on Nexus 5/KitKat 4.4

送分小仙女□ 提交于 2019-12-11 06:26:13
问题 I'm having no luck using any of the OpenGL 3.0 shader functions on my Nexus 5 w/ KitKat 4.4, I get "called unimplemented opengl es api" for functions such as glCreateProgram() glShaderSource() glCompileShader() e.t.c. I am performing all calls whilst the OpenGL context is active. I can't imagine that these functions would not be implemented, so believe I must be doing something wrong! I have included the following <GLES3/gl3.h> <GLES2/gl2ext.h> <GLES3/gl3platform.h> and am using -lGLESv3 in

Game development: OpenGlContext error issue

蓝咒 提交于 2019-12-11 06:13:32
问题 I am developing game in Android and got OpenGlContext error ,any suggestions to overcome the same? Below is my Code: public class GLView extends SurfaceView implements SurfaceHolder.Callback { private OpenGLContext ctx; private Tunnel3D tunnel; private boolean created; private GL10 gl; private int w; private int h; private Bitmap bmp; private int tex; public GLView (Context context) { // Parent... super (context); getHolder ().addCallback (this); // Internal members.. ctx = new OpenGLContext

Chase player with camera in AndEngine and limit world's bounds

余生颓废 提交于 2019-12-11 06:06:16
问题 Using AndEngine for Android, I would like to have my scene look like this: The red box is the world which must be limited to a given size, say 2000px*450px . The blue box is the Camera , which is limited as well (as usual), for example to 750px*450px . For the whole scene, I have a background image that is exactly 450px high. So my Camera can be scaled to whatever size is appropriate, but the background must exactly fit to the height. The width of the Camera may be variable. The player

phantom images after going from split screen to full screen

流过昼夜 提交于 2019-12-11 05:37:37
问题 I am writing a game for Android using the NDK. My game uses vulkan if it is available and otherwise uses OpenGL. I have a problem where if you put the game in split screen mode with the device held in portrait orientation, then resize the game to full screen mode, an after image of the game on the old view is still visible. Note: doing this with the game triggers SurfaceHolder.Callback.surfaceDestroyed (in Java) to be called, which in turn shuts down my render thread in C++. My callback for

Skybox with OpenGL ES on iOS - NO GLKit + iOS 5.0

我怕爱的太早我们不能终老 提交于 2019-12-11 05:36:50
问题 Please give me some hint/source to build a skybox (like street view) in OpenGL ES...after a week I only found a post: Skybox OpenGL ES iPhone and iPad but the link shared by Tommy is broken. 回答1: The GLKit contains a SkyBox effect. Example usage here. Note I'm not into iOS dev; just watched a WWDC session. 来源: https://stackoverflow.com/questions/10212991/skybox-with-opengl-es-on-ios-no-glkit-ios-5-0