The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [opengl]

For questions involving use of the OpenGL graphics library.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

GLSL - increasing line spacing with y

I'm trying to force perspective into the horizon of a Shadertoy scene by drawing horizontal lines at decreasing distances as y grows to create an outrun-esque scene, but can't figure out which ...
0
votes
1answer
13 views

What are the type constants that the documentation for glGetProgramResourceiv() refers to?

Quoting the Khronos OpenGL documentation pages for the glGetProgramResourceiv() function: For the property GL_TYPE, a single integer identifying the type of an ...
1
vote
0answers
43 views

Why is glUniform1i() returning GL_INVALID_VALUE?

I have a sampler variable in a shader: uniform sampler2DArray tiles; Which I am trying to bind to a texture unit in GL: ...
2
votes
1answer
137 views

Double buffering always necessary?

Question from the graphics newbie: What I know by now is that "usually" double buffering is used: You calculate the content of frame x+1 while frame x is shown on the screen, if you want to achieve ...
0
votes
0answers
26 views

How combine multiple projections into a single pass?

We have a projector type display used in an automotive application, where a projector displays an application on the windshield. Because the projector would normally warp a flat image, we have to ...
0
votes
1answer
30 views

GLFW | What is a frame?

Here I was reading about buffers and found such text: When the entire frame has been rendered, the buffers need to be swapped with one another, so the back buffer becomes the front buffer and vice ...
1
vote
0answers
30 views

How to render multiple shaders per mesh

I've tried looking everywhere, but I just don't get it. How is multiple shaders assigned to a mesh if you can only bind a single shader in OpenGL? Assume I have a mesh with a texture shader and now I ...
1
vote
1answer
44 views

What's the difference between Clipping and Culling?

In a tutorial about OpenGL both words are mentioned, unfortunately without a good explanation. To find out, I have read this article three times, but I fear I'm a too common man... my understanding is ...
0
votes
1answer
39 views

In the rendering pipeline, in what coordinate space are vertices when they arrive at the primitive assembly stage?

Full disclaimer, this was a test question, but I couldn't find any information online. In my opinion, this depends on if the primitive assembly stage happens before or after perspective division. If ...
0
votes
1answer
29 views

About view matrix and frustum culling

I was trying to determine if an object (sphere) is inside a view frustum. My strategy was first to get the view matrix: ...
2
votes
1answer
43 views

Zero-copy texture reading from CPU memory

The Intel 740 AGP graphics card read textures directly from system RAM, using VRAM exclusively for depth buffers and the framebuffer. This has the effect of saving video RAM, and it could be ...
1
vote
1answer
42 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 ...
1
vote
0answers
22 views

Confusion about glVertexAttribPointer and non-active attributes

When binding an attribute index using glVertexAttribPointer, what happens when a later bound program does not contain an attribute at said index? Is the behaviour undefined, or is the attribute ...
1
vote
1answer
35 views

Change of speed but no change of size after OpenGL Perspective Projection

I am new to OpenGL and I am trying to code un optic flow with dots appearing from the background and moving towards the viewer. As a consequence of a perspective projection, the dots are faster and ...
1
vote
1answer
46 views

In what scenarios and how does GL_ARB_buffer_storage help performance?

The Dolphin emulator for GameCube/Wii has the ability to use the ARB_buffer_storage (or EXT_buffer_storage for GLES) to improve rendering performance. From the extension's description, a GPU driver ...
0
votes
0answers
20 views

What quad will fill the screen, which can be inverse-projection-view transformed to map to the near frustum plane?

I've been experimenting with raytracing using GLSL. I had success rendering a cube which encloses the object. Now I want to do a full-screen raytrace, and I want to construct a quad which covers the ...
0
votes
0answers
21 views

How to visualize a dataset , generated in curvilinear grid, in opengl with texture maping?

I have a dataset obtained from astronomical simulation. This data was created in a curvilinear grid with polar coordinates. The form of this dataset is a simple array (1d) of intensities, i can ...
2
votes
1answer
44 views

