Questions tagged [opengl]

For questions involving use of the OpenGL graphics library.

Filter by
Sorted by
Tagged with
1
vote
0answers
27 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 ...
2
votes
1answer
29 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 ...
0
votes
0answers
28 views

How To Upgrade My Intel Graphics Driver? [on hold]

I have Ubuntu 18.04. When I run glxinfo | grep OpenGL, I get this: I have OpenGL 3.0 but I want this to be upgraded to OpenGL 3.1+. I tried to do what was advised in https://askubuntu.com/questions/...
2
votes
0answers
42 views

Screen space reflections become warped when looking up or down

I have been experiencing issues over the past few days with implementing SSR on water into my engine. Looking straight forward, it appears to be alright. However, when I look up or down, the ...
2
votes
1answer
53 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 ...
1
vote
1answer
43 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 ...
0
votes
1answer
65 views

How can i create a 3D Sphere(earth) 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 ...
0
votes
1answer
45 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 ...
1
vote
1answer
29 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 ...
1
vote
1answer
56 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 ...
2
votes
1answer
98 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 ...
2
votes
1answer
35 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 : ...
0
votes
0answers
26 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 ...
3
votes
2answers
190 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 ...
1
vote
1answer
67 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 ...
2
votes
1answer
36 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. ...
5
votes
2answers
100 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 ...
2
votes
0answers
19 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 ...
0
votes
0answers
24 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 ...
0
votes
0answers
46 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 ...
0
votes
1answer
35 views

Unity: Pass texture pointer from OpenGL to Unity

I'm working on a scene in Unity where I have textures loaded at runtime. As a result of that, the scene is being slowed down (even with co-routines), so I thought maybe I could move the texture ...
2
votes
1answer
98 views

gl_FragCoord and glViewport

I've been scanning the specifications for both OpenGL and GLSL, and I can't find a definitive answer as to how exactly are gl_FragCoord's ...
0
votes
1answer
54 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 ...
2
votes
1answer
92 views

How to do CSG on 3D triangulated objects, originally stored as a .obj file, using openGL or other libraries?

What I would like to do is to create a crater on a field. To do so, I thought that creating a universal crater object (something cone-shaped) and then subtracting it from the field on a specified ...
2
votes
1answer
54 views

GL_DEPTH_CLAMP has no effect (reverse z)

In an effort to improve cascaded shadow maps, I have looked into using GL_DEPTH_CLAMP and moving the near and far plane just around the actual view frustum instead of the global bounding box. But the ...
2
votes
1answer
62 views

Why is cos(𝜃) in the denominator in the reflectance equation and in the numerator in the shading equation?

Background: I'm reading https://learnopengl.com/PBR to learn about PBR. In the theory slide (https://learnopengl.com/PBR/Theory), the author has the reflectant equation as The theta (the angle ...
0
votes
1answer
88 views

Sphere Texture Mapping Algorithm

I am trying to generate UV coordinates automatically to map a texture on a sphere. The problem is with seams when going from 0.8 to 0.2 there is a discontinuity and interpolation in fragment shader ...
-1
votes
1answer
82 views

Difficulty including GLM into Visual Studio with OpenGL

I have been trying to implement GLM (math library) into Visual Studio with OpenGL. I have followed and watched many online resources that point me to include only the GLM folder inside the ...
1
vote
0answers
68 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 ...
2
votes
0answers
55 views

Show the edges between the clipping plane and clipped objects [closed]

I want to utilize shaders to not only discard fragments if they are on one side of a predefined plane but also render a contour along the intersection. My fragment shader currently does something ...
-2
votes
1answer
114 views

This function syntax is confusing me

gladLoadGLLoader((GLADloadproc)glfwGetProcAddress) I have never seen this syntax before. Presumably glfGetProcAddres is a function, but it has the brackets behind it. Is this only possible in open gl ...
1
vote
1answer
116 views

GBuffer: Framebuffer with different texture format types?

