Questions tagged [opengl]

21949 questions
1

votes
1

answer
68

Views

OpenGL storing variables per shape without any duplicates

I've been working on a sprite renderer, and I have rectangles being rendered correctly, but now I want to rotate them and perhaps add textures to the endeavor. However, I don't know how to store the angle, for example, without duplicating the data. Currently, every vertex has its position, and it wo...
Whiteclaws
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
1

answer
139

Views

OpenGL compute shader premature abort after calling glComputeDispatch

I have been trying to run a very simple counting compute shader to get a grasp on how many times my shader runs and how large of a compute array I can process. It seems that I'm either hitting some driver limit or my shader takes too long for the card to execute so it is prematurely aborted or some...
Martin
1

votes
1

answer
132

Views

Code of Computer Graphics not compiled or installation failed

I followed instruction described http://www.cse.iitm.ac.in/~vplab/courses/CG/opengl_start.html that is as following - OpenGL (GLUT) on Linux (Ubuntu) Installation Install the following packages from the ubuntu repository: 1. freeglut3-dev 2. mesa-common-dev sudo apt-get install freeglut3 freeglut3...
1

votes
1

answer
248

Views

LibGDX optimize way to draw background with large resolution

I have a problem that has been torturing me for a month, and maybe more. There is a large background of about 9000x13000 pixels. And I am trying to bring this background to the screen. Since my video card only supports textures with a resolution of not more than 8192x8192 pixels, a black area is dis...
Ryder95
1

votes
0

answer
178

Views

C++ Can I use OpenGL framebuffer without seeing the window?

