Skip to main content

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

OpenGL ES vertex/fragment shaders - Blinn phong

I'm developing a simple educational project to study OpenGL ES. I'm try to render some simple OBJ models using Blinn-Phong. The first version of the of my implementation calculate all the lighting ...
Fabrizio Duroni's user avatar
4 votes
0 answers
1k views

Represent vector with arrow

Another code review question. I am trying to draw an arrow to represent a vector. I have started with an unit arrow with vertices defined as follows: ...
Sayan Pal's user avatar
  • 263
4 votes
0 answers
715 views

How does function for mouse in glutMouseFunc(mouse) work in openGL? [closed]

I have been trying to implement the following functionality in my code: There are 2 flags editMode and deleteMode, both set to zero. with the help of keys function in glutKeyBoardFunc(keys) the user ...
shane's user avatar
  • 141
3 votes
2 answers
446 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 ...
Osama Asif C Infinitum's user avatar
3 votes
2 answers
2k views

Why do we multiply vertex from left side in vertex shader with matrices?

I have been learning OpenGL 3.3 and I saw this expression: gl_Position = projection * view * model * vertex I am confused because I read in some book that if the ...
videogamechef's user avatar
3 votes
4 answers
553 views

How to access several textures from huge amount of textures in a shader?

I'm developing a light probe based GI solution and currently dealing with light leaks due to interpolation between probes located on opposite sides of the walls. I want to tackle the problem by ...
Pavlo Muratov's user avatar
3 votes
2 answers
5k 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 ...
gndpsingh's user avatar
3 votes
1 answer
3k views

What are Jittering and Dithering

I've heard a lot about jittering and dithering but I would like to know more about those techniques, especially when used to avoid visible sampling in a fragment shader. What are the differences ...
MaT's user avatar
  • 1,229
3 votes
1 answer
185 views

What mechanisms are being used by Directx12 and Vulkan APIs in order to communicate with graphic card drivers internally?

I am trying and learning to develop a low level graphics API. I want to know, how do modern graphics APIs manage to communicate with graphic card drivers (to tackle GPU) so efficiently and in an ...
Buddhika Chaturanga's user avatar
3 votes
1 answer
1k views

Shader storage buffer indexing by 4 bytes instead of 3?

I am trying to send rendering information for an instancing rendering using shader buffer objects. My current problem is that I have 2 shader buffer objects, one which works just fine, and another ...
Makogan's user avatar
  • 1,726
3 votes
1 answer
3k views

Correct way to set normal strength

I am working on a normal mapping. I need to have the ability to scale normal vectors to adjust the normal strength of the surface. Currently the way I am doing it basically shows plausible results. ...
Michael IV's user avatar
3 votes
4 answers
1k views

Clashes when combining openGL and GUI

For the fun of it, I've taken up a task of writing a level editor for a voxel game. The idea is to have window that contains two main components. First component is openGL viewport placed in lower ...
Karlovsky120's user avatar
3 votes
1 answer
853 views

Can I use QueryPerformanceCounter to measure single draw or compute call performance?

I know I can use QueryPerformanceCounter for measure time for whole single frame. But can I when it comes to OpenGL draw or compute call? I always assumed that, as ...
mdkdy's user avatar
  • 2,169
3 votes
1 answer
2k 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 ...
Trantor's user avatar
  • 141
3 votes
1 answer
995 views

How to solve Z buffer artifacts

I am currently rendering a scene in the most standard fashion possible (triangle projection and Blinn-Phong for shading) However I am getting some artifacts: As you can see the lion head is not ...
Makogan's user avatar
  • 1,726
3 votes
1 answer
1k views

What if we don't mention Modelview and projection matrix?

So I've been learning opengl for some weeks now and managed to understand all the viewing pipelines. As far my understanding goes we need to bring the object to world space and then the world space to ...
Broskiee's user avatar
  • 133
3 votes
1 answer
692 views

Why does my lighting look incorrect?

