Questions tagged [opengl-4]

OpenGL 4 is the current iteration of the OpenGL standard, designed to reflect newest capabilities of modern GPU in 3D rendering. OpenGL 4 requires DX11 level hardware.

OpenGL 4 is the current iteration of the OpenGL () standard, designed to reflect newest capabilities of modern GPU in 3D rendering. OpenGL 4 requires DX11 () level hardware. The major features of GL4 include: hardware tesselation support, ability to dynamically link shader subroutines, ability to set individual blend equations and blend functions for each color output and a mechanism to supply the arguments to certain Draw functions from buffer-object memory.

Release Dates:

  • OpenGL 4.0: March 11, 2010
  • OpenGL 4.1: July 26, 2010
  • OpenGL 4.2: August 8, 2011
  • OpenGL 4.3: August 6, 2012
  • OpenGL 4.4: July 22, 2013
  • OpenGL 4.5: August 11, 2014
  • OpenGL 4.6: July 31, 2017
426 questions
1
vote
0 answers

Maximising precision in glsl

Related to this question. I am having suffering due to lack of precision in the following function in glsl: double LinearizeDepth(double depth) { double z = depth * 2.0 - 1.0; // back to NDC return (2.0 * near_plane * far_plane) / (far_plane +…
Edward
  • 468
  • 4
  • 18
1
vote
1 answer

In modern OpenGL, how do I avoid overwriting data in FBO colour attachments with invalid fragments?

I have a batched rendering pipeline that uploads a bunch of quads to OpenGL. These are rendered to an FBO. Naturally, one of the attachments is visual output and another is depth, allowing for post-processing etc. However, a third attachment is…
Stefan Bauer
  • 393
  • 1
  • 9
1
vote
1 answer

How to properly keep track of VBOs and VAOs for cleanup?

Excuse my noobery, but I am one. I am currently trying to figure a way to keep track of VAO and VBO id's so that I can run through them using for loops and tell OpenGL to delete them. My current method is to push them into vectors and run through…
Lousifr
  • 23
  • 4
1
vote
1 answer

Is it possible to depth test against a depth texture I am also sampling, in the same draw call?

Context: I am using a deferred rendering setup, where in the first stage I have two FBO's: one is the GBuffer, for storing the normals, albedo, and material information for all visible fragments. This FBO has a 32-bit depth texture. This gets drawn…
Trevor Galivan
  • 373
  • 2
  • 13
1
vote
1 answer

Does discard in fragment shader prevent modifications to stencil buffer?

I want to have discard in my fragment shader prevent that fragment from writing to the stencil buffer; I had an idea for a visual effect in my game, and it might be implementable if I can rely on that behaviour for discard. My fragment shader…
Mr. Smith
  • 4,288
  • 7
  • 40
  • 82
1
vote
1 answer

Don't get OpenGL output when using glVertexAttribFormat

I'm trying to use glVertexAttribFormat and glVertexAttribBinding to create two triangles, but it doesn't work. I followed the description of how to do this in the question here (Render one VAO containing two VBOs). I don't really knnow what to try.…
Trapoc
  • 33
  • 1
  • 1
  • 4
1
vote
1 answer

imageLoad glsl always return 0 in compute shader OpenGL 4.3

I know that there is another question with exactly the same title here however the solution provided over there does not work for my case. I am trying to access pixel value from my compute shader. But the imageLoad function always returns 0. Here is…
Kaan E.
  • 515
  • 4
  • 16
1
vote
1 answer

Applying a simple Tesselation Evaluation Shader

I'm trying to learn how to use tesselation to render simple polygons, and for a starter I'm trying to write a simple program that essentially would just draw whatever vertices it's given, without any extra logic. My three shaders compile without…
1
vote
1 answer

Referring to uniforms without glGetUniformLocation

in my shaders I like to use a syntax like this: layout (location = 0) in vec3 aPos; So that I can just use the index 0 in glVertexAttribPointer and the such, saving the effort for the glGetAttribLocation call. I'd like to do the same with uniform…
memememe
  • 663
  • 6
  • 21
1
vote
0 answers

Having trouble setting up the OpenGL red book project

I tried to download the examples for OpenGL Programming Guide: The Official Guide to Leaning OpenGL, Version 4.5 with SPIR-V and I tried to import the library and include files into my Visual Studio solution so that I can create OpenGL applications…
Saad Amin
  • 33
  • 2
  • 6
1
vote
0 answers

OpenGL bindless textures and seamless cubemap filtering

Seamless cubemap filtering is a useful feature to filter simple skyboxes or lightprobes for PBR. It has been present in OpenGL for quite a while. However, it does not play nice with bindless textures. The GL_ARB_bindless_texture specifications…
Sergey K.
  • 24,894
  • 13
  • 106
  • 174
1
vote
0 answers

Binding an indirect command both as a draw_indirect_buffer and as an atomic counter results in a crash

I've found a strange behavior of the drivers I can't figure out while using OpenGL 4.3. I'm drawing some triangles with glDrawArraysIndirect() on the default FBO. glBindBuffer(GL_DRAW_INDIRECT_BUFFER, command); glBindVertexArray(VAO); …
Tarquiscani
  • 649
  • 7
  • 20
1
vote
0 answers

Not able to access GLFW window created from within dynamic library

I've been trying to wrap my head around why I am not able to use a GLFW window handle cross dynamic library boundaries. This is most likely due to lack of understanding how GLFW works under the hood, but I would really appreciate if someone could…
Calle Bergström
  • 480
  • 4
  • 12
1
vote
1 answer

Multiple output buffers with the default framebuffer

I have a shader that I use primarily with an FBO that has two color attachments. In this fragment shader so there are two output buffers. in vec2 vs_tex_coords; flat in uint vs_id; out vec4 fs_color; out uint fs_id; uniform sampler2D…
Tarquiscani
  • 649
  • 7
  • 20
1
vote
1 answer

Do I need a memory barrier between initializing an SSBO storage and filling it?

I've got code that looks like this: uint ssboId; glGenBuffers(1, &ssboId); glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssboId); //initialize glBufferData(GL_SHADER_STORAGE_BUFFER, size, 0, GL_STATIC_DRAW); // memory barrier here? //…
Mr. Smith
  • 4,288
  • 7
  • 40
  • 82