Questions tagged [opengl]

OpenGL (Open Graphics Library) is a graphics standard and API which is platform-independent and available for desktop, workstation and mobile devices. It is designed to provide hardware-accelerated rendering, and hence gives greatly improved performance over traditional software rendering. OpenGL is used for applications like CAD software and computer games. The OpenGL standard, as well as OpenGL ES, is controlled by the Khronos group.

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

Question about using glVertexAttribArray

After defining an attribute pointer, why can't I just reuse it? I have a VAO bound so shouldn't it just accept the AttributePointer I defined with the last VAO? ...
0 votes
1 answer
26 views

store GL_TEXTURE_CUBE_MAP_ARRAY data to CPU

I have a GL_TEXTURE_CUBE_MAP_ARRAY texture of 8 cube maps (countLayers). Now I am trying to transfer the pixels to CPU. Currently I am using this code: ...
1 vote
1 answer
64 views

Why is there a straight line between my bezier paths?

I have created a bezier curve tool and each time I draw a bezier curve segment I get a straight line between each mouse click. I don't understand why this is happening and was wondering if someone ...
0 votes
0 answers
20 views

The Definitive Computer Graphics Book guide? [migrated]

There are quite a lot of online resources and videos available to learn OpenGL / DirectX or computer graphics in general. However, I often struggle to get my mind around a topic when sources are given ...
0 votes
1 answer
54 views

3D head mesh morphing from one mesh into another using coding

I have 2 3D head images and want to morph one into the other (animation) without using blender etc. I want to do it using coding preferably using C++, C# or python(libraries are ok). I have done 2D ...
0 votes
1 answer
541 views

Translate an arcball camera upwards or left-right

This problem is giving me a really hard time. I'm always looking at the origin and have a camera that moves around it in an arcball mode. That part works beautifully: I'm calculating the camera ...
0 votes
1 answer
32 views

Lines not disappearing after being drawn in OpenGL

I am creating a Bezier curve tool in OpenGL and every time my program draws something in motion with cursor coordinates I see the previously drawn lines on the screen for a second or two before they ...
0 votes
1 answer
30 views

How to detect when left mouse button is released in GLUT after being held in motion?

I am trying to detect when my left mouse button is released to store the result in a boolean variable in OpenGL GLUT. Currently, I am using the motion() function in ...
0 votes
1 answer
54 views

How to get coordinates of mouse after left mouse button is released after drag in OpenGL?

I want to get the coordinates of my mouse after the left mouse button is released after being dragged in OpenGL? I am new to this and wanted to know how I can implement it.
0 votes
0 answers
13 views

Bind shader storage buffer object for vertex input

I'm trying to learn about compute shaders, and as such decided to give it a go at implementing the particle system described in these slides: https://www.khronos.org/assets/uploads/developers/library/...
0 votes
0 answers
29 views

geometry is invisible when culling front faces

