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
0 answers
90 views

Calculating the intersection of two volumes

What is an efficient way to calculate the volume of intersection of two arbitrary volumes described as closed surfaces? That is, with two meshes, A and B, how do I calculate the intersection of A and ...
Ethan Reesor's user avatar
1 vote
1 answer
501 views

how to change the near clipping plane of a perspective projection matrix for OpenGL

I am trying to only change the near clipping plane of a given perspective projection matrix for OpenGL. My problem is, that the near clipping plane is way too close, and the far clipping plane is very ...
Thomas's user avatar
  • 1,136
0 votes
1 answer
84 views

DirectX FVF(Flexible Vertex Format ) equivalent in OpenGL/Vulkan?

Is there any directX FVF(Flexible Vertex Format ) equivalent in OpenGL/Vulkan.
Cerberus's user avatar
0 votes
0 answers
161 views

List all faces of a mesh visible from the view of the camera Opengl

as the question suggests I have to identify all the faces that are visible from the camera's view and do some processing with them. I have a single mesh. I am thinking of giving individual faces a ...
Argha Chakraborty's user avatar
1 vote
1 answer
736 views

glBlitFramebuffer does not copy all textures

The setup I have a working bloom shader implemented which creates a fbo with two textures attached to it. The first texture holds the entire scene The other only displays objects which are supposed ...
チーズパン's user avatar
2 votes
2 answers
330 views

How does a Vertex Buffer manage memory?

I'm learning OpenGL and I'm trying to understand things properly. If my understanding is incorrect at any point, please correct me. Introduction So let's say we have a triangle. This triangle has its ...
Sherlock Holmes's user avatar
0 votes
1 answer
509 views

Can I write histogram equalization, blurring, sharpening grayscale image etc.. as shader programs with openGL?

...
Meganathan's user avatar
0 votes
2 answers
213 views

Why do Nvidia and AMD have to update their drivers for game releases?

I like to know the technical aspects of it. Game developers use APIs like OpenGL or DirectX. The functions provided by these APIs, I would assume, work flawlessly with all graphic cards because they ...
AliceTheCat's user avatar
1 vote
1 answer
222 views

How to use trackball for rotating an camera matrix in eye frame

I have a QOpenGLWidget where I use camera transformation matrix(4,4), FOV and vectors Position(4), Up(4), Forward(4). I also have an ArcBall which I can use. I managed to implement zoom and pan by ...
nocturne's user avatar
  • 111
0 votes
1 answer
198 views

rendering a triangle has no color

I wrote a program to render a simple triangle with colors, the triangle is there but there's no color. ...
Gamer's user avatar
  • 1
0 votes
1 answer
624 views

How can I bind my texture in the correct orientation?

I have successfully completed a working program that draw a rotating sphere with a map of the world as the texture, simulating the earth in space. However, the texture is bound on it's side, i.e. all ...
HSON's user avatar
  • 1
0 votes
2 answers
1k views

How to calculate vertex normals on a mesh with non-planar polygons

If I have a mesh consisting of polygons that are not necessarily triangles and not necessarily planar. As answered in the previous question I asked, there's no correct answer to calculating normals ...
Lenny White's user avatar
0 votes
1 answer
300 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 ...
Jojolatino's user avatar
2 votes
1 answer
5k views

Performance difference in OpenGL compute shader vs Vulkan Compute Shader vs Cuda/OpenCL and others

I have been told there is no performance difference if you are skilled enough when it comes to gpu computing. And cuda only performs better because nvidia wants it to. I have also read graphic api's ...
VIVEK Yadav's user avatar
1 vote
2 answers
591 views

Is there an efficient way to achieve color blending in compute shaders?

What I want is a function like imageStore, but instead of replacing a value - applying a blend operation to it, e.g. addition. It is not possible to do something ...
user369070's user avatar
0 votes
1 answer
412 views

My OpenGL program is not drawing filled polygons

I'm trying to learn OpenGL in c++ (I used it in Java) but I have a problem, I make a triangle, but it doesn't draw on GL_FILL and in GL_LINE it just draw a line, I can't find my mistake, I guess my ...
Yair Camborda Morocho's user avatar
0 votes
2 answers
1k views

