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

How to deallocate memory for vertex buffer objects

I have a class that handles loading buffers for a mesh: ...
0
votes
0answers
33 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
16 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
42 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
30 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
61 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
17 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
24 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
50 views

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

I'm practicing GLSL on ShaderToy ...
0
votes
0answers
51 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
64 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
37 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
17 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
28 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
99 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
37 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
47 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
45 views

Max number of elements in a vertex attribute

I want to load a vertex buffer with vertices of struct Vertex: ...
0
votes
1answer
29 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
42 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
23 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
78 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
vote
1answer
32 views

draw on cubemap with help of geometry shader each triangle covers each cubemap face (why??)

I want to do some complicated stuff but have problems with my geometry shader / FBO bindings. To hold it as easy as possible I reduced the code to a minimum. If this works, I could continue the hard ...
2
votes
3answers
69 views

How to paint onto 3d models

I have searched this topic for very long time and have found basically no information on it. If we have a 3d model with a uv layout. What is the basic technique for 3d painting on said model with a ...
2
votes
2answers
175 views

OpenGL - Recreate position in viewspace from depth values

Current state: I belive the reconstructed positions are correct. However, I still have the same problem as all the time. When I rotate around my single pointlight appears to be moving around also. I ...
1
vote
1answer
78 views

What is the simplest way to create basic 3d/isometric style images programatically like autocad/blender

I need the simplest route to programatically, via command line, through python or node, to create something like this using basic input of distance and 90 degree turn etc: https://i.imgur.com/SdY02gQ....
0
votes
0answers
55 views

Calculating of vectors in Phong Lighting Model

I'm learning about computer graphics and I have some questions about calculation of the vectors, so I will write the exercises that I have and I hope that someone can help me with the formulas that I ...
1
vote
1answer
61 views

Using buffers correctly in OpenGL compute shaders

I'm re-writing an algorithm that I first wrote using matrix/vector operation into OpenGL kernels in order to try to maximiz the performances. I have a basic knowledge of OpenGL, so I was able to get ...
0
votes
0answers
22 views

Implementing Feather feature of Photoshop

The "feather" in photo & video editing softwares like photoshop & Premiere Pro, I need to know whether it is simply a Gaussian blur around the edges of boundary or it is something ...
1
vote
1answer
43 views

How 3D painting software works

I am new to graphics programming and i'm learning opengl. I managed to make a really simple renderer where i can import models display theirs textures with all lighting. My goal is to make a simple ...
1
vote
1answer
20 views

Using original vertices coordinates after clipping

Clipping is down in homogeneous clip space, therefore after multiplying the vertices by the model-view matrix. But as we do clipping in clip space, the position of the new vertices that we interpolate ...
0
votes
0answers
37 views

GLSL asymmetric performance for point cloud

I'm currently using OpenTK (OpenGL binding for C#) to draw a lot of points (~17 million) - that very rarely change - in a cube (256 x 256 x 256) with different float "transparency weights". ...
0
votes
1answer
16 views

Get binding point of sampler/image in shader

I have an image and a sampler declared in a shader as follow layout(binding = 5) uniform isampler2D heightmap; layout(binding = 3) uniform writeonly uimage2D info; ...
0
votes
1answer
33 views

OpenGL shader introspection/interface queries for images

I've been looking at Interface queries in order to prevent common mistakes that are time consuming to debug, such as forgetting to bind a buffer, binding the wrong resource type, etc. However, I wasn'...
1
vote
1answer
55 views

Is it possible to send Texture Buffer to shader dynamically?

I want to send a series of integer to the geometry shader, while the data will be modified every frame. But when I try to retrive the sampleBuffer in geometry shader, it seems to keep output zero. Am ...
1
vote
1answer
71 views

Transfer the texture between two different sets of uv

Say I have a mesh with two sets of uvs. And I have a texture made for the first set of uvs. I would like to create a second texture that has the same relationship between its pixels and the second set ...
2
votes
0answers
58 views

How to retrieve data from Compute Shader to CPU?

I want to retrieve data that has created by the compute shader but have no clue how it works. After researching a few forums and articles on how it should work and this is what I came up with. Compute ...
1
vote
1answer
58 views

Does atomic functions on same memory location cause an performance issue?

is it worse to do for each invocation an atomicAdd on the same memory location than doing for each invocation an atomicAdd to a unique memory location? (I know, atomicAdd does not make sense when each ...
1
vote
0answers
54 views

Conditionals and branching in shaders

This is a quite wide subject which implies a lot of topics such as the platform or the compiler, but I think that it could be useful for everyone to know more about this. A common mistake is to think ...
1
vote
1answer
75 views

How are textures projected onto 3d models in texture painting applications

In most modeling software you can texture paint onto 3d models using so called stencil textures. They basically project a texture from the viewport view onto the model as seen for instance in the ...
1
vote
1answer
51 views

When unsetting a VAO, should you also unbind the associated VBOs?

I'm working with a js/wasm/c++ program that uses object oriented programming when updating the OpenGL state. There are corresponding c++ classes for VBOs (vertex buffer) and VAOs (vertex array). ...
1
vote
1answer
35 views

OpenGL Framebuffer with multiple Depthbuffers inside

I am trying to put multiple depthbuffers into one Framebuffer. I want to use VR and render both eyes at the same time: that means, in the geometry stage I want to clone the incoming triangle to two ...
1
vote
2answers
99 views

Why negate z when constructing projection matrix OpenGL

I constructed an orthographic projection matrix from this article on scratchpixel.com: ...
0
votes
0answers
48 views

Crystal ball rotation - I don't get why the code works

For context: I'm absolutely new to graphics programming and I've always had trouble getting the math. I had the task to write code for a crystal ball interface using OpenGL. There's an object in the ...
1
vote
1answer
133 views

How to scale signed distance field fonts properly?

I have a setup where I'm rendering a bunch of characters on a canvas with an SDF font. The users can zoom in to see the details of the smaller texts, but currently the smaller characters are quite ...
1
vote
0answers
80 views

OpenGL/D3D11 offscreen render multiple buffering

Recently I've been looking at Vulkan, and one thing that I noticed is that the application is responsible for choosing which buffer to render to in the case of multiple buffering. This got me thinking:...
2
votes
1answer
117 views

Dynamic Ray-Triangle Intersection

I am working on a small simulation software which has a 3D Renderer that is using OpenGL. I render objects to the screen as triangle meshes. To be able to select the triangles on the screen, I have ...
2
votes
1answer
73 views

Can the framebuffer in OpenGL jargon or its color buffer end up being the one and the same memory location as the one scanned by a display controller?

My understanding is: the 'framebuffer' in OpenGL is a collection of buffers: many (due to swapping or stereo rendering) color buffers, (only one?) z-buffer and (only one?) stencil buffer; each OpenGL ...
0
votes
0answers
19 views

Open GL mapping/hash function on hexagon grid, translating from a cell ID to pixel location on 1d texture

I've spent the last three days trying to figure this out, my intuition about this space has been thrown out of the window. The problem is this: I have a hexagon grid making function that returns an id ...

1
2 3 4 5
12