I have a problem with lighting calculations. I am rotating the camera around a cube which was supposed to be illuminated by the light but the resulting lighting is very weird. Check out the image ...
videogamechef's user avatar
3 votes
1 answer
1k views

Compute Shader shared average value

Short Question: How can i integrate a buffer variable in a compute shader over each pixel i.e. how can i ensure memory coherence in such a case? Long Question: I've written a deferred renderer with ...
Sprinklerkopf's user avatar
3 votes
1 answer
2k views

How to unproject cursor with orthographic projection

With perspective projection we can unproject screen space coordinates of the cursor to the near and far plane of the frustum and calculate the direction of the ray through the cursor. ...
Lenny White's user avatar
3 votes
1 answer
242 views

OpenGL task/mesh shader extension NV_mesh_shader not behaving as I expected

I am trying to get up to speed with the NV_mesh_shader extension from NVidia (on my RTX2080). Samples are rare, so I tried to come up with my own small sample. I am rendering a sphere (20 triangles) ...
pettersson's user avatar
3 votes
1 answer
658 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 ...
JHall's user avatar
  • 57
3 votes
1 answer
273 views

If I have more than enough memory, can it still be beneficial to use compressed textures?

I'm wondering whether some of you would have tested and seen quite a difference in using a compressed texture even when the OpenGL environment does not need saving any memory (i.e. the card has more ...
Alexis Wilke's user avatar
3 votes
1 answer
5k views

Replacing Vertex Attributes (glBufferData vs glBufferSubData)

I'm sending a large number of data to the vertex shader. I use glBufferData to generate my ...
Archmede's user avatar
  • 491
3 votes
1 answer
1k views

Do I need to use glMemoryBarrier with atomic counters?

The OpenGL SuperBible 7th Edition points out that the glMemoryBarrier() function supports a bit specifically for synchronizing access to atomic counters with other parts of the OpenGL pipeline ...
Startec's user avatar
  • 781
3 votes
1 answer
3k views

WebGL: Why are my textures black?

I am trying to write a simple WebGL script to display a pyramid with a brick texture and Phong lighting. The lighting works fine but when I incorporate the texture, the pyramid turns black. I've ...
mago3421's user avatar
3 votes
1 answer
2k views

How to get the GLFW_CONTEXT_VERSION_MAJOR value?

This code snippet: ...
Adrian's user avatar
  • 667
3 votes
2 answers
3k views

Setting up integer texture and binding as image

