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
-1
votes
0answers
18 views

What is a proper way to render a scene?

Lets say that I have 3 models and each has its own vertices and indicies, what is the best way to render them in a scene? Issue 3 render calls - one for each model, or merge all 3 vertices to one ...
0
votes
0answers
22 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, ...
2
votes
1answer
20 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 ...
1
vote
1answer
35 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 ...
0
votes
0answers
19 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 ...
0
votes
1answer
43 views

fastest way to “read only” from buffer

First of all I have a struct which looks like the following: ...
3
votes
0answers
151 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 ...
1
vote
1answer
53 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 ...
0
votes
0answers
26 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 ...
0
votes
1answer
20 views

imageLoad() behavior for non-existent texel

Is there a way to influence the behavior of imageLoad() for accessing an image2D or uimage2D ...
0
votes
0answers
51 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 ...
1
vote
1answer
30 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 ...
0
votes
0answers
16 views

OpenGL batch drawing debug meshes with varying dimensions

When having a high number of identical meshes one could use instanced arrays to avoid gpu call overhead. For instance if we want to draw lots of cubes with the same dimensions with different ...
1
vote
1answer
33 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 ...
0
votes
1answer
21 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 ...
0
votes
1answer
41 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 ...
1
vote
0answers
35 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 ...
1
vote
0answers
24 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: ...
0
votes
1answer
58 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 ...
0
votes
1answer
28 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 ...
1
vote
1answer
97 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 ...
0
votes
1answer
79 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 ...
0
votes
1answer
25 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 ...
0
votes
0answers
23 views

Possible approach to drawing with a texture brush

I would like to draw onto a plane with a 2d texture when pressing down the mouse. Similar to drawing on a canvas with a texture brush with continuous stroke in painting applications. I was thinking ...
2
votes
0answers
54 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 ...
0
votes
0answers
18 views

How to intercept call trace in OpenGL

I wonder how software like apitrace is able to output the call trace in OpenGL. Are calls to GPU possible to intercept for a given frame?
1
vote
0answers
25 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. ...
0
votes
0answers
42 views

How to deallocate memory for vertex buffer objects

I have a class that handles loading buffers for a mesh: ...
0
votes
0answers
39 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: ...
0
votes
0answers
21 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 ...
0
votes
1answer
64 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 ...
0
votes
1answer
96 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 ...
0
votes
2answers
91 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 ...
0
votes
0answers
22 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 ...
0
votes
1answer
30 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 ...
2
votes
1answer
104 views

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

I'm practicing GLSL on ShaderToy ...
0
votes
0answers
53 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 ...
1
vote
1answer
32 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 ...
1
vote
1answer
77 views

Rendering a volume that might be completely clipped in OpenGL

Suppose that I have some world-space volume (which we may assume is a convex polyhedron with a small number of vertices), and I want to render its intersection with the view frustum, such that every ...
0
votes
1answer
55 views

OpenGL pipeline stages, when is the primitive assembly executed?

The question is simple, I have this diagram from the Khronos page: And this diagram from the Learn OpenGL page In the first picture the Primitive assembly is executed for example after the Geometry ...
0
votes
0answers
21 views

How to “preserve texture” when transforming vertices

Maya has a feature called preserve texture. It allows you to transform vertices of an object and basically have the texture "stay in place" in object space. Say I have a plane with unwrapped ...
0
votes
1answer
30 views

Rendering part of the scene inside bounding sphere

In this video https://youtu.be/0ckE-CZpXAo?t=445, it's suggested to render onto a sphere instead of screen quad to save computation time on lighting calculations. So you create a bounding sphere for ...
1
vote
2answers
273 views

Understanding VAO and VBO

I'm reading through Learn OpenGL to refresh the basic concepts as I haven't touched in quite some time. Specifically I still think I cannot quite understand the meaning of VAO and VBO, the book mainly ...
0
votes
0answers
41 views

Not sure why texture is rendering a black screen

I am converting my OpenCV frame to an OpenGL texture. I have the frame data loaded, but when I try to render it as a texture I get a black screen. I've looked through the OpenGL code countless times ...
0
votes
2answers
60 views

Is there a tool capable of drawing a triangular linear gradient fill?

I need to draw some shapes filled with linear gradients starting from every point and blending smoothly between points, like an OpenGL standard shading (I guess it is called ...
1
vote
1answer
57 views

Max number of elements in a vertex attribute

I want to load a vertex buffer with vertices of struct Vertex: ...
0
votes
1answer
33 views

Tessellation Controll Shader how to get maximum subdivisions limit?

I have a low-poly mesh and I want to add structure on the surface. The setup: The mesh consists of triangles. Within the TCS the pixel-length for each of the three edges will be calculated and ...
1
vote
0answers
43 views

Creating a UI component library from scratch

I've been playing around with OpenGL and I'm trying to build out my own UI component library containing things like buttons, text views, labels, views, etc. Eventually I want to abstract it similar to ...
0
votes
0answers
24 views

How to display and manipulate a structured 3D voxel image?

Can you please give a suggestion? I have a .mhd image (Voxel 3D). I want to visualize it and manipulate it with the mouse. What you suggest? How I can display a 3D Image in OpenGL? I only found in ...
0
votes
1answer
116 views

Drawing a cube and wireframe opengl

I'm trying to render a cube and it's wireframe together using OpenGL The main function is this: ...

1
2 3 4 5
12