Questions tagged [opengl-es-2.0]

-2

votes
1

answer
102

Views

GLSL Shader compilation fails without error message

I got the following shader embedded in my code: static const GLchar * frag_shader_rect = 'precision mediump float;\n' 'varying vec4 v_color;\n' 'void main() {\n' ' gl_FragColor = v_color;\n' '}\n'; When I try to compile this shader with glShaderSource(shader, 1, &frag_shader_rect, NULL); glCompile...
Nidhoegger
1

votes
1

answer
744

Views

glBlendFunc transparency in OpenGL with GLKit

I'm using GLKit for an iPad app. With this code I setup blending: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); It works fine, but when I try to get a screenshot the blend mode seems wrong. It doesn't matter if I use GLKit's snapshot or glReadPixels. This is what I get when...
Odrakir
1

votes
0

answer
43

Views

How set the opacity/alpha of an image using OpenGL ES 2.0 and GLKit?

I have create function with OpenGL ES 2.0 and GLKit. I have used GLKBaseEffect for draw GLKTextureInfo and GLKTextureLoader for load PNG file on GLKTextureInfo. (heart.png) Now, I want to set the opacity of the PNG image. This may sound simple, but I have no idea how I can change the opacity...
Easy Soft
1

votes
0

answer
136

Views

Integrating QtQuick and GL_TEXTURE_EXTERNAL_OES

