Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
27 views

How to know the existing pixel value of the framebuffer [duplicate]

I am trying to make a heatmap and in my Fragment shader i want to know the existing color value of the pixel on which the shader will write. Based on the red color value i want to decide whether to ...
Summit's user avatar
  • 2,230
2 votes
1 answer
176 views

Value of gl_DrawID when calling glMultiDrawElementsIndirect with instance count set to 0

Suppose I have three meshes A, B, C in one VBO and used glMultiDrawElementsIndirect with the instance count set to 1, 0, and 1 for A, B, and C respectively and the draw count set to 3. What would be ...
Geraldo Christiano's user avatar
0 votes
0 answers
60 views

Passing extra variable to fragment shader completely breaks the shader program

The vertex shader: in vec3 a_Position; in vec4 a_Color; in float a_Width; in vec4 a_JointProduct; in int a_EntityID; layout(location=0) out vec3 pos; layout(location=1) out vec4 color; layout(...
Batres's user avatar
  • 33
0 votes
1 answer
58 views

How to create a SSBO with dynamic size

I have looked everywhere but couldn't find one that used DSA (Direct State Access). I need a SSBO with dynamic size so that I can update my instances WITHOUT having a limit like MAX_INSTANCE_COUNT. At ...
Alphenex's user avatar
3 votes
1 answer
103 views

Why did glGet with GL_POLYGON_MODE returns two values?

When getting the mode of GL_POLYGON_MODE, glGetIntergerv(GL_POLYGON_MODE, data), I'll have to make data an integer array of size 2. because I've read somewhere that: params returns two values: ...
Weber Lin's user avatar
0 votes
0 answers
18 views

There is no image when using the shader in OpenTK 4.8.2

When I turn on GL.Useprogram(), then nothing is visible, only the background, and if I do not turn on the shader program, then everything is visible, though white (but this is normal) OpenTK 4.8.2 ...
RuslanKovtun's user avatar
0 votes
0 answers
31 views

How set ivec4 by Vertex Attributes?

I tried using an int value ‘flag’ to set different colors,but the 'flag' value is not correct. l want know why failed to set value 'flag'?? the full demo project https://github.com/whiskets/OpenTKDemo....
whiskets's user avatar
0 votes
0 answers
72 views

My Visual Studio 2022 consistently gives me errors saying that the GLchar variable type is undefined

I've been working on a little bit of code recently using the WIN32 API, GL.h, and GLU.h. I recently figured out that if I define a variable with the type GLchar my Visual Studio will give me an error ...
FulltimeNerd's user avatar
0 votes
1 answer
130 views

How do I get glBindTextureUnit() to work?

The following works fine: glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, m_ID); But when I replace it with this, it doesn't work. (I don't get any errors, just a black color instead of ...
Adriel Bradley's user avatar
-1 votes
1 answer
67 views

OpenGL shadow acne visual error without shadows implemented

so I'm having a problem with what it seems to be shadow acne (as far as I can tell), but the thing is that I have not yet implemented shadows of any type. I have implemented Phong Lighting model (...
borja vazquez's user avatar
0 votes
1 answer
158 views

sampler2D in compute shaders, compilation errors

I'm trying to port a Windows program to GNU/Linux, but a compute shader doesn't compile. I have a few knowledge of GLSL. So I wonder if there are workarounds to get the shader working. I have written ...
Bertrand125's user avatar
0 votes
1 answer
106 views

OpenGL shader uniform is not recognized in the code

I am currently trying to learn OpenGL, and I have the following issue: when I use glGetUniformLocation to locate my shader uniform, it simply cannot find this uniform. Do you have any idea why? My ...
Patrick's user avatar
  • 11
-1 votes
1 answer
64 views

Buffer read-back working depends on order of bind/map with DSA

I am trying to perform read-back of SSBO data in OpenGL. For this I persistenly map the SSBO, but the following piece of code does not actually read back the written data from the example compute ...
IGarFieldI's user avatar
0 votes
1 answer
63 views

What happens to buffer attached to VAO via glVertexArrayVertexBuffer after deleting buffer?

I'm using OpenGL4.5, and using Direct State Access where possible. I wrote basic wrappers around VAO and buffer objects. I'm using glVertexArrayVertexBuffer to bind a buffer to a VAO. I'm wondering if ...
Newline's user avatar
  • 867
1 vote
0 answers
74 views

glPolygonOffset and backfaces

I stumbled upon a problem that I'm unsure of how to fix or if a fix even exists. I need to apply a positive polygon offset to a filled mesh for rendering some line geometry on top of them. The lines ...
IGarFieldI's user avatar
1 vote
1 answer
79 views

Non-gradual color change in OpenGL

I'm trying to gradually change a triangle's color to each color on the spectrum. The color basically changes incrementally in every iteration of the render loop and passes the color information to a ...
Creui's user avatar
  • 13
0 votes
2 answers
394 views

OpenGL (with OpenTK) texture doesn't render (not even a white rect)