When I set up a texture as float it works (color is written - BTW I'm doing voxelization): ...
mdkdy's user avatar
  • 2,169
3 votes
1 answer
386 views

What is causing this odd scaling behavior?

OK so I have a simple setup going on. Basically I am just drawing some textures and shapes. However sizing is going weird... let me show you how any maybe you can diagnose. Basically everything is ...
J.Doe's user avatar
  • 1,445
3 votes
1 answer
995 views

Shader that transforms a mercator projection to equirectangular?

I am new in the OpenGL - GLSL and trying to make a shader that taking a mercator projection texture as a source and converting it to an equirectangular projection texture. Sample input: (1024x1024) ...
Hamid Reza Mohammadi's user avatar
3 votes
1 answer
409 views

glBindImageTexture returning INVALID_VALUE

I am currently having an issue with OpenGL as I am trying to load some vector information into a 3D texture. Currently, I am developing in OpenGL 4.6 which should support Image bindings. this my ...
Sachin Chopra's user avatar
3 votes
1 answer
4k 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. ...
RoboticForest's user avatar
3 votes
1 answer
1k views

Most efficient way to render many OO meshes in OpenGL

I am writing a large 3D game in Java with OpenGL. Question #1 As of now, I am rendering my 3D objects using a Model class that I defined. This class contains vertex,...
clabe45's user avatar
  • 163
3 votes
1 answer
2k views

Do I have to have a buffer bound before making a draw call?

I have a very simple OpenGL program where the positions are embedded in the GLSL code. The vertex shader looks like this: ...
Startec's user avatar
  • 781
3 votes
2 answers
512 views

What is the best practice for data in a VBO?

To start, this is my VBO Data Struct: ...
BadSnowflake's user avatar
3 votes
2 answers
15k views

Send Texture to Shader

I've been following the LearnOpenGL tutorials and I've come across a piece of code I don't understand. ...
Archmede's user avatar
  • 491
3 votes
1 answer
1k views

Multiple buffers and calling glBufferSubData

In my project, for convenience I would like to use many buffers. Many buffers in my case means 50-100 terrain patches represented by buffers with vertex coordinates, normals, indices and maybe color. ...
remi000's user avatar
  • 240
3 votes
1 answer
3k views

Unable to pass custom Matrix4 to GLSL as a uniform

I am fairly new to graphics programming and I am trying to pass a custom Matrix4 (non-glm) to my vertex shader by using a uniform. ...
Jigo's user avatar
  • 33
3 votes
1 answer
761 views

Benchmark GLSL fragment shader

How can I benchmark a fragment shader? What my shader does is basically lots of floating point operations, since it's doing some procedural stuff.
user24100's user avatar
3 votes
1 answer
269 views

OpenGL ES Frag Shader - Branching

Working on optimizing a fragment shader which is slowing down my OpenGL ES 2.0 shader based game. This is used with a shadow buffer to determine if the fragment/pixel is inside a shadow volume. The ...
Blaine Hodge's user avatar
3 votes
2 answers
955 views

Rotate a cylinder from XY plane to given points

I am given geometry of a cylinder which lies on the XY plane with 1 unit radius. And given coordinates of 2 points in 3D I need to move the cylinder so that it connects the two points. What I tried ...
Akshay Jain's user avatar
3 votes
1 answer
6k views

Why is my fragment shader not showing any colors?

I am basically following this tutorial about diffuse lighting in OpenGL. I did some modifications but the idea is the same, at least that's what I think. However, my fragment shader is not showing any ...
BRabbit27's user avatar
  • 969
3 votes
1 answer
3k views

OpenGL and GLUT in x64 on Windows (Visual C++ 2019)

I'm just starting to self-learn OpenGL. I have OpenGL A Primer (2nd edition) by Edward Angel and I found this useful site for setting up OpenGL with Visual Studio 2019 on Windows: https://www....
Dave's user avatar
  • 131
3 votes
1 answer
275 views

Problem when performing IFFT for Tessendorf's ocean waves

I am implementing Jerry Tessendorf's ocean waves as described in his paper in c++ and OpenGL. I implemented two compute shaders, one for the h_tilde_0 and its conjugate, and one for the frequency ...
Facundo Pedro Astiz Meyer's user avatar
3 votes
1 answer
644 views

Sampling the light vs. sampling the BRDF: difference in intensity

(possible duplicate) I'm trying to implement multiple importance sampling, as described in the PBRT book (no bouncing yet, I want to make MIS work first). What my problem is, that while the BRDF ...
Asylum's user avatar
  • 151
3 votes
1 answer
471 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 ...
Clutterhead's user avatar
3 votes
1 answer
379 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 ...
BadZen's user avatar
  • 143
3 votes
1 answer
1k 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 ...
Guerlando OCs's user avatar
3 votes
1 answer
518 views

How to apply wire texture for realistic rendering of embroidery?

I am building an algorithm which takes a bitmap image as input and render the image as an embroidery design. The different steps are : Vectorize the image, I keep only 5 colors (Done) Generate ...
pensfute's user avatar
  • 131
3 votes
1 answer
310 views

How to voxelize geometry using textures and shaders?

I am trying to fetch a given geometry and, through (potentially multiple) render passes, create a 3D texture that stores the color value of said geometry into an associated texel. In other words ...
Makogan's user avatar
  • 1,726
3 votes
1 answer
590 views

How does opengl fixed function pipeline determine specular lighting with an orthographic projection

I have a scene set up with an orthographic projection with the near / far set from -5000 to 5000. The model view is centered at 0 in the z-axis. I am rendering a sphere centered at z=0 with lighting,...
default's user avatar
  • 333

1
3 4
5
6 7
15