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
9
votes
1 answer

Are array textures related to sampler arrays?

OpenGL has array textures, denoted in shaders by specific sampler types: sampler2DArray array_texture; But GLSL also allows samplers to be aggregated into arrays: sampler2D array_of_textures[10]; Are these two features related to each other? How…
Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
8
votes
2 answers

(OpenGL 3.1 - 4.2) Dynamic Uniform Arrays?

Lets say I have 2 species such as humans and ponies. They have different skeletal systems so the uniform bone array will have to be different for each species. Do I have to implement two separate shader programs able to render each bone array…
Griallia
  • 171
  • 2
  • 6
8
votes
1 answer

gl_VertexID in non-indexed rendering

The OpenGL gl_VertexID page clearly states: gl_VertexID is a vertex language input variable that holds an integer index for the vertex while the OpenGL Vertex Shader page says it is the index of the vertex currently being processed. When using…
user815129
  • 2,236
  • 2
  • 20
  • 40
8
votes
2 answers

What is the difference between glVertexAttribDivisor and glVertexBindingDivisor?

I was looking for ways to associate attributes with arbitrary groupings of verticies, at first instancing appeared to be the only way for me to accomplish this, but then I stumbled up this question and this answer states : However what is possible…
Krupip
  • 4,404
  • 2
  • 32
  • 54
8
votes
1 answer

OpenGL, measuring rendering time on gpu

I have some big performance issues here So I would like to take some measurements on the gpu side. By reading this thread I wrote this code around my draw functions, including the gl error check and the swapBuffers() (auto swapping is indeed…
elect
  • 6,765
  • 10
  • 53
  • 119
7
votes
3 answers

How should modern OpenGL shaders be written so as to be compatible with each other?

In the fancy new versions of OpenGL (3.0 and 4.0 up), built-in vertex attributes like gl_Vertex are being deprecated. The "new way" to actually render anything is to specify your own vertex attributes for position, color, etc., and then bind these…
interfect
  • 2,665
  • 1
  • 20
  • 35
7
votes
1 answer

glDebugMessageCallback causes segfault

I'm in a bit of a catch-22 here. I can't debug my C++ OpenGL program because activating debug messages causes a segfault. I have a debug callback function I register: static void APIENTRY openglCallbackFunction( GLenum source, GLenum type, …
Carson McNeil
  • 790
  • 9
  • 22
7
votes
1 answer

When to use Texture Views

I am reading about Texture Views in the new Red Book. On the page 322 is said: OpenGL allows you to share a single data store between multiple textures,each with its own format and dimensions. (via Texture Views) Now,my questions are: Does it…
Michael IV
  • 11,016
  • 12
  • 92
  • 223
7
votes
1 answer

How to get the currently bound Vertex Array Object?

How can I get the name of the currently bound Vertex Array Object? I looked in the manual but couldn't find an enum to use with glGet().
bwroga
  • 5,379
  • 2
  • 23
  • 25
7
votes
2 answers

Is glTexStorage2D imperative when auto generating mipmaps

I do update to a texture2D in OpenGL 4.0 using gltexSubImage2D().The texture has mipmaps auto generated using glGenerateMipmap(GL_TEXTURE_2D); My texture update was failing till I understood I had to regenerate mipmaps on update too (or remove…
Michael IV
  • 11,016
  • 12
  • 92
  • 223
7
votes
1 answer

How do I make this simple OpenGL code (works in a "lenient" 3.3 and 4.2 profile) work in a strict 3.2 and 4.2 core profile?

I had some 3D code that I noticed wouldn't render in a strict core profile but fine in a "normal" (not explicitly requested-as-core-only) profile context. To isolate the issue, I have written the smallest simplest possible OpenGL program drawing…
metaleap
  • 2,132
  • 2
  • 22
  • 40
6
votes
1 answer

How can I use OpenGL 4 features through WebGL

I want to use some of the features of OpenGL 4 (specifically, tessellation shaders and newer shader language versions) from WebGL. Is this possible, in either a standards-compliant or a hackish way? Is there some magic value I could use instead of,…
interfect
  • 2,665
  • 1
  • 20
  • 35
6
votes
1 answer

Failing to map a simple unsigned byte rgb texture to a quad:

I have a very simple program that maps a dummy red texture to a quad. Here is the texture definition in C++: struct DummyRGB8Texture2d { uint8_t data[3*4]; int width; int height; }; DummyRGB8Texture2d myTexture { { …
Elad Maimoni
  • 3,703
  • 3
  • 20
  • 37
6
votes
0 answers

OpenGL 4.5 - Shader storage buffer objects layout

I'm trying my hand at shader storage buffer objects (aka Buffer Blocks) and there are a couple of things I don't fully grasp. What I'm trying to do is to store the (simplified) data of an indeterminate number of lights n in them, so my shader can…
Carlos Romero
  • 698
  • 8
  • 18
6
votes
1 answer

Why must I "use" a shader program before I can set its uniforms?

I am using OpenGL 4.5 in C++ and GLSL 410. I came across a problem recently where I was attempting to set a shader program's uniform variable without first using the shader program with glUseProgram. I had a fragment shader with a uniform variable…
Rob
  • 110
  • 2
  • 7
1
2
3
28 29