I rely on this answer from Nathan Reed: How much precision do I need in my G-Buffer? It is proposed to use two different texture formats for one Gbuffer. However as far as I know, color texture ...
1
vote
1answer
85 views

OpenGL Unable to retrieve the values of data sent to shader using textures

I've been following these tutorials and i can't figure out how to send data to shaders using textures. https://en.wikibooks.org/wiki/OpenGL_Programming/Scientific_OpenGL_Tutorial_02 In this tutorial ...
-1
votes
2answers
324 views

How do I use texture coordinates of a .obj file in OpenGL?

I have an obj file, with texture coordinates (indicated by vt). How would I use this to load textures in OpenGL?
1
vote
0answers
72 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
1answer
60 views

GL_SAMPLE_ALPHA_TO_COVERAGE and depth testing

I am currently looking into alternatives to my current, somewhat slow but exact, OIT approach. Specifically, GL_SAMPLE_ALPHA_TO_COVERAGE to convert the alpha value into a per-sample mask. ...
0
votes
1answer
92 views

Efficiently drawing multiple instances of 3D objects

I was able to write the following working code to draw any number of "sprites" (defined as 2 tringles, 6 vertices) ...
0
votes
1answer
100 views

Convert shader from GLsl 1.50 to 1.30

I'm a newbie with OpenGl and I'm stuck in following the tutorial. I found this tutorial with these shaders ...
0
votes
1answer
123 views

Why is glreadpixels only working in certain cases?

If I try to read the screen with glreadpixels and then draw the same thing again using gldrawpixels it works, BUT if and only if ...
1
vote
1answer
257 views

Is a single shader and 1x1 pixel white sampler more efficient than frequent switching between shaders with and without samplers?

I have some existing OpenGL code that I am porting to Vulkan. The question is somewhat relevant to both OpenGL and Vulkan. I am rendering some primitives using textures, some single channel, others ...
1
vote
1answer
209 views

Translate an arcball camera upwards or left-right

This problem is giving me a really hard time. I'm always looking at the origin and have a camera that moves around it in an arcball mode. That part works beautifully: I'm calculating the camera ...
2
votes
1answer
159 views

Project vertex onto plane

What I have: a plane given by its normal$\ n $ and a point on the plane$\ p $. a 3D-point$\ v $. a direction$\ d$. What I need: the projection of$\ v$ along$\ d$ onto the plane. How can I ...
1
vote
1answer
266 views

Drawing Directed Lines (with arrow endings)

I am working on a simple graph viewer with OpenGL. My problem with is directed edges. I tried to draw arrow endings with GL_TRIANGLES but somehow my calculations are off. I've used direction cosine ...
1
vote
1answer
118 views

Is it possible to access adjacent vertex data in tessellation evaluation shader?

I'm trying to render thick cubic Bezier curves using the whole OpenGL 4.5 pipeline: I render a patch with 4 control points. Vertex shader is simply pass-through to tessellation control shader. ...
2
votes
1answer
90 views

LoopBlinn Cubic Curve Rendering - Serpentine arteffect

I am trying to implement the Loop-Blinn cubic curve in java using the following source codes GPU-Curve-Rendering and WebCore. Both of them are showing few arteffects and i cannot figure out why. Here ...
2
votes
2answers
258 views

How can I draw this style of grid?

I'm trying to write code (in any language) to render this 3D grid, matching the look and colors as closely as possible:
0
votes
1answer
80 views

Adding vbos to a vao once it has been created

Is it possible to add vbos to vbos after their creation? For example (pseudo-code): ...
6
votes
1answer
101 views

Do operating programs such as Microsoft Office or Windows Explorer use OpenGL to draw?

I have a server and my only monitor is plugged into its graphics card. My question is - do all programs (Windows explorer, Excel whatever) draw their output using the graphics card and more ...
0
votes
1answer
126 views

How to include OpenGL extension loader in my project

I have a modern OpenGL project hosted publicly. I want to create the easiest experience so someone can just clone the repo and have it just work. So far, I have included (as git submodules) the ...
2
votes
0answers
52 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 ...