FAQ Database Discussion Community


is early exit of loops on GPU worth doing?

opengl-es,glsl,webgl,shader,gpu
We've written GLSL shader code to do ray tracing visualisation using the GPU. It seems to be pretty standard to put an early exit break in the ray marching loop, so if the light is extinguished, the loop breaks. But from what I know about GPU code, each render will...

How I can add picture background in android opengl

android,opengl-es
I want to put my background as a picture rather than color.

Last two arguments of glVertexAttribPointer when using VBO

c++,opengl,opengl-es
I am confused how glVertexAttribPointer is being used with VBOs. From here it is clear that pre-last argument is the offset (distance between two vertex data) in memory and last is the pointer to memory that vertex data for a specific attribute. I.e. if I have such data: GLfloat vVertices[]...

Why my mesh vertices are moved by the same offset and not by offset calculated by bezier curve

android,opengl-es,andengine,mesh,bezier-curve
I have a tough one (I think) problem. I am prepearing a game with a part, which is a race. I want to make it similar to oldschool "Lotus" games. Player will see a car from behind, a a road should have turns from time to time. So my idea...

Objective-C + Cpp rvalues and arrays

c++,ios,objective-c,opengl-es
I need create array: const UInt8 *pixels[3] = { yuvFrame.luma.bytes, yuvFrame.chromaB.bytes, yuvFrame.chromaR.bytes }; But Xcode show me error: Cannot initialize an array element of type 'const UInt8 *' (aka 'const unsigned char *') with an rvalue of type 'const void *' I am mixing C++ code with Objective-C. So how...

On OpenGL, is there any way to tell glTexSubImage2d not to overwrite transparent pixels?

opengl,opengl-es
On OpenGL, I'm using glTexSubImage2d to overwrite specific parts of a 2D texture with rectangular sprites. Those sprites have, though, some transparent pixels (0x00000000) that I want to be ignored - that is, I don't want those pixels to overwrite whatever is on their positions on the target texture. Is...

Finding the right kind of Android sensors and using them

android,opengl-es,android-sensors,rotational-matrices,sensormanager
I've tried to search both on google and here the solution to my problem and I don't think it has been asked before (or may I be using the wrong words in my search? ^^') Anyway, this is what I want to have: a OpenGL surface view (showing a cube...

OpenGL ES: define triangles color in shader?

android,opengl-es,opengl-es-2.0,shader
I'm making an Android game using OpenGL ES 2.0, and I have a question on what would be the best strategy: I want to have a plane (the ground) made of multiple triangles (like a chessboard, with each case as 2 triangles), and I want each triangle to have a...

very large background textures

android,opengl-es,libgdx,textures
For a game I'm developing I must use large background images. These images are around 5000x3000. When attempting to display that as a single texture I would get black boxes in GWT and Android. I created a class that splits the image into a grid of textures: public class LargeImage...

Libgdx render for a rectangle array different textures

java,android,opengl-es,libgdx
I am developing a game with libgdx and i got stuck at a point. So My SpriteBatch draws for all the Rectangles that are in an array with the same texture but I want that every single one has its own texture. MY Code looks like this public class GameScreen...

Why I should use Constant Vertex Attributes instead of Uniforms?

opengl,opengl-es
I have ready several topics about Constant Vertex Attributes and Uniforms.Have find out some differences but could not understand why I need them. It seems I can always use uniforms instead of CVAs. Is there any good usecase for them?

GLSurfaceView not appearing over MapView

android,android-layout,opengl-es,opengl-es-2.0,glsurfaceview
My goal is to use OpenGL ES 2.0 with Google Maps. I would like to create an app that follows the user as they are traveling from point A to point B. I realize that this can be done using Google Maps addPolyline to draw a line, but I want...

Three js Shader Material - Pixelated glitching when transparency is set to true

javascript,opengl-es,three.js,webgl
I'm playing around with shaders for the first time and using THREE.RawShaderMaterial on a few meshes. I'm getting some strange artifacts on my very simple shaders: Vertex shader: precision mediump float; precision mediump int; uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; attribute vec3 position; attribute vec4 color; varying vec3 vPosition; void...

Is fixed Functions supported in newer android devices

android,opengl-es
I am wondering whether if using Fixed Functions in OpenGL will work on newer Android devices. I couldnt find any solid information about this on Google.

glClearColor not working correct (android opengl)

java,android,opengl-es,opengl-es-2.0
I want to change the background color of my app on runtime. So on button click I first call: GLES20.glClearColor(color[0], color[1], color[2], color[3]); Then I call: GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); And it does nothing! It keeps the current background color - doesnt change it. But when I then pause my app...