I am doing on overhaul on a game engine from my university and I've hit a brick wall when dealing with OpenGL rendering. I'm using OpenTK with GLFW.NET to render to a window. (I recently switched to ...
Alex Vasile's user avatar
2 votes
0 answers
82 views

OpenGL glProam link failed in windows: error C5145: must write to gl_Position

I am currently learning the Book "Computer Graphics Programming - Using OpenGL and C++". When I test the chapter 2-3, I found the error: shader program failed to link: Program Info Log: ...
NerdNiels's user avatar
0 votes
1 answer
107 views

How Can I Render Round Vertices Using OpenGL 4.0?

I have an MFC based Windows desktop SDI application built with the Doc-View framework and which displays modern OpenGL based 3D graphics in the MainFrame. It used for rendering relatively simple ...
DavidH's user avatar
  • 97
0 votes
0 answers
376 views

Passing a big texture to a GLSL shader?

I need to pass two textures of 65536x1024 pixels each to the shader program. I can't do this via the standard glTexImage2D() method because there is a limitation on the OpenGL side on the height and ...
Fabalo Asdimov's user avatar
1 vote
0 answers
142 views

Strided buffer copy for modifying interleaved vertex attributes

this question is a bit related to this one, but quite some time has gone by since it was asked. The basic premise: I have device-local (non-mappable) vertex buffers with interleaved attributes. These ...
IGarFieldI's user avatar
1 vote
1 answer
126 views

Clearing FBO depth buffer without considering glDephMask

I'm currently writing a render pass which renders to a framebuffer with attached color and depth attachments. Before the pass starts, it needs to clear the depth attachment to a set value. I'm trying ...
IGarFieldI's user avatar
0 votes
1 answer
173 views

GLSL simple shader results in strange compilation errors

I have a very simple shader here: #version 460 layout (location = 0) in vec3 inPos; layout (location = 0) out vec3 outPos; void main() { gl_Position = vec4(inPos.x, inPos.y, inPos.z, 1.0); ...
Liyuu_'s user avatar
  • 51
0 votes
1 answer
110 views

How to move 2D multiple drawn shapes (Squares and Rectanagles) seperately in OpenGl?

I have just started using OpenGl in visual studio. I used the drawsquare() and drawRoundRect () to draw multiple shapes in seperate void functions which I called seperately in an another function ...
Wiki's user avatar
  • 1
-2 votes
1 answer
80 views

glGetProgramResourceName() Throws

I am trying to get the uniform block name from a shader handle using glGetProgramResourceName(). Yet it throws (0xC0000005: Access violation executing location 0x0000000000000000) on std::vector<...
user3533871's user avatar
1 vote
2 answers
573 views

Continuously render Gtk::GLArea in gtkmm

I've followed a gtkmm4 + opengl example, the window loads and displays without any errors and renders one frame but then seems to ignore my queue_render() and queue_draw() calls as evidenced by the ...
seraph's user avatar
  • 77
1 vote
1 answer
83 views

Are all returned values of glGetInternalformat dependant on both the target and format arguments?

In the OpenGL 4.6 specification under section 22.3, a command named glGetInternalformat is described which can be used to gather implementation dependent information about internal formats. The ...
Dwarfley's user avatar
1 vote
1 answer
81 views

cannot render own created model with loaded models together in modern OpenGL

I am failing to render my own created model with loaded obj at the same time. I have mesh.h that is designed for loading objects: struct Vertex { glm::vec3 Position; glm::vec3 Normal; }; ...
Alexander S's user avatar
1 vote
1 answer
161 views

Why does glObjectLabel only fails for GL_TEXTURE?

Using OpenGL 4.3 with a debug context, I am able to label programs, shaders, vertex arrays and vertex buffers. However, I am not able to label textures and get the following error in my callback: ...
aybe's user avatar
  • 16.5k
4 votes
1 answer
1k views

Drawing a simple rectangle in OpenGL 4

According to this wikibook it used to be possible to draw a simple rectangle as easily as this (after creating and initializing the window): glColor3f(0.0f, 0.0f, 0.0f); glRectf(-0.75f,0.75f, 0.75f, -...
traveh's user avatar
  • 2,779
-1 votes
2 answers
266 views

Stbi_load causes error from glGetTextureHandleArb()

Trying to setup bindless textures, whenever I call glGetTextureHandleARB() it results in the OpenGL error GL_INVALID_OPERATION. This page says this is because my texture object specified is not ...
Pancake's user avatar
1 vote
1 answer
567 views

OpenGL GLM rotate 2D shape around Z-axis

This is similar to this question, but I have a 2D triangle I'm trying to rotate solely about the z-axis, so I don't think I have to do any negative rotations. I have intentionally picked a triangle ...
Jon G's user avatar
  • 317
0 votes
1 answer
148 views

OpenGL ARB shader baloot readInvocationARB returns different results for inactive invocation

I am writing a shader that uses the same algorithm several times on different inputs to calculate some intermediate results that are later combined to get the final result. The data is dependent on ...
Arkadiy Mel's user avatar
1 vote
2 answers
2k views

Issues with infinite grid in OpenGL 4.5 with GLSL

I've been toying around with an infinite grid using shaders in OpenGL 4.5, following this tutorial here. Since the tutorial was written for Vulkan and a higher version of GLSL (I'm using 450 core), I ...
Mauricio's user avatar
  • 145
0 votes
1 answer
385 views

Why does glDrawElements() require number of vertices and number of elements?

As per the OpenGL documentation, void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); The second argument count in the call to glDrawElements, "Specifies the ...
DigitalEye's user avatar
  • 1,535
