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.

127 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
127 views

Apply transformation to single vertices in OpenGL in order to deform mesh

I'm making a 2D cell simulation game. The mesh for my cell is basically just a manually-generated triangle fan that looks like this. I would like to reproduce the wobbling/vibration effect on the ...
1
vote
0answers
38 views

Optimizing texture fetches with higher mip levels

Let's say I have some shader program in DirectX or OpenGL rendering a full screen quad. And in a pixel/fragment shader I sample some huge textures at random texture coordinates. That is one same ...
1
vote
0answers
109 views

gBuffer view/eye space missing z (depth) value?

I need some help understanding whats happening to my view space. I have the following colour buffers coming out of my deffered renderer... My concern is with the view space buffer (third image), ...
1
vote
0answers
277 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: ...
1
vote
0answers
93 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
0answers
23 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
0answers
74 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 ...
1
vote
0answers
110 views

Specular/Diffuse light on an icosahedron opengl

I'm having a problem with my model here. I draw an icosahedron using GLUT, and the radius is set to 0.8. The info of the coordinates are listed below: (X and Z are calculated since our radius is 0.8) ...
1
vote
0answers
60 views

Identification of visible area of a plane in OpenGL

I have somewhat generalized version of this question: https://stackoverflow.com/questions/52475104/how-to-show-visible-part-of-planar-world-rendered-with-3d-perspective-on-topside -‎ I would also like ...
1
vote
0answers
101 views

glTexSubImage3D throws GL_INVALID_ENUMERATION on NVIDIA

I'm having problems when using the following statement on different GPUs: glTexSubImage3D(target, 0, 0, 0, 0, width, height, layers, format, type, NULL); on ...
1
vote
0answers
646 views

How Skia uses OpenGL backend?

Skia 2D's one notable backend in OpenGL, but how does it work under the hood to render? Say, we need to draw an anti-aliased circle. Does Skia: make a quad (using 2 triangles) and paint the circle ...
1
vote
0answers
975 views

OpenGL - Fit High/Low Resolution Image/Texture to a particular size Window

Consider a ray tracer written in OpenGL and using GLFW as a window toolkit. There are basically 2 options to display the ray-traced image. 1) Create a RenderBuffer ...
1
vote
0answers
227 views

Voxel cone tracing artifacts (what causes them and how to solve them)?

I am trying to generate soft shadows using voxel cone tracing. Which gives me the next images: In the first image you can see an artifact of a sequence of horizontal shadows alternating with ...
1
vote
0answers
528 views

How exactly do soft shadows get generated using a voxel cone tracing rendering technique?

Let's assume we have voxelized a scene, and all of our materials have an opacity level of 1. The reuslt would then look like: If we raytraced the final volume that gets generated after rasterization. ...
1
vote
0answers
60 views

Handling varying texture sizes in an array texture

Say we've idetified that we have a varying number of textures that are upper capped by 2 parametrs. thus we allocate the maximum amount of memory needed to store all textures as follows: ...
1
vote
0answers
136 views

GLSL can't calculate texture and reflection

I'm working on a universal shader, and have a function for calculating reflections and a function for textures. When I run the shader, it seems to give up and discard all fragments. The texture and ...
1
vote
0answers
76 views

How to pass *struct*ured data from libGDX to openGL shader?

I know about the standard methods to pass floats, ints, or vectors. However, I'm curious whether there is an elegant way to pass data from libGDX Java code directly into a shader struct. I'm looking ...
1
vote
0answers
90 views

How to eliminate line aliasing in an object made of cubes?

I have a big cube made of smaller cubes, but sometimes, due to the fact that each side of the cube has different colors, I get some ugly colored lines that I would like to get rid off. Any advice is ...
1
vote
0answers
762 views

360 degrees rotation around x axis

How do we rotate the camera around x axis 360 degrees, without having to flip the axis, meaning without having the strange flip after we go over +-90 degrees on <...
1
vote
0answers
91 views

Manipulating simulation within glutMainLoop from an Excel spreadsheet

I'm launching OpenGL from a VBA module linked to an Excel spreadsheet which goes quasi-dormant (the quasi will become clear in a moment) once I enter glutMainLoop. I would like to be able to edit the ...
1
vote
0answers
291 views