Drawing on multiple surfaces by using only EGLSurface?

opengl,opengl-es,opengl-es-2.0,egl
Is it possible to draw from the same application on multiple surfaces, one by one, by using only the handler returned by eglCreateWindowSurface ? What i want to achieve is to create two or more surfaces and pass them to a client who will draw on them, and then, when...

How to display a textured quad without the texture loaded yet(Android,opengles 2.0)

android,opengl-es
Currently in my app using opengl es, I have to display a bunch of quads with Different Textures. I want to asynchronously load textures with the quads displaying "blank" until the texture is loaded and start displaying the texture as the texture finishes loading.... what is the most desired way...

Drawing a cube in iOS with OpenGL and GLKit

ios,opengl-es,glkit
I was following this tutorial http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/ to understand how viewing works but then when I tried to apply it on my iOS app I had so much trouble so basically what I understood is that: The model is initially at the origin and so is the camera We then use...

Format conversions in OpenGL images

c++,opengl,opengl-es
It seems like I am completely confused by OpenGL format conversions related to image load/store. I came from DX world, where things are relatively clear. For example: You create a texture with some specific format (say RGBA32_FLOAT) You declare an RW texture in your shader RWTexture2D<float4> that matches the format...

OpenGL ES 2.0: How to render to a frameBuffer in a lower resolution for environment mapping?

android,opengl-es,opengl-es-2.0
I'm trying to implement dynamic environment reflections on Android using OpenGL ES 2.0. For this I set my camera in the place of my reflective object and render to an off-screen renderbuffer in 6 different directions (two per axis) to build a cube map, but that's very slow, so my...

Safe usage of glMapBufferRange() on Android/Java

java,android,opengl-es,opengl-es-3.0
I have working code using glMapBufferRange() from OpenGL-ES 3.0 on Android that looks like this: glBindBuffer(GL_ARRAY_BUFFER, myVertexBufferName); glBufferData(GL_ARRAY_BUFFER, myVertexBufferSize, null, GL_STATIC_DRAW); ByteBuffer mappedBuffer = (ByteBuffer)glMapBufferRange( GL_ARRAY_BUFFER, 0, myVertexBufferSize, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); // [fill buffer...] glUnmapBuffer(GL_ARRAY_BUFFER); My question is about downcasting the result of glMapBufferRange() to ByteBuffer on the third line....

Parsing .obj model from SD card Rajawali

android,opengl-es,rajawali
I am Working with Rajawali 3D Framework and trying to Load .obj files from SDcard. I am able to upload and parse the obj file when I put these files (.obj, .mtl, texture.png (drawable folder)) on raw folder but when I try to parse it from sdcard it says: [org.rajawali3d.materials.Material]...

OpenGL ES 2.0 with static (Fixed Function) pipeline API?

opengl-es,cocos2d-x
I know that OpenGL ES 2.0 standard threw out all the methods that can achieve the same results only keeping one. This is the result why static pipeline is removed from the specification and only dynamic pipeline is present. But it is strange that I use this code and it...

Android video decoder not drawing to gles surface on lollipop only

android,opengl-es,video-streaming,mediacodec,vr
Briefly, I'm combining two open source apps into a new VR app, so this only runs on the Note 4 and S6 using the GearVR headset. My app works on kitkat, but the video is black on lollipop. The two source apps both work fine on lollipop. I have a...

LibGDX - load and process texture asynchronously

java,android,opengl-es,libgdx
There are a few discussions about async loading textures using Assets in LibGDX. As far as I know LibGDX uses 2 methods (async & sync) to load data. In case if it's rely on using OpenGL functions, it uses main thread with GL context and does it synchronously, otherwise asynchronously....

Can I have two ping-pong framebuffers of screen size on Android?

android,opengl-es,framebuffer,fbo
I need to have two ping-pong framebuffers in my OpenGL ES app on Android. I also need them to be of the same size as device screen. Neither depth buffer nor stencil buffer will be attached to them only RGBA8888 color buffer. I'm planning to use them for adding some...