Does Vulkan have the equivalent of OpenGL's separable shader program and pipeline?

If you have a shader pipeline in OpenGL that goes something like the following: ...
Zebrafish's user avatar
  • 131
1 vote
1 answer
3k views

Understanding fragment shader coordinate system

I'm trying to create an infinitely panable grid using fragment shaders (C++/OpenGL/GLSL), and I'm having a bit of difficulty understanding the coordinate system. This is my fragment shader code, ...
Andrew Woo's user avatar
2 votes
1 answer
46 views

Understanding inequality to equality in the Hartmann & Gribbs frustum planes extraction method

I've been reading this article on how to extract the plane equations from the view and projection matrices. And I can understand most of it. However, the only thing that is unclear to me (and that ...
Hirosam's user avatar
  • 23
1 vote
1 answer
485 views

Opengl : GLSL utility files

We can create header files in C/C++ which we can include in our project using #include directive but when I use this keyword in my shader it gives the error reserved keyword. If let's say I create an ...
Sync it's user avatar
  • 169
0 votes
0 answers
109 views

How can I render a triangle mesh at 10bit (or 12bit or 16bit) channel depth color?

For a vision research experiment, I have a monitor that supports 10bit/channel (=30bit color). I want to render a triangle mesh in a simple scene that uses the full bit depth, and I want to save this ...
Will Sni's user avatar
0 votes
1 answer
775 views

fastest way to "read only" from buffer

First of all I have a struct which looks like the following: ...
Thomas's user avatar
  • 1,136
5 votes
0 answers
779 views

How to implement PCSS correctly?

I'm trying to implement PCSS in OpenGL/GLSL, but I have problems understanding the details especially the conversions between the coordinate spaces. The existing implementations are so different from ...
racz16's user avatar
  • 151
1 vote
1 answer
1k views

GLSL Compute Shader Setting "shared" memory buffer size

Is it possible to set the size of the shared memory of a compute shader workgroup from the host code? There is a way to do this in CUDA and I am suspecting that, since there is an GLSL extension to ...
Vectorizer's user avatar
1 vote
0 answers
337 views

Is OpenGL to Metal translation layer plausible?

I am not sure if I understood it correctly, but OpenGL is high-level like Java and Metal is low-level like Assembly, aren't they? Apple seems to have abandoned OpenGL in favour of Metal, but there ...
Damn Vegetables's user avatar
0 votes
1 answer
270 views

imageLoad() behavior for non-existent texel

Is there a way to influence the behavior of imageLoad() for accessing an image2D or uimage2D ...
Vectorizer's user avatar
0 votes
0 answers
742 views

Using multiple textures in a shader

Background: I am extracting the textures for a model with Assimp and sampling those textures in the fragment shader. I have multiple uniform sampler2D textureN ...
MasterReDWinD's user avatar
1 vote
1 answer
184 views

OpenGL layered rendering with multiple additional clip planes per view

I want to render a scene from multiple positions and orientations. I think the geometry shader is a good choice to not use the Vertex and tessellation shaders for each camera position again. So I want ...
Thomas's user avatar
  • 1,136
1 vote
1 answer
365 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 ...
lealericsson's user avatar
1 vote
1 answer
2k views

is focal length equal to the distance from the optical center to the near clipping plane- openGL

The part confusing about opengl during studying the projection was that the focal length, top, left, bottom, right, wasn't declared, and it magically did it with FOV and image aspect ration. I ...
juztcode's user avatar
  • 117
0 votes
1 answer
164 views

algorithm that openGL uses to construct 3D surface from vertices

a 3D model is a collection of points, and basically a 3D software has algorithm to find out how those points connect to make surfaces. I'm searching for what those algorithms are called, that can use ...
juztcode's user avatar
  • 117
3 votes
0 answers
554 views

Comparing different sampling methods for GGX IBL

I have made a demo that shades a sphere with an environment map. I wanted to compare 3 different ways of sampling the environment. Uniform sampling. Importance sampling with the NDF as suggested in ...
user1754322's user avatar
1 vote
0 answers
303 views

OpenGL: "invalid value" error after call to `glGetBufferSubData`

