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
2 votes
1 answer
71 views

Point light illuminating only half of a scene

A point light is illuminating only a half of a scene in my small 3D renderer. It happens on every scene I've tried (conference room, cornell box, etc). How do I go about debugging this? What could ...
user avatar
0 votes
0 answers
109 views

After making any 3D model using Opengl how to export it's data in .dae file?

I'm trying to make simple 3d modeling program in c++ with Opengl. So I don't know how to transfer/convert/export or save data of 3D model in .dae file. NOTE:- 3d model is made using Opengl ...
user avatar
1 vote
1 answer
203 views

Generating the end caps of a cylinder using triangle strips for use in a geometry shader

I know how to generate the walls of a cylinder with triangle strips and the caps with triangle fans, but since I am working inside a geometry shader, I can only output triangle strips, so I am kind of ...
user avatar
  • 111
3 votes
1 answer
335 views

Implementing the example of Walter et al. (2007) paper

As the title suggests I'm trying to implement the last images of the "Microfacet Models for Refraction through Rough Surfaces" Paper by Walter et al. in OpenGL I "think" (I had to ...
user avatar
2 votes
0 answers
114 views

Why there are calculation differences in WebGL and OpenGL

I am currently implementing the Mandelbrot fractal on the GPU. I wrote two programs: the first in OpenGL (desktop C++ application) and the second in WebGL (static webpage). The two programs use almost ...
user avatar
  • 43
1 vote
0 answers
164 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 ...
user avatar
3 votes
0 answers
145 views

Projective Texture / Shadow Mapping -- Why is the perspective division performed in the fragment shader?

I've just worked my way through this OpenGL shadow mapping tutorial. While I understand the basic algorithm, one thing puzzles me: During the 2nd render pass all vertices are transformed into the clip ...
user avatar
0 votes
1 answer
326 views

Stumped on GLSL error C5041 (cannot located suitable resources to bind variable... possibly large array

I have an OpenGL based graphics engine coming along quite nicely, but I'm currently stumped on a problem that arose after adding a new vertex shader output array. The vertex shader is outputing the ...
user avatar
1 vote
0 answers
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 ...
user avatar
2 votes
1 answer
105 views

Strange VSync issues on a GTX 1060

I'm out of my wits. I've been working an a voxel game for the last couple of years, written in C# and OpenTK (=OpenGL backend) I've been struggling to achieve a stable frame rate and one of the major ...
user avatar
  • 139
1 vote
0 answers
117 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), ...
user avatar
  • 248
1 vote
1 answer
183 views

How to compute normal in quartic Walton-Meek's Gregory patch in tessellation shader?

I am programing a tessellation shader in OpenGL which computes the quartic Walton-Meek's Gregory patch. I am searching for a local G1 method with good shading/visual results. So I am trying this patch....
user avatar
1 vote
2 answers
58 views

Help with wireframe artifacts on mesh procedural UV texturing

My goal in my project is to render a procedural texture for a given mesh based on a predefined camera projection. The way I choose to accomplish it is by creating tex coords based on only the visible ...
user avatar
2 votes
2 answers
172 views

An idea for an implementation of continuous collision detection of circles [closed]

So I'm making a 2D pool game in OpenGL (you might've guessed as soon as I've mentioned collision of circles). I'm having a little trouble with collision detection. What I mean by that is that I have ...
user avatar
  • 129
1 vote
1 answer
110 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 ...
user avatar
  • 13
3 votes
1 answer
268 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 ...
user avatar
  • 143
1 vote
0 answers
355 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: ...
user avatar
  • 143
4 votes
1 answer
397 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 ...
user avatar
  • 277
0 votes
0 answers
50 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 ...
user avatar
  • 333
0 votes
1 answer
81 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 ...
user avatar
  • 103
1 vote
0 answers
110 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 ...
user avatar
5 votes
1 answer
4k 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 ...
user avatar
  • 277
1 vote
1 answer
128 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 ...
user avatar
  • 212
0 votes
1 answer
172 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: ...
user avatar
  • 101
2 votes
1 answer
445 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 ...
user avatar
  • 163
2 votes
2 answers
3k 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 ...
user avatar
1 vote
0 answers
25 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 ...
user avatar
1 vote
1 answer
129 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 ...
user avatar
  • 113
1 vote
1 answer
630 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 ...
user avatar
  • 117
0 votes
0 answers
162 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 ...
user avatar
  • 279
3 votes
1 answer
387 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 ...
user avatar
  • 45
4 votes
1 answer
1k 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 ...
user avatar
  • 61
1 vote
1 answer
112 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 ...
user avatar
  • 133
2 votes
1 answer
377 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 ...
user avatar
  • 133
2 votes
1 answer
94 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 ...
user avatar
1 vote
1 answer
245 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 ...
user avatar
-1 votes
2 answers
679 views

How can i wrap the earth image around a 3D Sphere 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 ...
user avatar
  • 25
0 votes
1 answer
210 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 ...
user avatar
1 vote
1 answer
55 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 ...
user avatar
  • 179
3 votes
1 answer
780 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 ...
user avatar
2 votes
1 answer
437 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 ...
user avatar
  • 179
2 votes
1 answer
434 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 : ...
user avatar
  • 139
0 votes
0 answers
168 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 ...
user avatar
3 votes
2 answers
328 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 ...
user avatar
1 vote
1 answer
557 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 ...
user avatar
3 votes
1 answer
3k 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. ...
user avatar
5 votes
2 answers
368 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 ...
user avatar
  • 153
3 votes
1 answer
190 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 ...
user avatar
  • 1,457
0 votes
1 answer
3k 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 ...
user avatar
  • 1
0 votes
0 answers
457 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 ...
user avatar
  • 101

1
3 4
5
6 7
14