Are OpenGL indices and locations the same thing for uniforms and vertex attributes?

opengl,opengl-es,opengl-es-2.0,opengl-3,opengl-4
In the OpenGL Reference Pages, some functions are marked as using uniform locations, while other functions are marked as using uniform indices. Are these the same thing? Similarly for vertex attributes, some functions are marked as using vertex attribute indices, while other functions are marked as using vertex attribute locations....

Opengl triangles and faces vertex limit?

android,ios,opengl-es
I am making an opengl-es app and I have always drawn quads by passing in 6 vertex indices per quad thus breaking a quad into two triangles. I thought all you could make in 3d graphics was quads and triangles..? I noticed in blender however if you use the decimate...

Creating 3D cube using Android OpenGL ES 2.0

java,android,opengl-es
I wanted to make 3D cube on my sceen. Unfortunately after combining some code from various sites I am still unable to make cube. Can someone take a look at my code and advice what am I doing wrong? My idea is to make each face of a cube in...

Android OpenGLES Brown square

android,opengl-es
So I'm trying to learn openGLES 2.0 and create a textured rectangle. Apparently I didn't follow all the instructions and now I've ended up with just a odd color square. heres my shaders. final String vertexShader = "uniform mat4 u_MVPMatrix; \n" // A constant representing the combined model/view/projection matrix. +...

Page Curl with best quality

android,opengl-es,opengl-es-2.0
I am working with Harism Page Curl(Open GL) https://github.com/harism/android_page_curl and its works fine. Output is something like this: It's not smooth too much. I want something like this: ...

glGetError and performance

c++,performance,opengl,opengl-es
Background At work, we develop two products which both have OpenGL 3.x+ and GLES 2.0/3.0+ backends. Teams are independent, but do have some overlap, and we were recently discussing performance of glGetError. In both products, the design is such that no GL calls should generate an error code recorded by...

calculating vertex normals in opengl with c++

c++,opengl,opengl-es
could anyone please help me calculating vertex normals in OpenGL? I am loading an obj file and adding Gouraud shading by calculating vertex normals without using glNormal3f or glLight functions.. I have declared functions like operators, crossproduct, innerproduct,and etc.. I have understood that in order to get vertex normals, I...

Moving texture OpenGL ES 2.0

android,opengl-es,textures
I am trying to implement a sprite of 8 columns and 8 rows in OpenGL ES 2.0 I made appear the first imagen but I cant figure out how to translate the Texture matrix in OpenGL ES 2.0 , the equivalent of the code in OpenGL 1.0 that I am...

3D point drawing in Android using OpenGL ES

android,opengl-es,3d
I am new to Android and OpenGL both. I want to draw a series of 3D given points in android with open GL where last point should blink. I have drawn square, pyramid and triangle but still not able to draw above-mentioned thing. Easy method will be appreciated.

When binding an fbo do you need to call glFramebufferTexture2D every frame?

android,ios,opengl-es
On each draw frame when I bind an FBO am I supposed to call GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, ResourceManager.windowTex[0], 0); Are you only supposed to call this when you initialize your framebuffer or every frame? It doesn't draw for me unless I call it after glBindFramebuffer....

Android: How to change OpenGLES texture data / bitmap from gallery / camera

java,android,opengl-es,effects
I try reuse Android Media Effects samples and want to be able to change texture data with new bitmap from camera or gallery pick. No solution so far This is the initial load texture from the sample : https://github.com/googlesamples/android-MediaEffects/blob/master/Application/src/main/java/com/example/android/mediaeffects/MediaEffectsFragment.java private void loadTextures() { // Generate textures GLES20.glGenTextures(2, mTextures, 0); //...

Copy a picture of the current screen just before game pause blur it and render to screen in the duration of game pause

java,android,opengl-es,libgdx
I am having trouble implementing a game pause blur screen to render during the gamepause state. I need to take a picture or texture of the current screen i.e gamerunning state, just when the user pauses the screen . Maybe store it to memory, blur it then render it to...

glMapBuffer is missing from opengl es 2

opengl-es,opengl-es-2.0
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?

OpenGL ES 2.0 Alpha

android,opengl-es,alpha,premultiplied-alpha
I am trying to load a texture PNG ( exported by photoshop) and use it in OpenGL ES 2.0 in Android, but the solid color seems like transparent ( black circle in the png is totally black) I has been read that if you scale a png more than 50%...