Subdivision vertex normal interpolation

I'm using GLSL 4.0 to write a subdivision routine that divides the triangles on an object through a geometry shader. I'm not using barycentric co-ordinates but vector arithmetic to output the triangle ...
1
vote
0answers
98 views

Scalar multiplication in vecmath on Matrix4f results in strange values

So I have a matrix: ...
1
vote
1answer
58 views

is doing transform feedback while rendering vertices not possible?

I've written a program that uses OpenGL and GLFW to display some simple geometric shapes. I'm now trying to add some transform feedback capability to it and I find that as soon as I do so, the program ...
0
votes
0answers
21 views

SSAO with reconstructed depths yields strip artifacts

I wrote an ssao algorithm with compute shaders and view-position-reconstruction from the depth buffer. It works great for objects near by but results in strip or banding artifacts for large planes ...
0
votes
1answer
82 views

OpenGL state management

I am working on a software with lots of different shaders, which require different states in OpenGL. My problem is the following: The different models with different shaders are not rendered in the ...
0
votes
0answers
69 views

opengl and glxinfo

I have a question about reading glxinfo. I'm running a Fedora 31 virtual machine. When I look at glxinfo (using softpipe) with this command: ...
0
votes
0answers
17 views

openGL plotting point to window not using glutDisplayFunc(your_func)

I want to plot complex data points to a window to display. I know how to do it all in one go: ...
0
votes
0answers
51 views

Dark line artifact along edges of the shaded mesh

I have implemented an algorithm to calculate vertex normals by taking the normalized average of all its adjacent triangles. I have subdivided a cube two times with catmull clark and checked the ...
0
votes
0answers
41 views

How widespread are T-vertex artifacts nowadays?

As far as I know, OpenGL specifies that you cannot rely on precise rounding of vertex and edge coordinates for rasterization - which means that T-vertices may cause small artifacts: a continuous and a ...
0
votes
0answers
37 views

Calculating the intersection of two volumes

What is an efficient way to calculate the volume of intersection of two arbitrary volumes described as closed surfaces? That is, with two meshes, A and B, how do I calculate the intersection of A and ...
0
votes
0answers
23 views

OpenGL Per-Object Outlining issues

I'm trying to draw onlines around the objects, the outlines for any object should be see though very other object, I've successfully been able to draw the outline but the pixels get discarded in the ...
0
votes
0answers
28 views

List all faces of a mesh visible from the view of the camera Opengl

as the question suggests I have to identify all the faces that are visible from the camera's view and do some processing with them. I have a single mesh. I am thinking of giving individual faces a ...
0
votes
0answers
54 views

Constructing relatively big point clouds from two images

I apologize in advance for this question asking for a recommendation, but I'm not so advanced in CG to research this topic myself. Basic problem I'm looking for a most suitable approach to render a ...
0
votes
0answers
45 views

OPENGL NURBS in VBA

I'm coding OPENGL with Excel VBA I'm using arkham46 package which is really great: Découvrez la 3D OpenGL 1.1 en VB6/VBA | arkham46.developpez.com I'm not able to display NURBS surfaces, only NURBS ...
0
votes
1answer
80 views

rendering a triangle has no color

I wrote a program to render a simple triangle with colors, the triangle is there but there's no color. ...
0
votes
1answer
77 views

OpenGL blending with the screen

I don't understand how OpenGL performs the blending of a texture on the screen. By default, the clear color is set to (0, 0, 0, 0). If we use the default blending equation GL_SRC_ALPHA and ...
0
votes
0answers
47 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
0answers
152 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 ...
0
votes
0answers
17 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 ...
0
votes
1answer
115 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
0answers
33 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 ...
0
votes
0answers
53 views

How to deallocate memory for vertex buffer objects

I have a class that handles loading buffers for a mesh: ...
0
votes
0answers
59 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
23 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
0answers
28 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
0answers
61 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 ...
0
votes
0answers
36 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
543 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: ...
0
votes
0answers
99 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 ...
0
votes
0answers
19 views

Custom Create Maps in OpenGL

I am trying to create some procedurally created terrains for which i need to create noise maps. How do I create a texture of noise map in OpenGL and then pass that in my vertex shader as a heightMap? ...