I have an OpenGL application, that displays a camera frame with some 3d elements rendered on top of it. What i am trying to do is use openGL to combine the frame and elements, but then display the image with OpenCv, and not show the OpenGL window. Is this possible? The current code is: int main() {...
anti
1

votes
0

answer
296

Views

What do glAttachShader and glLinkShader actually do?

As these steps are followed to create a shader program which can later be used to draw an object on the screen. glCreateShader -> glShaderSource -> glCompileShader -> glCreateProgram -> glAttachShader -> glLinkProgram -> glUseProgram What does glAttachShader do? Does it copy shader object inside...
user2259784
1

votes
1

answer
52

Views

Newly Build APK in Unity Crashes

On my logcat the error says version 100 01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef SHADER_TARGET 01-09 11:34:55.899 23467-23515/? D/Unity: #define SHADER_TARGET 30 01-09 11:34:55.899 23467-23515/? D/Unity: #endif 01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef UNITY_NO_DXT5nm 01-09 11:34:55...
NoobProgrammer
1

votes
0

answer
172

Views

CUDA OpenGL interop with persistent buffers

I am working on some video stuff where h264 video gets streamed over RTP. So far, I was using a CPU decoder, decoding data in a separate thread and writing to a persistent mapped OpenGL Pixel Buffer Object, and doing a glTexSubimage2D copy every time a frame is done (so rendering FPS is not limited...
pettersson
1

votes
0

answer
78

Views

what is proper way to update vao/vbo between thread?

Here is the problem I came across: I read 3d model data in a thread and render it in main thread. What is the proper way to create or update vao/vbo data? Currently I set a bool value to indicate that whether main thread need to update vbo data, like this: void RenderModel(){ if(isNeedUpdateVBO){ up...
Damons
1

votes
2

answer
146

Views

Not getting an output for OpenGL to print line using mouse click

My aim is to draw a line using mouse click. When you click the first click it reads the coordinates then when for the nest click it will draw the line using GL_LINES with first and second points. int first, x1, yi, x2, yj, ww = 600, wh = 400; void drawl() { glClear(GL_COLOR_BUFFER_BIT); glLineWid...
GauthamGAjith
1

votes
0

answer
276

Views

How to get pitch correctly with GLM?

I am trying to limit rotation of the camera around X axis by 90 degrees. My camera uses glm::quaternion to store orientation in space. For changing camera pitch angle I use the code: m_orientation *= glm::quat(vector3(glm::radians(angle), 0.0, 0.0)); And later I extract pitch angle I use: float pitc...
Nikolai Paukov
1

votes
1

answer
872

Views

Reading depth buffer with PyOpenGL

Basically, I'm trying to extract a depth map (by this I mean a matrix with z corresponding to z-coordinates for vertices in GL.glVertex3dv(vertex) call - obviously, interpolated for plane pixels) after rendering a model (script is loading the model from file with path specified as the first command...
Andrey K.
1

votes
0

answer
71

Views

Writing an unmanaged c++ code that depend on managed code

I am trying to write a basic wrapper for assimp library in c++ to use it in C# code, also this c++ wrapper depends on a C# library I have written it in the past, and I do not have much knowledge in wrappers, so could you please help me. here is the header file: #pragma once using namespace System; u...
O-BL
1

votes
0

answer
56

Views

lwjgl throws errors when added to an android project

I have spent the past week working on trying to get lwjgl to work in eclipse for an android project but whenever I add the jars I get an error saying Dx unsupported class file version 53.0 I have googled this but all i can find is the error for 52.0. i do know that android projects already support...
Arcxz
1

votes
0

answer
57

Views

SDL2 / OpenGL program works on one PC but not on the other

On my Desktop PC (Linux, OpenSuse 42.2, GraKa: Nvidia GTX 960) the program down below works fine. It opens a window with three axes X, Y, Z in red, green, blue and you can use the arrow buttons to move the camera around the axis. On my Linux Laptop (OpenSuse 42.3, Mesa DRI on Intel 5500) the progra...
Torsten Mohr
1

votes
1

answer
48

Views

Process crashes when unsetting glXMakeContextCurrent

I didn't encounter this bug a couple of years ago (last time I ran headless OpenGL context on Ubuntu). I create headeless GL context according to this example. I have zero issues with creation and running the app using this context. However,when I perform cleanup before shutdown, the moment this lin...
Michael IV
1

votes
1

answer
187

Views

OpenGL Unprojecting mouse cursor to find relative position to a certain object?

I have a player object that's moving around the screen. The camera is a fixed camera, looking down on the player (like in Diablo). Now I want the player object to rotate towards the mouse cursor. The player is not always on the center of the screen (for this case I already have a solution). In order...
3DLearner
1

votes
0

answer
164

Views

Lighting not working in SharpGL

I've got a problem with lighting in SharpGL - I tried everything, and the result is still gray object. What am I doing wrong? How can I get it to work? I want to get some shading effect, just anything. Here's my code: private void Draw(OpenGL _openGl, float _rotateX, float _rotateY, float _rotateZ)...
Raven
1

votes
2

answer
531

Views

ARCore - reading superimposed image (screenshot of an AR scene)

I've been experimenting with ARCore for the past few months. I have read almost all the documentation. Talking in reference to the sample app, what I want to do is to extract the superimposed image from the app i.e a frame containing the camera texture and also the bots drawn by opengl (like a scree...
Tushar Rain
1

votes
1

answer
157

Views

Unable to add OpenAL library in Qt Creator

I want to add an audio library into my project but when I try to do this, I get this error message: cannot find -lOpenAL32d cannot find -lEFX-Utild error: ld returned 1 exit status I added the libraries by 'add library' and then I chose the correct paths to OpenAL 1.1. I'm not sure what I'm doing wr...
Kacper Gutowski
1

votes
1

answer
104

Views

How to get the contents of a UIView even if it is being rendered with gl or metal

I would like to get the contents of a UIView. The UIView is offscreen and another library is rendering content to the view. I believe the library is actually rendering to an underlying GL or metal surface. When I try renderincontext i only get the UI elements within the view (like sliders, butto...
Pineapple Joe
1

votes
0

answer
371

Views

Streaming several (YUV) videos using OpenGL

I'm trying to do high-throughput video streaming using OpenGL. I thought I'd figured it all out with my genius programming architecture, but - surprise - when doing more serious tests, I've been stonewalled with a performance problem. The story goes like this: It all starts by reserving a stack of...
El Sampsa
1

votes
1

answer
44

Views

Where is the camera in OpenGL perspective projection?

I'm playing around with openGL and encounter a strange problem. Code that defines my frustum: glFrustum(0.0, 50.0, 0.0, 50.0, 5.0, 35.0); Code that generates the polygon and the curve glBegin(GL_POLYGON); // a rectangle glVertex3f(20.0, 20.0, -6.0); glVertex3f(20.0, 20.0, -10.0); glVertex3f(20.0,...
Manh Nguyen Huu
1

votes
0

answer
59

Views

Shader two outputs feedback

I want to get two outputs from my shader, then feed them back into the shader to use as an iterator och accumulator. This works fine for the default 'channel', but for two... So, here are the shaders: #version 420 uniform sampler2DRect inData0; uniform sampler2DRect inData1; out float outData0; out...
user3162781
1

votes
2

answer
95

Views

Opengl/SDL2 Help on accessviolation error on nivida cards

So my code is GLCore.TriFromRect(rect1,ref cords); GLCore.glVertexPointer(2,GlEnums.GL_FLOAT,0,cords); GLCore.glDrawArrays(GlEnums.GL_TRIANGLES,0,6); For drawing a rectangle. Im complieing to an opengl version 2.0 this is the version i want to support. My current code above works on anyother compute...
Courtney The coder
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
1

answer
233

Views

Use RGB texture as alpha values/Subpixel font rendering in OpenGL

Currently I'm using FreeType in subpixel mode and take the largest color of each pixel as alpha value, with the following fragment shader: uniform sampler2D Image; uniform vec4 Color; smooth in vec2 vVaryingTexCoord; out vec4 vFragColor; void main(void){ vec4 color = texture(Image, vVaryingTexCoord)...
weltensturm
1

votes
2

answer
102

Views

OpenGL only blank screen when drawing triangle

This program is written in CodeBlocks. I already add options GL and SDL2 to build options -> Linker settings . When building and running this program in CodeBlocks I got no errors but only saw a blank window when it should be a triangle. I also tried using command line g++ main.cpp -o main -lGL -lSD...
redlcamille
1

votes
0

answer
467

Views

What is wrong with my installation of glfw3?

I tried to build glfw but something seems wrong with my installation with cmake under windows. I tried to do the following steps to build the glfw-library with cmake: git clone https://github.com/glfw/glfw cd glfw mkdir build-MinGW32 cd build-MinGW32 I then produced the build system 'MinGW Makefiles...
Robert
1

votes
0

answer
280

Views

Use Javafx with lwjgl by swingNode and Canvas

For my project in lwjgl I need javafx component. For controller and I need to use lwjgl and javafx. I try to put lwjgl inside Pane javafx by SwingNode and (canvas in Java I swing). But I do not get the correct results. Can anyone help me? I tried to apply this after reading previous publications on...
CoderMohammad
1

votes
1

answer
341

Views

Reflecting scene by plane - mirror in openGL

I'm trying to create scene with flat planar mirror using stencil buffer. I'm stuck at the point when I'm trying to reflect my eyepoint for the second render pass as depictured here https://www.opengl.org/archives/resources/code/samples/advanced/advanced97/notes/node90.html. What transformation do I...
Modelowy
1

votes
2

answer
143

Views

How to generate a plane using GL_TRIANGLES?

Is there an algorithm that could be used to generate a plane using the GL_TRIANGLES primitive type? Here's my current function: Mesh* Mesh::CreateMeshPlane(vec2 bottomleft, ivec2 numvertices, vec2 worldsize){ int numVerts = numvertices.x * numvertices.y; float xStep = worldsize.x / (numvertices.x -...
The Guy
1

votes
1

answer
113

Views

How to fit and center a texture into a square in OpenGL?

I need to fit and center a png image into a square, but I can't figure out how to do this. I initialized the vertex byte buffer for the square and used the same coordinates for the texture (vertexBuffer). This is part of my java class: private int textures[] = new int[1]; float color[] = { 0.636718...
V. Apix
1

votes
1

answer
293

Views

Why doesn't the Android Studio AVD allow me to select GLES 3.0?

The Android Developers website says that the emulator in Android Studio 3.0 supports OpenGl ES 3.0 for Android Oreo system images. Here is the article: https://android-developers.googleblog.com/2017/10/android-studio-30.html However, I have not been able to select GLES 3.0 from the graphics selectio...
DuaneG
1

votes
0

answer
307

Views

Fragment shader for mtl files

I'm trying to load an .mtl file to shade an object for OpenGL. The objects I'm loading are coming from Google's Poly library so I know they're valid and I believe something is wrong with my shader script. My starting point was the shader provided on Google ARCore sample object_fragment.shader. Since...
TheHebrewHammer
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
0

answer
166

Views

Which is the FASTEST image loading library?

I am currently using stb_image to load textures of 3D models. For the 'sponza' model, there are 63 textures to load (including diffuse color textures, normal maps, height maps, etc.) and this takes several seconds. I want these textures to load faster. Are other image loading libraries faster than s...
j00hi
1

votes
0

answer
67

Views

Is separate shader objects available in OpenGL 3.1 by default?

I have an issue with my code on Android. I'm trying to use glGenProgramPipelines on my OnePlus 3, with OpenGL ES 3.1 and sady during calling this method, the app is crashing. So my question is: Should these methods be available in OpenGL ES 3.1 or do I still need 'ARB_separate_shader_objects' extens...
kkszysiu
1

votes
1

answer
681

Views

custom clipping shader on top of standard shader? (unity)

I want to draw a horizontal line on an object with shader code (hlsl). The clipping shader simply takes the distance to a given Y-coordinate in the surface shader and checks if it is higher that a given value. If so it will discard. The result is a shader that simply clips away all pixels that are...
CarpoSep

View additional questions