Trading off instancing for render order

I've been doing some searching online and it seems like I could improve my renderer by ordering my draw calls based on depth. For opaque objects render the closest items first and move backward in ...
4
votes
1answer
70 views

Why is OpenGL recompiling my depth map vertex shader based on the GL state?

I've written a shader that writes depth to each face of a cube map, as part of rendering cube map shadows for a realtime 3D engine I'm writing with OpenGL and C++. The shader transforms each vertex ...
1
vote
1answer
56 views

Weird glColor3f results in framebuffer objects

The code is glColor3f(1, 1, 1); gluSphere(gluq, 0.2, 10, 10); glColor3f(1, 0, 0); glTranslatef(1, 0, 0); gluSphere(gluq, 0.2, 10, 10); In short, when I draw ...
2
votes
1answer
41 views

Use glTranslatef and shaders?

In newer OpenGL it's encouraged to use shaders and pass the model-view-projection as parameters. But what if I drew a complex object, and wanted to translate/rotate it and draw many copies? For ...
2
votes
0answers
48 views

Screen space reflections become warped when looking up or down

I have been experiencing issues over the past few days with implementing SSR on water into my engine. Looking straight forward, it appears to be alright. However, when I look up or down, the ...
2
votes
1answer
65 views

Represent shape as particles

Input: Triangles which make up an arbitrary shape. Each triangle is represented by 3 3D points. Output: A set of particles which fills up the inside of the object (see image). I have read the ...
1
vote
1answer
55 views

Camera position in vertex shader

in the vertex shader I have the vertex position vpos which is in object space and I want to get the vector going from the camera to ...
0
votes
1answer
148 views

How can i create a 3D Sphere(earth) using OpenGL, GLFW, GLAD, GLM?

Please help me out with this thing and currently i am a little more than a beginner so please tell me in that context. i don't need any obsolete methods for creating this like using GLUT or GLEW.can ...
0
votes
1answer
58 views

Pseudo rounded cube in OpenGL

If I have a cube in OpenGL, how can I have it appear like rounded? I think it's too complicated to really have the cube rounded so is there any "light trick" to have something like this: The cubes ...
1
vote
1answer
32 views

Is there a list of OpenGL extension support?

I am looking for a list that states which vendor does support which OpenGL extension. For example I wanted to use ARB_shading_language_include, which was accepted ...
1
vote
1answer
73 views

Is it possible to do color conversion on decoded video without getting it from GPUmemory to CPU memory?

Decoding video will result in different pixel formats on different GPUs and drivers. I have an application which can render (using OpenGL), only the RGB8 pixel format, therefore I need to do color ...
2
votes
1answer
114 views

GLSL Compute Shader doesn't run for large inputs

The shader takes an SSBO of Photons that have a position, direction, wavelength and intensity and each thread is responsible for tracing exactly one photon through the grid, where at each grid cell ...
2
votes
1answer
58 views

Async readback storage buffer

Every frame I dispatch a compute shader which write data in a storage buffer. The cpu needs to readback this data and use it. I would expect this to work : ...
0
votes
0answers
27 views

Software Rendering Display Latency

I've been doing some reading as to how to reduce input delay on modern computing devices. A lot of my understanding from this comes from the VR research paper by Carmack explaining the numerous ...
3
votes
2answers
193 views

Triangle - Why is it the basic building block for complex shapes

I was recently learning about OpenGL and computer graphics development. I have a question regarding the usage of triangle as the basic building block, or basic shape to develop complex shapes. Is ...
1
vote
1answer
77 views

How was computer graphics libraries or gtk,qt programmed?

I am wondering how was first graphic or image libraries created,I know C and Python ,I want to create plotting application,and I cant imagine these libraries(QT,OpenGL,Vulkan) written by C,how can I ...
2
votes
1answer
75 views

What do the OpenGL version strings from glxinfo actually mean?

