opengl-es-2.0

How to show background bitmap on 2D

自闭症网瘾萝莉.ら 提交于 2019-12-14 03:28:35
问题 The background original bitmap and the real effect like this: This is my first time use Opengl ES 2.0. I don't know why and where my the problem is. Maybe some wrong happens in direction. My code: public class BackgroundGLRnder implements GLSurfaceView.Renderer { // Our matrices private final float[] mtrxProjection = new float[16]; private final float[] mtrxView = new float[16]; private final float[] mtrxProjectionAndView = new float[16]; // Geometric variables private float vertices[];

glMapBuffer is missing from opengl es 2

…衆ロ難τιáo~ 提交于 2019-12-14 02:47:05
问题 Why glMapBuffer is missing from opengl es 2.0? Who we can get access to buffer data to change it efficiently? Only glBufferSubData is the best way to modify the buffer? 回答1: glMapBuffer is an extension in ES 2.0, not part of the core spec. The vast majority of devices (all iOS and most Andriod) offer the extension, but it is not required. The only core way to upload VBO data is with glBufferData , or glBufferSubData . 回答2: You need extension GL_OES_mapbuffer. This provides glMapBufferOES and

How to deal with NaN or inf in OpenGL ES 2.0 shaders

青春壹個敷衍的年華 提交于 2019-12-14 01:31:32
问题 This is based on the question: Best way to detect NaN's in OpenGL shaders Standard GLSL defines isnan() and isinf() functions for detection. OpenGL ES 2.0 shading language doesn't. How can I deal with NaNs and Infs nevertheless? 回答1: You can check for NaN via a condition that will only be true for NaN: bool isNan(float val) { return (val <= 0.0 || 0.0 <= val) ? false : true; } isinf is a bit more difficult. There is no mechanism to convert the float into its integer representation and play

libgdx open gles 2.0 stencil alpha masking

孤者浪人 提交于 2019-12-13 20:43:21
问题 I'm looking for a solution to implement alpha masking with stencil buffer in libgdx with open gles 2.0. I have managed to implement simple alpha masking with stencil buffer and shaders, where if alpha channel of fragment is greater then some specified value it gets discarted. That works fine. The problem is when I want to use some gradient image mask, or fethered png mask, I don't get what I wanned (I get "filled" rectangle mask with no alpha channel), instead I want smooth fade out mask. I

Load an RGBA image from two jpegs on iOS - OpenGL ES 2.0

只愿长相守 提交于 2019-12-13 19:15:34
问题 Based on the concepts in my question here and the problems with PNG files outlined in my other question here, I'm going to try loading an RGBA image from two jpeg. One will contain the RGB and the other only the Alpha. I can either save the 2nd as a greyscale jpeg or as an RGB and pull the alpha data from the red component. In a second step I'll save the raw image data out to a file in the cache. I'll then do a test to determine it's faster to load the raw data or to decompress the jpegs and

Convert satellite photos of Earth into texture maps on a sphere (OpenGL ES)

大城市里の小女人 提交于 2019-12-13 13:24:55
问题 We have 5 geo-stationary satellites, spaced around the equator (not equally spaced, but almost) taking photos of Earth every day. The output of each photo is - surprise! - a photo of a sphere, taken from a long distance away. I need to reassemble those photos into a single texture-mapped sphere, and I'm not sure how best to do this. Key problems: The photos are - obviously - massively distorted the further you go from the center, since they're looking at a sphere There are many hundreds of

How to stop OpenGL background bleed on transparent textures

回眸只為那壹抹淺笑 提交于 2019-12-13 13:07:30
问题 I have an iOS OpenGL ES 2.0 3D game and am working to get transparent textures working nicely, in this particular example for a fence. I'll start with the final result. The bits of green background/clear color are coming through around the edges of the fence - note how it isn't ALL edges and some of it is ok: The reason for the lack of bleed in the top right is order of operations. As you can see from the following shots, the order of draw includes some buildings that get drawn BEFORE the

How do I rotate an object using OpenGL ES 2.0?

喜你入骨 提交于 2019-12-13 12:35:49
问题 In OpenGL ES 1.1, you can use glRotatef() to rotate a model, but that function doesn't exist in OpenGL ES 2.0. Therefore, how do you perform rotation in OpenGL ES 2.0? 回答1: To follow on what Christian's said, you'll need to keep track of the model view matrix yourself and manipulate that to perform the rotations you need. You'll then pass in the matrix as a uniform to your shader, and do something like the following: attribute vec4 position; uniform mat4 modelViewProjMatrix; void main() { gl

Rendering Static and Dynamic Graphics OpenGL

六月ゝ 毕业季﹏ 提交于 2019-12-13 12:19:07
问题 I am working on an IOS game using the OpenGL pipeline. I have been able to render the graphics I want to the screen, however, I am calling glDrawElements too many times and have some concerns about running into performance issues eventually. I have several static elements in my game that do not need to be render on every render cycle. Is there a way I can render static elements to one frame buffer and dynamic elements to another? Here's the code I have tried: static BOOL renderThisFrameBuffer

OpenGL or OpenGL ES [duplicate]

牧云@^-^@ 提交于 2019-12-13 12:01:50
问题 This question already has answers here : OpenGL ES versus OpenGL (12 answers) Closed 3 years ago . What should I learn? OpenGL 4.1 or OpenGL ES 2.0? I will be developing desktop applications using Qt but I may start developing mobile applications in a few months, too. I don't know anything about 3D, 3D math, etc and I'd rather spend 100 bucks in a good book than 1 week digging websites and going through trial and error. One problem I see with OpenGL 4.1 is as far as I know there is no book