I finished my own streaming library for Android (API 18) few days ago. It can read H.264 by RTMP and decode at realtime with SurfaceTexture (GL_TEXTURE_EXTERNAL_OES target) + QSGNode output (many thanks to Bog'Dan Vatra from KDAB with great example how to combine this), also it supports Camera strea...
0x0000DEAD
1

votes
0

answer
149

Views

How to display image in wide color gamut under ios and android Oreo via openGL?

Ios and android Oreo support wide color gamut (color management). Via openGL how to make that my app can render bitmaps with embedded wide color profiles loaded from PNG, JPEG ? I m under Delphi I read from the android doc that we can use wide color gamut mode in OpenGL doing somethink like this (fo...
loki
1

votes
1

answer
34

Views

Getting black screen on creating Triangle using OpeGL ES

I'm making an sample OpenGL ES android app referring android developers website. I'm trying to draw a triangle. I have done every thing as they said in that but I end up with the black screen. please help me solving this problem. I have written all the classes as inner classes of main activity. here...
SriDatta Yalla
1

votes
1

answer
102

Views

Computing vertex normal in OpenGL ES2 shader

I'm having some issues with the lighting of an obj model I grabbed from Google Poly. In this model a bunch of faces are defined with no normals. As such, the calculation I'm using for the diffuse color is returning 0. Is there any way to estimate the normal if not provided or do I need to parse the...
TheHebrewHammer
1

votes
0

answer
60

Views

How do I get points to display using OpenGLES 2?

I have tried many different things, but I have the impression that this is all that I need to do to generate points instead of lines or triangles. The uncommented glDrawElements works, the commented commands to set line width and draw just lines works, but trying to draw the points does not. Is th...
J.Doe
1

votes
1

answer
59

Views

Fragment shader output interferes with conditional statement

Context: I'm doing all of the following using OpenGLES 2 on iOS 11 While implementing different blend modes used to blend two textures together I came across a weird issue that I managed to reduce to the following: I'm trying to blend the following two textures together, only using the fragment sha...
Keiwan
1

votes
0

answer
63

Views

Raycast origin or Object intersection point

Following screenToWorld() method returns Ray origin point (or) intersection point of object. If it is a intersection point of object,how to identify click event on particular object? public PointF hitTest(MotionEvent e) { return screenToWorld(modelViewMatrix, modelViewProjectionMatrix, e.getX(), e.g...
Ramprasad
1

votes
1

answer
127

Views

SpriteKit: SKShader with custom shader not doing `mix` properly

I am using a custom shader to create a sprite in SpriteKit. The main part of the shader does this... vec4 col = mix(baseColor, overlayColor, overlayColor.a); The colours I have are something like... baseColor = UIColor(red:0.51, green:0.71, blue:0.88, alpha:1.0) and... overlay = UIColor(red: 1.0, gr...
Fogmeister
1

votes
0

answer
104

Views

Should we can put multiple different object on a singlesurefaceview in ARCore?

Should we can put multiple different objects on a singlesurefaceview in ARCore Android. And if possible than we can able to rotate that single particular object only and another all are remain as it is at same position.
Shubham Sejpal
1

votes
0

answer
54

Views

how should i get the touch of specific object in ARCore?(Android)

If i have two different objects on my surface view how should i get the touch of specific object? So i can only to pass that particular object for rendering and i can just enable the rotation of that particular object only. It is possible with Radio Button selection mode demo link is given below but...
Shubham Sejpal
1

votes
0

answer
26

Views

OpenGl es 2.0 android save resources dont change texture

I am currently using opengl es 2.0 for my android game and I am trying to optimize it a little. Since the background has about three different images which are already in the opengl texture buffer, I thought it would be possible to leave the first texture drawn active, then draw all the other shapes...
ChopStick
1

votes
1

answer
53

Views

Update view after applying rotation on one 3D object OpenGL ES 2.0

I have been working on an app based on the ARCore sample for Android Studio. I have managed to bring different objects of my choice in the view and now I am trying to rotate only one object, that being the last object placed. That means that when selecting an object, I should be able to rotate it an...
Delia
1

votes
0

answer
219

Views

Apply black and white opengl filter on Camera2 api

I am new to both camera2 and openGLES. I want to apply a shader over camera preview obtained by camera2 api which can convert preview in black and white. I believe grey scale filter is what will help here. Can anyone suggest any demo application which i can refer to for this requirement ?
user2991413
1

votes
1

answer
96

Views

glGetAttribLocation returns -1 on one of my attributes

glGetAttribLocation returns -1 on one of my 3 attributes (color). Checking for errors, state, etc and everything returns positive. Using OpenGL ES2 on Android 7. Just cannot find the cause and the way how color is set up is identical to texcoord for me. Vertex Shader: #version 100 attribute vec2 pos...
Robin Betka
1

votes
0

answer
59

Views

How do I fix a 3D object on glsurfaceview and cameraview and rotate it from a different angle?

I want to build an augmented reality (AR) app as shown in this video: Ikea’s new augmented reality app will change the way you decorate I have loaded a 3D .stl object on glsurfaceview and cameraview, and I am able to rotate the object with the touch of a finger. However, the problem is my object i...
Sejpal Pavan
1

votes
0

answer
83

Views

Texture animation and draw calls performance | OpenGLES 2.0 + Java

I'm building a simple game on Android Studio by using Java and OpenGL ES 2.0. If until now I was concerned more on the creative side, now I've come to a point where performance began to play an important role, indeed while testing it on my device (Samsung Galaxy S8) I started noticing some lag or sc...
Lapo
1

votes
0

answer
65

Views

How would I convert .obj/.mtl file to this proprietary Apple .model format?

The GLEssentials documentation provides a 3D model in a file format called .model. (click 'download sample code' at the top of the page and it's in GLEssentials/GLEssentials/Data/Assets folder) As it turns out, this is a fairly popular name for a file extension but if you read here you'll see the co...
Dylan
1

votes
0

answer
75

Views

Change opengl object vertices in Android onCameraFrme

I am making an application with Opengl and Opencv. Opencv identifies the corners of a square on the screen. I apply an algorithm that converts the screen coordinates of points into Cartesian coordinates into opengl, and I create the vertices. But each point taken from the four caught in the square i...
Tassio Gustavo
1

votes
1

answer
247

Views

Render fonts with SDL2, openGL ES 2.0 (GLSL 1.0) & Freetype

this is my first post here. I am working on an app that is intended for use on a raspberry pi 3 board. My target is to successfully draw graphics with the gpu instead of the cpu thus keeping the later available enough to satisfy cpu processing needs required by other parts of the app's program such...
1

votes
0

answer
133

Views

Is it possible to get SurfaceTexture dimensions?

I am working with SurfaceTexture and I need to figure out the image dimensions just from the SurfaceTexture object, I was thinking about using the OpenGL but this functionality is available only by using OpenGL ES 3.1, as this answer implies. Any ideas? I can't really store the texture dimensions a...
Martin Rončka
1

votes
0

answer
106

Views

Generating smooth normals in cpu for OpenGL

I'm trying to replace Assimp in my project and make a custom object loader. Assimp generates normals from vertices when aiProcess_GenNormals flag is supplied. It also generate smooth normals when aiProcess_GenSmoothNormals is given. Now, I'm generating normals from vertices but I couldn't achieve to...
Molomon
1

votes
1

answer
35

Views

Parts of model are occluded strangely in OpenGL

I'm rendering a barrel object in Android with GLES20. The barrel is not rendered correctly and it's not clear to me where the problem is (texture? model? culling? depth?): I've tried debugging with Google's debugger. The model can be rendered correctly in the debugger and the texture is also loaded...
Tim Guo
1

votes
0

answer
62

Views

Obtaining bitmap from a frame during a QuickBlox video call

I am using QuickBlox in an app with video calls that needs to work with the smart glasses device Moverio BT-300. I need to be able to get a frame as a Bitmap and save it in the device. After some research, I found multiple ways to do that, but had different problems with each one: Stopping the video...
N. Drabik
1

votes
0

answer
18

Views

Transfer GL Pixels into Camera pixels for broadcast

I have got a plugin that streams camera, However I need to draw over this so which I am doing through openGLES2.0. I need to transfer the pixels from GLES.ReadPixels() combine it with camera pixels and then send it to the broadcaster I don't know in what kind of format android camera pixel bytes wil...
Adish Redd
1

votes
1

answer
144

Views

Analog clock in OpenGL 2.0 using Java

Can someone help to make a static analogue clock in OpenGL 2.0 using Java? I used Bresenham Circle to draw a circle for the clock but is there any other way to draw a circle here? Then I drew an hour, minute, and second hand but I got an error in the render part while drawing the numbers. Can someon...
Awan
1

votes
0

answer
27

Views

How to understand glVertexAttribPointer with UnsafeMutablePointer by Swift 4.2?

I write some code about OpenGL ES. and I draw a triangle and want to put a image as texture on it. So I define a structure like this. struct SceneVertor { var postion : GLKVector3 var texture : GLKVector2 init(_ value:(Float, Float, Float, Float, Float)) { self.postion = GLKVector3(v: (value.0, valu...
ADDICE
1

votes
1

answer
58

Views

Could glVertexAttribPointer() last at attribute value in OpenGL be a array ?

Now I have two custom shader, the position vertex shader and the color fragment shader. And I define two array data, position Array and color Array. This can make the gradient triangel in the iPhone. I didn't call the glBindBuffer() and glBufferData() for the VAO. but in the glVertexAttribPointer()...
ADDICE
1

votes
1

answer
69

Views

OpenGL ES 2.0 Android - cube rotation bug

I implemented the visualization of a colored 3d cube with OpenGL ES 2.0 that is used for an android app. My goal: the cube should react to swipe events (left, right, up, down), then the cube should be rotated in the corresponding direction. The rotation: stops if (current_angle % 90 == 0) -> so yo...
Matthias Tietz
1

votes
0

answer
84

Views

Getting a texture from IOSurface in Metal

I'm trying to get a texture id from metal surface. I have two problems 1. That function is not defined GLint glTextureID = CGLTexImageIOSurface2D(self.mEAGLContext, GL_TEXTURE_2D, GL_RGBA , textureWidth, textureHeight, GL_RGBA , GL_UNSIGNED_BYTE, ioSurface, 0); I tried to include it #import OpenGL/C...
andre ahmed
1

votes
0

answer
42

Views

how to change light direction in opengl es 2.0

hey i am trying to rotate light direction in opengl es 2.0 but its not rotating pls help sorry for english these is my fragment shader precision mediump float; // Set the default precision to medium. We don't need as high of a // precision in the fragment shader. uniform vec3 u_LightPos;...
Tanishk Jat
1

votes
0

answer
239

Views

Building static Qt 5.12 by mingw, can't found GLES2

I got following error when building static Qt. ....\include/QtGui/../../src/gui/opengl/qopengl.h:111:13: fatal error: GLES2/gl2.h: No such file or directory # include Here is how I configured: cmd /c 'configure.bat -static -release -platform win32-g++ -prefix $QtDir ` -qt-zlib -qt-pcre -qt-libpng...
Jiu
1

votes
0

answer
50

Views

Send data from OpenGL shader to CPU memory

I'm highlighting every pixel on my 3D objects with red color, if the dot-product of my mesh triangle normal with vector (0, 0, -1) is larger than 0.73. It means, if my mesh triangle has a slope larger than a certain value: I'm using a fragment/pixel shader like this: #define FP highp varying FP vec3...
user3405291
1

votes
0

answer
23

Views

How do i reduce or fix the amount of graphics memory used by GlSurfaceView when applying android media effects to images in android?

I'm making an android application that uses GLSurfaceView and android media effects to apply filters to images.The implementation is working fine except it appears as if there's a memory leak in the app.With each addition of an effect the graphics memory used by the app increases significantly and t...
Naseem Kajuna
1

votes
0

answer
35

Views

OpenGL mesh/meshpart line thickness

In LibGDX 2d we can draw/define line thickness with 'lineWidth' e.g. shapeRenderer.rectLine(new Vector2(x1,y1),new Vector2(x2,y2),lineWidth); Is there a way to implement something similar in Mesh or meshpart without changing glLineWidth() value? Thanks.
merecoin
1

votes
1

answer
42

Views

Projection and Translation in OpenGL ES 2

I have a question regarding transformations in OpenGL ES 2. I'm currently drawing a rectangle using triangle fans as depicted in the image below. The origin is located in its center, while its width and height are 0.6 and 2 respectively. I assume that these sizes are related to the model space. Howe...
Grimfandango
1

votes
0

answer
34

Views

How to divide a texture to tiles and show border for each tile in webgl/opengl?

I am trying to work on a application that requires to split the image into dynamic x,y parts and process each part. For example : if a image is of dimensions 500 X 800, where width is 500 and 800 is height. I have to break the image using [32, 32] : xTiles = Math.ceil(500/32)=16; yTiles = Math.ceil...
subhfyu546754
1

votes
1

answer
52

Views

How to fix OpenGLES glDrawElements

When attempting to draw a cube loaded from an .obj file all triangles share a single point. Additionally not all of the triangles seem to be rendering. I've noticed that changing the vertex count for glDrawElements allows the other triangles to draw, but am uncertain as to why the number of points w...
TheINCGI

View additional questions