I am trying to implement shadow mapping. Therefore I am trying to render the back faces of the geometry to reduce the shadow acne. When culling back faces everything works (the geometry will be ...
0 votes
2 answers
46 views

How to get coordinates of opposite direction from mouse release point relative to a point?

I am trying to implement the pen tool from Adobe Illustrator in OpenGL. I am trying to get the coordinates of the reverse tangent upon mouse release. I tried negating the coordinates I got upon mouse ...
1 vote
0 answers
29 views

Variance Shadow Mapping (Shadow occurs when normal vector is close to light direction)

I am implementing Variance Shadow Mapping from Nvidia GPU Gems 3 Chapter 8: Summed-Area Variance Shadow Maps There they are talking about clamping the minimum variance to a very small value. I did ...
0 votes
1 answer
29 views

Is it possible to convert Polar to Cartesian coordinates and map result to an image using opengl?

Is it possible to convert Polar to Cartesian coordinates and map result to an image? I want to get the output same as the distort depolar 0 from image magick. https:...
2 votes
1 answer
81 views

How Anisotropic filtering works

I would like to understand how anisotripic filtering works in gpu. Specifically what is the minimum state in which the texture needs to be in for anisotropic filtering to work. by state of the texture ...
1 vote
0 answers
15 views

GLFW: create embeddable opengl child window and set parent on Mac?

Is this possible with GLFW? AFAIK you can't use GLFW to create a child window per se, so the question probably boils down on how to turn a GLFW created, opengl enabled window into a child window and ...
2 votes
2 answers
50 views

what is the output from rasterizer

what exactly does the rasterizer outputs as per my knowlage it outputs primitives rasterized as fragments which seems correct as the next step in vulkan/opengl is fragment shader but dx confuses me ...
4 votes
1 answer
237 views

How to set the GLFW OpenGL target?

I'm programming on a Mac and I'm learning OpenGL in the library GLFW. My problem is that my Mac supports OpenGL up to version 4.1, but when I try to compile the shaders with ...
1 vote
1 answer
36 views

mipmap selection process

I wished to understand which mip map in the chain of mips is selected upon sampling a texture.Which factors it depends on.I know that it depends on the area of the texture visible. I tried a simple ...
0 votes
1 answer
100 views

OpenGL blending with the screen

I don't understand how OpenGL performs the blending of a texture on the screen. By default, the clear color is set to (0, 0, 0, 0). If we use the default blending equation GL_SRC_ALPHA and ...
1 vote
2 answers
281 views

OpenGL transparency - object behind is not rendered

I'm trying to implement voxel world using OpenGL (Core 3.3). I've come across a problem with transparency. It looks like sometimes GPU decides to not render stuff that would be important. Can you help ...
5 votes
2 answers
3k views

What's the point of "work groups" for OpenGL compute shaders?

glDispatchCompute has the number of work groups as arguments. What is the point of having work groups? How are they useful, compared to just having NxM independent pixel calculations with a known (x,...
2 votes
2 answers
3k views

Debugging tools for OpenGL on macOS

I am porting some code from Metal to OpenGL since we want to run our app on Windows too. Xcode is my preferred IDE, but the newer versions of Xcode do not support any OpenGL debugging. Question: What ...
2 votes
1 answer
862 views

Is there different between 'if' and 'ternary operator' in GLSL?

I'm practicing GLSL on ShaderToy ...
12 votes
2 answers
3k views

Derivative maps vs. Tangent Space Normal maps

I discovered that some engines use derivative maps instead of tangent space normal maps. After some reading, it seems to be a really awesome way to replace tangent space normals but are there some ...
0 votes
1 answer
171 views

Efficiently transferring only needed parts of the vertex data to the GPU (C++/OpenGL)

I have a situation, where I have an array of vertices on the CPU side, for which, besides rendering-relevant data, like their position, I have a lot of other data at each vertex. All vertex data is ...
0 votes
1 answer
74 views

Keep constant number of visible circles in 3D animation

I have created a 3D animation with a perspective projection of white circles moving randomly in a fake 3D space projected on a 2D computer screen (GIF 1). Since I need to keep the same number of ...
0 votes
0 answers
48 views

Vulkan abstraction similar to OpenGL?

Because OpenGL is deprecating, I was wondering where to position myself to keep on learning graphics programming in the years to come on the same level of abstraction as OpenGL ? I don't want to go ...
-1 votes
1 answer
58 views

How to deform an object in glsl? (processing)

I am a beginner in glsl and processing. I have a cube, can I know how to deform it using mathematical or progammatical functions? ...
3 votes
1 answer
31 views

using parts of GL_TEXTURE_2D_ARRAY as GL_TEXTURE_CUBEMAP_ARRAY

I am using layered rendering for all my light sources to avoid rendering multiple times. I have lightSourceCount many point lights and one sun, which is implemented ...
0 votes
0 answers
49 views

Inter-Process communication in compute shaders

How do I write a code to facilitate common shared memory for communication between multiple shaders as well as processes within them in python?
1 vote
0 answers
64 views

Generating cheap perfect outlines for meshes in WebGL

I am tasked with creating an outline shader in WebGL (i'm using WASM/Emscripten, so an OpenGL solution will work too) for meshes that the user can upload into our software (be it .obj, .fbx, .3ds), ...
1 vote
1 answer
62 views

SSAO with reconstructed depths yields strip artifacts

I wrote an ssao algorithm with compute shaders and view-position-reconstruction from the depth buffer. It works great for objects near by but results in strip or banding artifacts for large planes ...
1 vote
1 answer
54 views

Combining multiple textures within Framebuffer to use them in layered rendering

I have a scenario with several cameras. Each hold its own color and depth texture. Because the geometry of the environment is expansively procedural generated, I would like to combine cameras with ...
1 vote
1 answer
154 views

Problem using Decaling with Stencil to avoid Z-fighting

I need to create a decaling into a surface like a mesh, and to avoid Z-fighting I've been using Stencil Buffer to Turn-off depth test and make the decaling over the surface the Stencil Op permits. In ...
0 votes
1 answer
66 views

How do I view my vertex colors that I specified through the texture I've applied on my objec [OpenGL]?

I thought that if I used an image with a transparent background, I would still be able to see the colors I had specified in my vertex attribute buffer. ...
0 votes
1 answer
342 views

Unity: Pass texture pointer from OpenGL to Unity

I'm working on a scene in Unity where I have textures loaded at runtime. As a result of that, the scene is being slowed down (even with co-routines), so I thought maybe I could move the texture ...
0 votes
1 answer
976 views

Drawing a cube and wireframe opengl

I'm trying to render a cube and it's wireframe together using OpenGL The main function is this: ...
0 votes
0 answers
48 views

OpenGL Compute Shader Vector Subtraction Not Working As Expected

all. I am currently working on a compute shader in GLSL intended to simulate visualizations of general relativity by ray tracing in the Schwarzchild spacetime geometry. I'm about halfway through ...
0 votes
1 answer
894 views

Errors on Compiling my first program on OpenGL on Ubuntu

I am trying to run the following program on ubuntu 15.04. However on typing "g++ pgm1.cpp -lglut" I am getting following errors /usr/bin/ld: /tmp/cc9aXqhZ.o: undefined reference to symbol '...
0 votes
1 answer
195 views

OpenGL state management

I am working on a software with lots of different shaders, which require different states in OpenGL. My problem is the following: The different models with different shaders are not rendered in the ...
1 vote
1 answer
162 views

Opengl GLSL binding locations confusion

The background of this question is that I am trying to write an automatic binding system, where for each uniform variable I want to declare in my GLSL code, I call a method ...
3 votes
1 answer
35 views

enable / disable transform feedback within glsl for specific primitives

I am using the tessellation shader stage to increase the density of triangles close to camera. Thereby when the camera is too close to a triangle, so that the maximum tessellation is not high enough, ...
0 votes
0 answers
53 views

Mathematical foundations of Signed Distance Fields in computer graphics

I have come across Signed Distance Field usage in Computer Graphics in construction of vector shapes, glyphs and 3D surfaces. However I can not find much of the background mathematical theory as to ...
0 votes
0 answers
37 views

OpenGL: storing several textures to texture2dArray and exchange them continuesly

I try to render extreme large landscapes, which are deformed by height-maps. Each area has several level of detail height-maps. Other textures are structured like the height-maps as well, so that all ...
1 vote
1 answer
176 views

PNG textures render correctly in Blender, but not in OpenGL program

I've been following the OpenGL tutorials from ThinMatrix and I've been able to load and render his stall.obj model along with his stall.png texture just fine. But when I try with my own models and ...
1 vote
0 answers
63 views

OpenGL ignores glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

I'm learning OpenGL for a personal project. I need to draw a triangle mesh as a wireframe. From what I've read, I can do this using glPolygonMode. However, the program always draws my polygons filled. ...
10 votes
3 answers
5k views

How to do texturing with OpenGL direct state access?

How do you use textures with direct state access in OpenGL? I have the following in my code, which seems to work: ...
0 votes
0 answers
56 views

Precision problems when rendering whole planets

I'm trying to implement a camera, which is able to go very close to a planet/moon surface, without flickering surface. The problem: Right now the position of a planet / moon is saved at the center of ...
3 votes
1 answer
132 views

vulkan perspective matrix vs opengl perspective matrix

Hi I have a slight confusion in using the opengl perspective matrix in vulkan. glm's perspective matrix works directly in vulkan just by multiplying the "[1,1 term by -1 but when I compared the ...

1
2 3 4 5
14