Note: I wasn't 100% certain if this question belonged here or in Ask Ubuntu. I figured since it was about OpenGL programming I'd put it here, but if I should move it to Ask Ubuntu, please let me know. ...
5
votes
2answers
109 views

Why do identical polygons not z-fight in OpenGL?

Typically when coplanar or nearly coplanar polygons are rendered in OpenGL, the textures of each polygon mix together in a non-deterministic way. My understanding is that this is caused by the limited ...
2
votes
0answers
23 views

How to open and render in a second window with OpenGL / JOGL with NEWT

I have a working renderer implemented with Java in JOGL with NEWT. Now I want to implement a Material Editor which should run in a second window. However I can't get a second window up and render in ...
0
votes
0answers
32 views

sdl2: Compiler throws “Undefined Reference”

I'm trying to learn computer graphics, but when I tried to get this very simple windower running with c ...
0
votes
0answers
54 views

How to rotate an object in OpenGL on the X, Y and Z axis on its local coordinates?

I've read multiple tutorials, but I still can't understand how do I properly rotate an object in 3D space on all 3 axis at once. For example, I'd like to give the object a pitch of 60 degrees, yaw of ...
0
votes
1answer
65 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 ...
2
votes
1answer
137 views

gl_FragCoord and glViewport

I've been scanning the specifications for both OpenGL and GLSL, and I can't find a definitive answer as to how exactly are gl_FragCoord's ...
0
votes
1answer
126 views

Vulkan: efficient way to update VBO mesh vertices?

I would like to change/add/remove some mesh vertices in existing VBO's (while deforming and remeshing 3D objects) . With OpenGL I would have to reload whole vertex VBO's. I suppose with Vulkan there ...
2
votes
1answer
97 views

How to do CSG on 3D triangulated objects, originally stored as a .obj file, using openGL or other libraries?

What I would like to do is to create a crater on a field. To do so, I thought that creating a universal crater object (something cone-shaped) and then subtracting it from the field on a specified ...
2
votes
1answer
71 views

GL_DEPTH_CLAMP has no effect (reverse z)

In an effort to improve cascaded shadow maps, I have looked into using GL_DEPTH_CLAMP and moving the near and far plane just around the actual view frustum instead of the global bounding box. But the ...
2
votes
1answer
68 views

Why is cos(𝜃) in the denominator in the reflectance equation and in the numerator in the shading equation?

Background: I'm reading https://learnopengl.com/PBR to learn about PBR. In the theory slide (https://learnopengl.com/PBR/Theory), the author has the reflectant equation as The theta (the angle ...
0
votes
1answer
133 views

Sphere Texture Mapping Algorithm

I am trying to generate UV coordinates automatically to map a texture on a sphere. The problem is with seams when going from 0.8 to 0.2 there is a discontinuity and interpolation in fragment shader ...
-1
votes
1answer
139 views

Difficulty including GLM into Visual Studio with OpenGL

I have been trying to implement GLM (math library) into Visual Studio with OpenGL. I have followed and watched many online resources that point me to include only the GLM folder inside the ...
1
vote
0answers
71 views

Convey screenspace bounding box of rendering result

Imagine I render to an FBO some arbitrary geometry. Geometry can be rendered via single or multiple draw calls. For the sake of the question, assume I know nothing about geometry or transformation ...
2
votes
0answers
58 views

Show the edges between the clipping plane and clipped objects [closed]

I want to utilize shaders to not only discard fragments if they are on one side of a predefined plane but also render a contour along the intersection. My fragment shader currently does something ...
-2
votes
1answer
156 views

This function syntax is confusing me

gladLoadGLLoader((GLADloadproc)glfwGetProcAddress) I have never seen this syntax before. Presumably glfGetProcAddres is a function, but it has the brackets behind it. Is this only possible in open gl ...
1
vote
1answer
146 views

GBuffer: Framebuffer with different texture format types?

I rely on this answer from Nathan Reed: How much precision do I need in my G-Buffer? It is proposed to use two different texture formats for one Gbuffer. However as far as I know, color texture ...