My first question in this community. I have following code.The code is shortened for clarity, error checks skipped: ...
user14063792468's user avatar
1 vote
2 answers
548 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 ...
user avatar
0 votes
1 answer
263 views

OpenGL Polygon Offset Fill implementation example code

I am working on a pure java implementation of OpenGL 1 called jGL. I am missing glPolygonOffsetFill and am looking for an example implementation in java, c/c++ example of this GL function in order to ...
Martin Pernollet's user avatar
1 vote
1 answer
419 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 ...
Russel's user avatar
  • 11
-1 votes
1 answer
275 views

Render fragments with uvs outside (0,1) range as transparent

I'm rendering an image onto a mesh. And I need to render fragments with uv coordinates that fall outside (0,1) range with full transparency. In the code below I'm specifying a border color with zero ...
Lenny White's user avatar
0 votes
1 answer
46 views

Equally distribution on triangle surfaces

I would like to implement a random placement for objects like trees stones etc. on a triangles surface. The important part is to have an equally probability to place an object on this surface. That ...
Thomas's user avatar
  • 1,136
2 votes
0 answers
82 views

Atmospheric scattering band/seperation artifact

I am currently experimenting with some atmospheric scattering in glsl in my OpenGL engine. I am experiencing a strange phenomena where a strange band / separation artifact appears along the middle of ...
user10037795's user avatar
1 vote
0 answers
107 views

GL_OUT_OF_MEMORY Error when glDispatchCompute takes longer

I built a simple Ray Tracer which takes use of OpenGL's Compute Shader and traces ".obj" Files. The results are passed to the Host-Program via glMapBufferRange after finishing computing. ...
herrmutig's user avatar
0 votes
0 answers
284 views

Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist as follows: ...
Pooper's user avatar
  • 1
0 votes
0 answers
61 views

What sort of implementation dependent limits for glPointSize can one expect from modern graphics cards?

As noted here, when rendering using the GL_POINTS primitive, there is an implementation dependent limit to the point size range. I intend to use GL_POINTS for fast billboard rendering of particles, so ...
user avatar
0 votes
1 answer
111 views

Operations in the Rendering Pipeline

I have a few short question regarding operations happening in the rendering pipeline (OpenGL, Vulkan, I'd expect for all questions to have similar answers for these two frameworks while DirectX might ...
Anima's user avatar
  • 167
0 votes
1 answer
4k views

Drawing a square using glDrawArrays with GL_TRIANGLES

I used a version of the following code to draw a triangle using glDrawArrays with GL_TRIANGLES, per Anton Gerdelan's very nice tutorial here: Hello Triangle ! It draws a nice triangle. I have modified ...
Simon's user avatar
  • 163
0 votes
2 answers
759 views

Using imageLoad/imageStore to perform atomic add

I have a rgba16f texture that I fill with values using nvidia GL_NV_shader_atomic_fp16_vector extension, which allows to perform ...
mdkdy's user avatar
  • 2,119
0 votes
0 answers
105 views

Packing a GL_RGB from three separate buffers?

I'm decoding an .mp4 to use as a texture on a tristrip. It's easy enough to use an unsigned byte array of RGB triplets to create this texture, but frames come out ...
Sniggerfardimungus's user avatar
0 votes
1 answer
90 views

Problem sampling uniformly envmap with GGX

I have made a program that samples uniformly an environment map and computes the lighting using the GGX BRDF. I have made a small example that reproduces the issue I'm having. You can check it out ...
user1754322's user avatar
2 votes
2 answers
3k views

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

I'm practicing GLSL on ShaderToy ...
Oh Seo's user avatar
  • 31
0 votes
0 answers
108 views

Different OpenGL behaviour on Windows and Ubuntu

While porting this project with slightly modified code to Linux I ran into some weird behaviour. On Windows it runs just fine (https://youtu.be/xH6Dc6xOuow). But on Ubuntu it shows some weird ...
Clutterhead's user avatar
2 votes
1 answer
282 views

Using instanced arrays for dynamic objects

With the help of instanced arrays we can specify an array of transforms and render a number of objects with a single render call. I'm wondering if using instanced arrays make sense in situations where ...
Lenny White's user avatar

1 2 3
4
5
15