0 votes
0 answers
20 views

GL_INTENSITY16 Alternative? [duplicate]

I have a texture that used to be read in as GL_INTENSITY16 internal pixel format. After upgrading the pipeline ive noticed GL_INTENSITY16 is deprecated though i can kind of load the texture with ...
Marauder2k9's user avatar
1 vote
2 answers
70 views

OpenGL Render Half Polygon

I am getting half polygon rendered while using Indices in OpenGL. Any idea what's going wrong? float vertices[] = { -0.5f, 0.5f, 0, -0.5f, -0.5f, 0, 0.5f, -0.5f, 0, 0.5f, -0.5f, 0, ...
Techpreneur's user avatar
0 votes
1 answer
836 views

Problem with imageStore in compute shader

I have a problem with a very simple compute shader that just copies a texture using imageStore. #define KS 16 // kernel size layout (local_size_x = KS, local_size_y = KS) in; layout(location = 0) ...
tuket's user avatar
  • 3,692
0 votes
1 answer
602 views

OpenGL error 1282 when returning struct with uint array member

I get OpenGL error 1282 when I try to run fragment shader with a function that returns struct with uint array initialized from function argument and integer literal. When I run my program with the ...
Arkadiy Mel's user avatar
2 votes
1 answer
386 views

OpenGL - Can I draw non-indexed when index-buffer is set for VAO?

I set up a VAO, binding vertex-buffers to it for vertex attributes, but also set index-buffer (With glVertexArrayElementBuffer). Does that restrict it so it only works with glDrawElements type of ...
Newline's user avatar
  • 867
1 vote
1 answer
533 views

OpenGL warning after calling glCopyNamedBufferSubData and glNamedBufferSubData

I'm getting the following warning: Buffer performance warning: Buffer object 19 (bound to NONE, usage hint is GL_DYNAMIC_DRAW) is being copied/moved from VIDEO memory to HOST memory. I allocate this ...
Newline's user avatar
  • 867
0 votes
0 answers
93 views

What parameters affect glCompressedTexSubImage2D, in difference to glCompressedTexImage2D?

I have a problem which only affects ATI-graphic cards on PC, but it seems no other graphics hardware, including Nvidia/Intel/Android/iOS. When I create a 2D texture I allocate using glTexStorage2D, ...
Viktor Sehr's user avatar
  • 13.1k
0 votes
0 answers
50 views

Black Box Renders Instead of 3D Object

This base code was working well for 2D objects, but will not render the 3D object that I have the vertices and index for. At first I thought it was the shader, but the shader works well for ...
faangorn's user avatar
0 votes
1 answer
461 views

what's the internal format of default framebuffer's depth component in opengl

glblitframebuffer requires matched internal format, so what's the internal format of default framebuffer's depth component?Is there a standard?I couldn't find a document for it. My laptop's nvidia ...
xubury's user avatar
  • 104
1 vote
1 answer
48 views

c++ opengl 4.5 doesn't show the object

I writed code which must to show triangle but it doesn't. I really don't know where is problem. I checked everything and don't find out what is the problem. If you can please help me. Here is code: #...
Normal Name's user avatar
0 votes
1 answer
291 views

OpenGL - Does MSAA not support floating-point texture?

Here's the things, I am trying to do deferred shading with multisample texture. To create the GBuffer, I create a framebuffer with mutlisample texture attachments to draw on and a framebuffer with ...
xubury's user avatar
  • 104
0 votes
1 answer
913 views

GL_LINEAR / GL_NEAREST equivalent in DirectX 11

I have a scene in which i load the same texture only depending on its resolution i use different filtering modes in OpenGL, these are GL_LINEAR, GL_NEAREST and so on. For example, for a texture with a ...
Kenny's user avatar
  • 132
1 vote
1 answer
310 views

Can we run the openGL project from server using node.js child process?

I have been trying to automate the launching of OpenGL Project from server using node.js The problem is like whenever new client join in (create a window in browser) I want to launch the .exe file. ....
MacTak's user avatar
  • 21
0 votes
0 answers
88 views

Why are my textures not consistently drawing when I switch from Orthographic to Perspective?

I'm relatively new to opengl and I'm trying to make a basic 2d scened with gl-4.5. I have three tiles laid next to each other on the plane, two images from a single spritesheet and a coloured ...
Amos's user avatar
  • 1
0 votes
1 answer
259 views

How to use glClearBufferData to initialize a buffer

GLuint buffer; glCreateBuffers(1, &buffer); glNamedBufferStorage(buffer, 1024, NULL, GL_MAP_WRITE_BIT | GL_MAP_READ_BIT | GL_DYNAMIC_STORAGE_BIT); unsigned int x = 0x01010101; glBindBuffer(...
Geoffrey Jiang's user avatar

1
2 3 4 5
9