iOS record audio and draw waveform like Voice Memos

ios,opengl-es,core-graphics,core-audio,avaudiorecorder
I'm going to ask this at the risk of being too vague or asking too many things in one question, but I'm really just looking for a point in the right direction. In my app I want to record audio, show a waveform while recording, and scroll through the waveform...

Bitmap quality using glReadPixels with frame buffer objects

android,opengl-es,bitmap
I have the following issue when exporting a bitmap from frame buffer object on Android using OpenGL 2. I have an image loaded into OpenGL and shown on the screen. The loaded image is bigger than the actual screen, thus I do some matrix manipulation to fit it on the...

Rendering multiple 2D images in OpenGL-ES 2.0

android,opengl-es,2d,opengl-es-2.0
I am new to OpenGL, and trying to learn ES 2.0. To start with, I am working on a card game, where I need to render multiple card images. I followed this http://www.learnopengles.com/android-lesson-four-introducing-basic-texturing/ I have created a few classes to handle the data and actions. MySprite holds the texture information,...

Learning camera OpenGl ES 2.0

android,opengl-es
I am trying to understand how camera works on OpenGL ES, so I am tryng to look at the same point with the two differents types, Matrix.frustumM and Matrix.orthoM I will like to know what exactly I am doing when use Matrix.frustumM or orthoM, I know that I apply them...

OpenGl ES 3.0 Context not created on iPad (works in Simulator)

ios,ipad,opengl-es,opengl-es-3.0,openglcontext
I'm working on a cross platform renderer for PC (Windows, Linux, Mac) and iOS. The iOS part is currently built around OpenGL ES 2.0 and I wanted to upgrade to ES 3.0. So I replaced the following line (that works) context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; with this line: context =...

OpenGL ES 2.0 Framebuffer with render to texture iOS: nothing shown

c++,ios,opengl-es,opengl-es-2.0,framebuffer
I'm using a Framebuffer to do post processing. Creating and drawing to the buffer (tested via glReadPixels and glCheckFramebufferStatus) is working fine. But now I want to render the this texture with a quad to the screen. But the screen remains black. The same code (for drawing) is working fine...

OpenglES 2.0 Vertex Shader Attributes

c++,opengl-es,shader,vertex
I've read in tutorials that the bare minimum a vertex shader needs is define below: attribute vec3 v3_variable; attribute vec3 v3Pos; void main() { gl_Position = v3Pos; } OpenglES passes to the shader vertex data to v3Pos but the name of this variable can actually be anything, other tutorials name...

Webgl 1 bit per pixel texture

opengl-es,webgl
Is there any way to use 1 bit per pixel texture data in WebGL (for example texture 16×16px in 32 bytes of data) or is it necessary to unpack data from 1bpp to 8bpp first? I have found similar OpenGL related question and answer http://stackoverflow.com/a/15706596/4540236, but it seems to me,...

OpenGl basic Vertex Shader

opengl-es,vertex-shader
I am new in shader concepts and I am trying to implement a sprite of 8x8 in OpenGL ES. I want to move the texture in the vertex shader but I cant figure out how to this, my code may be wrong, feel free to correct me If I change...

are there time limits on fragment shaders? iOS using filters with GPUImage from Brad Larson

opengl-es,gpuimage,fragment-shader
I am using Brad Larson's excellent library GPUImage on iOS 8 and I've run into a problem filter that only finishes 3/4's of it's task/fragments, run on a single image, but multiple filters: From the tests I am doing, it appears I am either violating a time limit, or a...

How to make TMXTiledMap responsive?

android,opengl-es,cocos2d-x,resolution,tiled
My game is a 2D car-based one, with a straight infinite map where I've finally been able to add some random obstacles. There are only 3 positions the car can be at, and everything is working fine. The point is that I've recently noticed that it is not responsive, and...

Fastest way to draw sprites in opengles 2.0 on android

android,performance,opengl-es,opengl-es-2.0
So Im trying to figure out how to draw a single textured quad many times. My issue is that since these are create and deleted and every one of them has a unique position and rotation. Im not sure a vbo is the best solution as I've heard modifying buffers...

Opengl ES 2.0 : Get texture size and other info

java,android,opengl-es,opengl-es-2.0
The context of the question is OpenGL ES 2.0 in the Android environment. I have a texture. No problem to display or use it. Is there a method to know its width and height and other info (like internal format) simply starting from its binding id? I need to save...

Modern OpenGL 3.0: How to move a 2D vbo on screen

c++,opengl,opengl-es
I have been learning modern OpenGL (3.0) for a couple of weeks now and am trying to create a lunar lander clone in 2D. All tutorials and questions I have read so far did not help at all. Vertexes in header and other OpenGL: GLuint vertexArrayLander; GLuint landerVBO; GLfloat landerVertex...

WhirlyGlobe Sample for android not working

android,opengl-es,3d
I have tried whirlyglobe sample code but it didn't work, can you check and make it working for android. " MapGlobeTestFragment " this one "fragment class" is missing for android sample and its not present in library.

Creating a portable opengl engine for swing and android Java based application

java,android,opengl-es,continuous-integration
I'm working on a Java based game for desktop using JOGL. But I'm considering porting the core part of game to Android. Currently I have Swing (UI) related code in 1 project called desktop-game, and that project has a dependency on another project called core-game, which has basic functionality and...

adb screencap output is different than on the device

android,opengl-es,android-ndk,adb
I have a graphical glitch related to blending in my OpenGL application using Android NDK. The strange thing is that when I take a screenshot through adb screencap command, the problem completely disappears and the result looks okay. My question is: Is there a way to know what is happening...

Colored Vignette Shader (the outer part) - LIBGDX

opengl-es,libgdx,opengl-es-2.0,shader,vertex-shader
I've seen lots of tutorials on vignette shaders just like these but none of them say how to change the color of the vignette, they only talk about applying sepia or grey shaders to the whole composite image. For example the video above gives the below code for the vignette...

glDrawElements() crashes Lollipop but OK on KitKat

java,android,opengl-es,bytebuffer
I am trying to learn OpenGL ES 1.0 for Android. My app was working fine until I upgraded my device this morning to Android 5.0.1, Lollipop. My initial attempts at debugging this problem quickly led to the discovery that my app still works on the emulator running KitKat, but crashes...

iOS OpenGLES not rendering images on iPhone 5s+

ios,objective-c,xcode,opengl-es
I followed this tutorial for the first short bit on setting up a basic 2D game engine: Basic 2D Game Engine Tutorial and completed the first bit to render a basic image to the screen. It works fine on the iPhone 4s and iPhone 5 simulator but not any simulator...

Using a FrameBufferObject with several Color Texture attachments

opengl-es,opengl-es-2.0,shader,fbo
I'm implementing in my program the gaussian blur effect. To do the job I need to render the first blur information (the one on Y axis) in a specific texture (let's call it tex_1) and use this same information contained in tex_1 as input information for a second render pass...

GLKit: Transparent texture when dealing with big 3D object

ios,objective-c,opengl-es,glkit
I'm writing a 3D Viewer that displays .obj file and offers some basic gestures (pinning, rotating, zooming) by following 2 Raywenderlich tutorials: http://www.raywenderlich.com/48293/how-to-export-blender-models-to-opengl-es-part-1 http://www.raywenderlich.com/50398/opengl-es-transformations-gestures I'm able to load and display correctly small .obj files but for big .obj files, the textures become suddenly transparent ! I have tested with the...

Migrating a Qt QGL based project to use OpenGL 4.3

c++,qt,opengl,opengl-es
Ever since I first started my current Qt project around 6 months ago, it has been using what I believe is version 1.3 of OpenGL. However as of recently, I've been itching to actually start improving the way I render things, and it appears that I'm missing many functions that...

GL_GEOMETRY_SHADER missing on iOS OpenGL ES 3.0

ios,opengl-es
I am porting my engine to iOS and I got an error 'GL_GEOMETRY_SHADER' undefined I am using iOS 8 SDK and OpenGL 3.0; Device is iPhone 5s. Is there any alternative to this? Or how can I access geometry shader stuff?...

setLineWidth works differently on different test machines

opengl-es,width,line,andengine,bezier-curve
I make a game in which I draw bezier curve like this: final VertexBufferObjectManager vbom = engine.getVertexBufferObjectManager(); final HighPerformanceMeshVertexBufferObject pMeshVBOM = new HighPerformanceMeshVertexBufferObject(vbom, pBufferData, pBufferData.length, DrawType.DYNAMIC, true, Mesh.VERTEXBUFFEROBJECTATTRIBUTES_DEFAULT); final HighPerformanceLineChainVertexBufferObject pLeftCurbLineChainVBOM = new HighPerformanceLineChainVertexBufferObject(vbom, triangleCount * 3, DrawType.DYNAMIC, true,...

Android OpenGL es 2.0 error when modifying multiple objects on scene

android,opengl-es,opengl-es-2.0
I am having some problems with proper scene manipulations with OpenGL ES 2.0. On my screen I want to draw a rectangle and a cube. Rectangle should be moved to the bottom and scaled while cube should be moved to the top and scaled. What's more, I want to rotate...

Numpy (OpenCV) image array to OpenGL texture (pi3d)

python,opencv,numpy,opengl-es,raspberry-pi
I'm using pi3d to display an ImageSprite on the screen the texture of which comes form an image I'm loading. displayTexture = pi3d.Texture("display/display.jpg", blend=True, mipmap=True) displaySlide = pi3d.ImageSprite(texture=displayTexture, shader=shader, w=800, h=600) This texture image is actually something I'm creating in-program. It's an openCV2 image and therefore just a numpy array....

glclear() modifying image outside of glscissor() bounds in ios8 opengl

ios,opengl-es
The following code draws only a green box, when I am expecting both a green and red box. If I don't have the second glClear() statement, the red box appears. This leads me to conclude, since I have the scissor box outside the bounds of the red box, that the...

Maintaining glSurfaceView through different activities

android,opengl-es,glsurfaceview
I am writing an android app with opengl-es and i came across a problem.... I found out that you should not send a view from one activity to another. My app includes several activities and I would like to share a single glsurface view among the activities..... Is there any...

This opengl diffuse shader makes my texture transparent

android,ios,opengl-es
I am importing .obj files into opengl and the mesh displays fine, but now I want to diffuse shade it. I have used the shader below, but it just makes my mesh's texture semi transparent. Also I didn't do anything special with the normals I just plugged em into opengl....

Openframeworks iOS project: texture on ofSpherePrimitive breaks

ios,opengl-es,rendering,texture-mapping,openframeworks
I've been working on an iOS project where I am trying to map a texture (world map) onto a ofSpherePrimitive, but there seems to be some rendering issue. While I can get the texture to be mapped onto the sphere, there seems to be parts of the sphere where the...

CCClippingnode causes OpenGL error 0x0502

ios,objective-c,cocos2d-iphone,opengl-es,ccsprite
I'm using cocos2d-iPhone v.2.2, updating an old game, and I have a clipping node that is causing an error. In AppDelegate.m, I switched the settings to use CCClippingNode: CCGLView *glView = [CCGLView viewWithFrame:[window_ bounds] pixelFormat:kEAGLColorFormatRGB565 depthFormat:GL_DEPTH24_STENCIL8_OES //switched from 0 preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0]; And then I used this code to...

OpenGL How to use a invisible mask to hide objects behind it

opengl,opengl-es,depth,depth-buffer,stencils
I have an OpenGL problem to solve. I have an object/mesh A, an object/mesh B and a background texture C. Initially the framebuffer is filled with background texture C. We draw both A & B in the framebuffer. We want to keep object A visible, and object B always invisible....

OpenGLES in a Windows Phone 8.1 App

c#,c++,opengl-es,windows-phone-8.1
I have a C++ lib that draws visual controls on a drawing context using OpenGLES (like buttons, textboxes, lists etc.). I want to use this lib on multiple mobile devices (Windows Phone 8.1, IoS, Android). Right now I want to try to use it on a Windows Phone, so I...

using openGL ES from C++: error 1281 on glUseProgram

c++,ios,opengl-es
I am trying to move some openGL processing to a C++ class, which is wrapped in an Objective-C class for use with iOS. Most of it seems to work, but I'm not getting the rendering into the frame buffer. When I bracket every openGL call with glGetError() - both in...

LibGDX FrameBuffer quirk on iOS

ios,opengl-es,libgdx,opengl-es-2.0,framebuffer
I've got dynamic textures for a word game that I create and keep on a FrameBuffer. I then use TextureRegions backed by that FrameBuffer to draw to the screen. This code works fine on Android, but I'm having problems on iOS. You can see below a screenshot with the FrameBuffer...

Issues refactoring GLES30 shader?

opengl-es,textures,glsl,shader,hlsl
I'm currently rewriting a shader written in GLES30 for the GLES20 shader language. I've hit a snag where the shader I need to convert makes a call to the function textureLod, which samples the currently bound texture using a specific level-of-detail. This call is made within the fragment shader, which...

How to render a 3D file using Assimp library [closed]

android,c++,opengl-es,android-ndk,assimp
I am working on an android project, in which I need to render 3D file. I have decided to use Assimp library after a lot of research. I have successfully compiled Assimp library.. But I am not able to render a file using it. There is not much documentation available...

Crop video before encoding with MediaCodec for Grafika's “Continuous Capture” Activity

android,video,opengl-es,crop,grafika
I am learning about Grafika's "Continuous Capture" Activity, It is about recording a video with MediaCodec, the video recording implementation is described in https://source.android.com/devices/graphics/architecture.html The activity source code is at https://github.com/google/grafika/blob/master/src/com/android/grafika/ContinuousCaptureActivity.java The program uses a SurfaceTexture obj to receive data from camera and creates 2 EGLSurface obj with this SurfaceTexture...

Programmatically generate texture for WebGL in JavaScript

javascript,opengl-es,textures,webgl
I have the following code to programmatically generate a texture for WebGL in C. I need to do the same thing in JavaScript for WebGL. How do I properly create the 3 dimensional checkerboard matrix? GLubyte checkerboard[64][64][3]; How do I set the values? checkerboard[i][j][0] = (GLubyte) c; How do I...

Setting up OpenGL ES 1.1, and my android environment

android,c,opengl-es
This may be a bit difficult, but I have a fairly complex question: I'm fixing up an old Android phone I have from 2010 (very crap phone), to play with and experiment on. I want to write some OpenGL ES 1.1 programs (preferably in C) on it, but I have...

From How far can the camera look an object in OpenGl in android?

android,opengl-es
I am new to OpenGL android, but know some basic concepts like projection and camera views. we can change the position and orientation of camera. But,when i move camera more away from an object the object disappears . For example: Below is my camera view and the co-ordinates of rectangle....

Activity messed after playing YUV video use opengles on Android

java,android,c++,opengl-es
I use opengl es with jni to play YUV video, the video is OK. But when i close GLSurfaceView and return to main Activity. The characters and images display in main Activity become messed. All icons becomes black solid rectangle. All the characters becomes white solid rectangle. The code look...

Need help explain about normal vector SceneKit

ios,vector,opengl-es,scenekit
I follow this article to create a custom SCNGeometry http://ronnqvi.st/custom-scenekit-geometry/ I see it need normal vector for every vertex. I also see the document here https://developer.apple.com/library/prerelease/ios/documentation/SceneKit/Reference/SCNGeometrySource_Class/index.html In my knowledge, I think 3 vertices identify one plane and one plane need only 1 normal vector. So each 3 vertices we need...

vertex array objects in android opengl-es

android,opengl-es,vertex-array-object
I heard most of the android devices that are recently released support VAOs of opengl-es. I am trying to develop an app on a opengl-es 2.0 environment. However, I am wondering (Q1)Do most of the Android devices being used(produced maybe several years ago) support VAOs? if not wouldn't be better...

mat4 type in attribute shader

opengl-es,webgl,shader
how to send to a shader attribute with the MAT4 type? attribute mat4 attr; ... JS: var attr=gl.getAttribLocation(_program,"attr"); ...

Passing 2 Textures into fragmenshader

ios,opengl-es,textures,multitexturing
Im want to get to different textures in my fragment shader. But somehow it won't work. It is only getting one of them. I'm starting my rendering with : glBindVertexArrayOES(_heighMap.vertexArray); //Get Uniforms GLuint mapProj = glGetUniformLocation(_mapProgram, "modelViewProjectionMatrix"); GLuint mapView = glGetUniformLocation(_mapProgram, "modelViewMatrix"); GLuint mapNormal = glGetUniformLocation(_mapProgram, "normalMatrix"); GLuint map2D0 =glGetUniformLocation(_mapProgram,...

Video Memory from ETC2 Texture Compression on OpenGL 4.3

c++,opengl,opengl-es,textures,glsl
Currently I'm writing a renderer which uses many textures and will fill up my graphics card's video memory (3 Gb for my nVidia GTX 780 Ti). So I pre-compressed all necessary images by using Mali's texture compression tool and integrated my renderer with libktx for loading compressed textures(*.ktx). The compression...

OpenGL iOS screen coordinates to scene coordinates

ios,objective-c,opengl-es,coordinates,glkit
I'm using OpenGl to make a little Application and I have no idea how to get the x , y and z coordinates of a touch For example: -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint touchPoint = [touch locationInView:[self view]]; float X = touchPoint.x; float Y...

OpenGL Module using kivy

android,python,opengl-es,kivy
I am trying to follow this tutorial: http://digitaloctave.co.uk/pages/kivy/kivy-opengl-tut03.htm but I think it is a little old, I cant get "from opengl_widget import OpenglWidget" working, it say the module doesn't exist. I think the OpenGL module is to use the " OpenglWidget: width: 200 height: 200" in the .kv file. I...

Make a line thicker in 3D?

ios,swift,opengl-es,scenekit
In reference to this question Drawing a line between two points using SceneKit I'm drawing a line in 3D and want to make it thicker by using this code func renderer(aRenderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: NSTimeInterval) { //Makes the lines thicker glLineWidth(20) } but it doesn't work, iOS...

Solved - GLES2.0+ framebuffer fade artifacts

android,opengl-es,glsl,framebuffer
I'm writing a simple test program on android using GLES 2.0 or 3.0. (If the solution only works on one over the other, than that's what I'll go with.) Problem: Basically I am running into strange pixel artifacts when fading colors. The problem can be "hidden" by making the cutoff...

Android Rotation Vector and Rotation Matrix

android,opengl-es,linear-algebra,android-sensors,rotational-matrices
So I previously asked a question more about what ind of sensor to use for the application I'm building. After some research I know now that it's the rotation vector that I want to use for I want to be able to move a virtual cube on my tablet according...

How to do calculation using OpenGL ES 2.0/3.0?

opengl-es,gpgpu
i'm thinking a problem that is it possible to do some arrays calcution using OpenGL ES in mobile devices. For example, i used glTexImage2D to pass shader a float array (which contains some 0.0 and 1.0, such as {0.0, 1.0, 1.0, 0.0, 0.0...}), and i wish to figure out how...

Sampler3D in iOS

ios,opengl-es,glsl,opengl-es-3.0
I have just include OpenGL ES 3.0 in my iOS app and it is working fine. I have a working shader below: #version 300 es precision mediump float; uniform sampler2D texSampler; uniform float fExposure; in vec2 fTexCoord; in vec3 fColor; out vec4 fragmentColor; void main() { fragmentColor = texture(texSampler, fTexCoord)...

Background OpenGL ES thread with camera preview on Android

android,multithreading,opengl-es,camera
Is there a way to have a background thread access the camera preview using an OpenGL ES texture? It is perfectly fine to access the camera preview using OpenGL ES within a view that is visible to the user. I need to access the camera frame within a background thread...

Xamarin : Loading resources via GetManifestResourceStream

opengl-es,xamarin,monotouch,xamarin.forms
I am working on a Xamarin forms project to use OpenGL/OpenTK. I am trying to load a shader using GetManifestResourceStream. Whatever I do I get null code is being run from .Shared project, shaders are in .ios / .Android resources directory string prefix; #if __IOS__ prefix = "OpenGLTesting.iOS."; #endif #if...

Why are shaders and programs stored as integers in OpenGL?

c++,opengl,opengl-es,integer,shader
I'm following the "OpenGL Superbible" book and I can't help but notice that when we create a shader and create the program that we attach the shaders to, we store them as GLuint which are unsigned integers. Why are they stored as numbers? What does the value of the number...

Generating a sphere in OpenGL without high level libraries - what's wrong with my code?

opengl-es,geometry,opengl-es-2.0
I've tried to implement an inefficient function to generate the points, normals, tex coords, and index list of a sphere. Ignoring the lines, when I draw the sphere with OpenGL I get the following output which is clearly wrong: Can anyone help me understand what's wrong with my code? public...

libGDX - Drawing Texture via SpriteBatch Result Flip

java,android,ios,opengl-es,libgdx
When I tried draw a Texture using SpriteBatch it was result flip like this: Here what I do: I create MyRect object which draw bounding rectangle and an image. Here MyRect class preview: public class MyRect { private Vector2 position; private int width; private float height; private Texture img; private...