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
1 vote
1 answer
126 views

GLSL trying to bind two different layers from the same texture array as images. Should it work and if so what am I doing wrong?

I am new at this particular site in the SE ecosystem, but not to computer graphics in general. If I'm in the wrong spot feel free to redirect me. My question regards glsl programming and binding two ...
mathreadler's user avatar
1 vote
1 answer
149 views

Best way for rendering Voronoi diagram from Delaunay graph mesh

I have a set of points, which I triangulate to a Delaunay graph to make a mesh. Every mesh vertex has a unique colour, and I can render it without any problem. But I want Voronoi rendering to be ...
Francesco Sollazzi's user avatar
1 vote
1 answer
32 views

Why shouldn't I discard faces during Tessellation control stage

In the discussion Here there was said, that discarding faces during Tessellation stage should be avoided. What are the reasons for that? Right now, I am rendering a 3D geometry using Vertex, ...
Thomas's user avatar
  • 1,198
1 vote
1 answer
45 views

Why does my uniform only update once?

I have a work thread function which updates the value of a float called scale: ...
lewis's user avatar
  • 21
0 votes
1 answer
237 views

Why are my OpenGL mipmaps and MSAA bad?

Questions: Why does the wavy white line on the tennis ball texture seem to be at the wrong mip level, with blocky artifacts ? For example, at 'A' in the picture. The basketball and football textures ...
Simon's user avatar
  • 163
1 vote
1 answer
623 views

How to instanced and indirect render geometry [OpenGL]

I've a lots of objects, which have the same geometry. Right now I am using instanced rendering to render these objects. This is working very well. But I am trying to increase the performance of the ...
Thomas's user avatar
  • 1,198
2 votes
1 answer
2k 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
  • 121
2 votes
1 answer
42 views

Opengl Texture top row pixels are garbage

This code displays a white texture always except when the dimensions are 383 x 512 ...
ihsan's user avatar
  • 131
0 votes
0 answers
72 views

Shadow mapping with non-directional light

I'm new to openGL and I was following this tutorial in which they showed how to make shadow maps but I could't understand how to get it to work for non-directional lights. They have some instructions ...
n-l-i's user avatar
  • 101
3 votes
0 answers
262 views

What are some good examples of post-processing edge detection?

I'm trying to implement a post-processing pass to detect silhouette-edges from depth data. (by silhouette-edge of a triangles mesh I mean the triangle edges shared by a front and a back-facing ...
leone ruggiero's user avatar
0 votes
1 answer
273 views

Do bindless textures overcome the limit of GL_MAX_TEXTURE_IMAGE_UNITS?

When I have an array of samplers, for example: uniform sampler3D RHToBounceGridR[MULTI_BOUNCES_NUM]; where MULTI_BOUNCES_NUM is ...
mdkdy's user avatar
  • 2,159
0 votes
1 answer
161 views

Am I risking damaging my GPU?

I have written a relatively simple interactive C program using OpenGL 4.4 with a vertex shader and a fragment shader, running in the CodeBlocks IDE on Windows. I included an FPS counter basically as ...
Simon's user avatar
  • 163
0 votes
1 answer
80 views

Identifying an openGL 3d model

I currently have an application that uses openGL in order to render a 3d model of a car. I would like to change the car models but I have no clue what format my application uses. The current format of ...
Hyperdex's user avatar
0 votes
1 answer
53 views

OpenCL WorkGroupSize compared to OpenGL compute shader WorkGroupSize

I've read, that OpenCL kernels are grouped like OpenGL compute shaders. That means, that you can define how many invocations should be executed within a workgroup. These invocations which are in the ...
Thomas's user avatar
  • 1,198
-1 votes
1 answer
460 views

Is a line drawn using vectors, triangles or polygons within OpenGL? [closed]

Trying to understand how OpenGL generates what is seen as images & graphics and these questions come up. Are 3D lines (which should be drawn using vectors) drawn using triangles or polygons? Or ...
AncientTides's user avatar
0 votes
1 answer
511 views

OpenGL compute shader workgroup synconization

I am calculating the Summed Area Table(SAT) of a texture with help of a compute shader in OpenGL. The texture which needs to be summed, has a dimension size of more than my GPU supports (...
Thomas's user avatar
  • 1,198
1 vote
0 answers
175 views

Silhouette edge detection alternatives to Sobel

I'm trying to implement a silhouette detection algorithm in post-processing. I've come across solutions based on Sobel/Roberts cross/... filters and I was wondering if there are more accurate ...
leone ruggiero's user avatar
0 votes
1 answer
98 views

OpenGL - How to increase view space coordinate range in X and Y axis

I'm trying to render some objects but apparently X and Y coordinates need to be really small in-order to get something on screen. See this example of 2 lines The world space coordinates for these ...
gallickgunner's user avatar
0 votes
1 answer
604 views

get binding location of Shader Storage Buffer Object [OpenGL]

I am looking for an opengl function to get the binding location of a SSBO in a shader. I found glGetUniformBlockIndex which works for uniform buffers. But there ...
Thomas's user avatar
  • 1,198
0 votes
1 answer
624 views

Is glActiveTexture() still needed?

I'm using OpenGL 4.30 with JOGL (in Java). I'm playing with basic texturing, trying to learn how it's done. The textbook I'm using has the following code: ...
Adam Smith's user avatar
0 votes
1 answer
412 views

Why is my texture being stretched out on a triangle strip?

I'm trying to apply a texture to 4 different triangle strips using JOGL (OpenGL/Java). I'm trying to make a 1000×1000 path in a square, where the path is 100 wide. The texture should be stamped 10 ...
Adam Smith's user avatar
0 votes
1 answer
85 views

How does swizzling works in ARB shaders?

I am trying to understand some shader code written in ARB. I am mostly using this to understand it. However the doc doesn't explain (or I missed it) how vector operands are transformed into scalars, ...
Aulaulz's user avatar
  • 161
1 vote
1 answer
312 views

How to generate a gradient to the edges of a triangle in GLSL?

I'm looking for an effect similar to this image. Assuming the UV coordinates of the triangle are known, such as: p0 = [0, 0] p1 = [1, 0] p2 = [0, 1] I know the ...
user2867288's user avatar
1 vote
0 answers
69 views

parallelizing a software rasterizer algorithm using opencl

I've written a small software rasterizer using OpenCL and would like to optimize and parallelize it more, currently I'm scanning the whole screen and see if the triangle overlaps with the pixels.. I ...
andre_lamothe's user avatar
0 votes
0 answers
36 views

How do I make "attribute vec0.5" in GLSL. Sorry if it confuses

Is it possible, in OpenGL (specifically in WebGL), to use a single value from buffer for multiple shader iterations? Like to put the same element from buffer into shader attribute multiple times? Like:...
Forprix's user avatar
0 votes
1 answer
214 views

How is mipmap level used mathemetically in image sampling?

I am trying to simulate the behavior of "texelFetch()" and so far I've understood the following: If "gvec4 texelFetch(gsampler3D sampler, ivec3 P, int lod)" is given then : result =...
BusyCoder's user avatar
1 vote
1 answer
54 views

How do I convert pathtraced distance to value that is usable by OpenGL's depthbuffer?

I was hoping someone could check my understanding. I've got a pipeline that does some path tracing, and then draws some debugging rays using standard rasterization. I'm trying to get depth to work ...
Cascades's user avatar
  • 113
2 votes
1 answer
457 views

efficient way to get min/max distance during rendering

I want to improve my shadow mapping depth precision by getting the minimum and maximum depth value within my shadow map. When having both values I would convert the depth map to convolution shadow map ...
Thomas's user avatar
  • 1,198
2 votes
0 answers
120 views

AO Denoise Filter

I'm trying to implement a filter to denoise ambient occlusion data. What kind of filter do you suggest for the purpose? The techniques I've come across are the following: Gaussian filter (doesn't ...
leone ruggiero's user avatar
4 votes
1 answer
241 views

Artifacts while rendering sponza scene

I'm trying to render the Sponza scene using the Cook-Torrance BRDF Model Plugged with the GGX Normal Distribution, Gemoetry Schlick and fresnel Schlick approximation and a punctual point light. When ...
Mohamed Hashem's user avatar
0 votes
1 answer
235 views

Convert one triangle to another in matrix4x4?

The context openGL instances learning. I want to transform a reference triangle to another one. So final goal is to have one triangle and the instance being a transformation of that initial triangle. ...
Kroma's user avatar
  • 103
1 vote
1 answer
1k views

Why must texture samplers be uniform variables in GLSL?

To use a texture in an OpenGL shader, I have to write the Texture Unit to be used into a uniform variable: source.c: ...
Mario's user avatar
  • 13
1 vote
1 answer
181 views

Rendering multiple camera transforms of the same geometry at once

Currently I have a basic (OpenGL 3.3) rendering scheme using a simple depth vertex shader to generate shadow maps for a scene. I don't care about having a large number of lights in the scene so it is ...
lurscher's user avatar
  • 111
-1 votes
1 answer
817 views

Hosting OpenGL C++ Window in C# WPF

I am following this tutorial on how to host Win32 OpenGL windows in WPF. There is also a Microsoft walkthrough on how to Host a Win32 Control in WPF that is useful aswell. The original project is from ...
Arjan Singh's user avatar
  • 2,501
0 votes
1 answer
643 views

How to rotate and move group of objects in OpenGL?

What do I have now? I have a cube consisting of 6 planes. All these planes I generate in XY coordinates and then place them by matrix transformations. I need to rotate my cube along the global axis ...
Андрей Петров's user avatar
0 votes
1 answer
247 views

Understanding gluUnProject

I was studying how the OpenGL's gluUnProject works. There is one thing I don't understand: is there any benefit of returning a ray instead of 3D point? One can use this function to get a ray not a 3D ...
Jimmy Yang's user avatar
0 votes
1 answer
104 views

How to give C++ GLUT project an Editor/UI?

I want to render my OpenGL GLUT project to a window/control in C# WPF. I have read articles online from Microsoft on how to do it but I am very confused. Does anyone have any experience with this? ...
Arjan Singh's user avatar
  • 2,501
2 votes
1 answer
2k views

Calculating maximum number of mipmap levels for OpenGL automatic mipmap storage generation

Using glTexStorage2D(GL_TEXTURE_2D, num_mipmaps, GL_RGBA8, width, height); followed by ...
Simon's user avatar
  • 163
1 vote
1 answer
55 views

What is view transformation and model transformation respectively? How do I implement each transformation in simple opengl program?

I want to know what is view transformation, and what is model transformation respectively, and what methods/functions in opengl could be applied to implement each transformation. Just simple ways to ...
kji's user avatar
  • 23
0 votes
1 answer
160 views

Bump mapping WITH precomputed tangents?

Most bump mapping (meaning black and white height map) uses Tangents/Bitangents computed from Position using dFdx/y. And they also compute the offsets/derivatives of the height map using dFdx/y. The ...
Ascalon's user avatar
  • 51
0 votes
1 answer
438 views

Understanding orthographic projection matrix clip coordinates

I'm confused about what orthographic projection matrix outputs. Based on what I know so far, orthographic projection matrix converts vertexes in eye coordinates into clip coordinates. But what exactly ...
Jimmy Yang's user avatar
0 votes
1 answer
91 views

store GL_TEXTURE_CUBE_MAP_ARRAY data to CPU

I have a GL_TEXTURE_CUBE_MAP_ARRAY texture of 8 cube maps (countLayers). Now I am trying to transfer the pixels to CPU. Currently I am using this code: ...
Thomas's user avatar
  • 1,198
1 vote
2 answers
157 views

Why is there a straight line between my bezier paths?

I have created a bezier curve tool and each time I draw a bezier curve segment I get a straight line between each mouse click. I don't understand why this is happening and was wondering if someone ...
Arjan Singh's user avatar
  • 2,501
1 vote
1 answer
296 views

3D head mesh morphing from one mesh into another using coding

I have 2 3D head images and want to morph one into the other (animation) without using blender etc. I want to do it using coding preferably using C++, C# or python(libraries are ok). I have done 2D ...
suleman butt's user avatar
0 votes
1 answer
630 views

How to detect when left mouse button is released in GLUT after being held in motion?

I am trying to detect when my left mouse button is released to store the result in a boolean variable in OpenGL GLUT. Currently, I am using the motion() function in ...
Arjan Singh's user avatar
  • 2,501
0 votes
1 answer
74 views

Lines not disappearing after being drawn in OpenGL

I am creating a Bezier curve tool in OpenGL and every time my program draws something in motion with cursor coordinates I see the previously drawn lines on the screen for a second or two before they ...
Arjan Singh's user avatar
  • 2,501
0 votes
0 answers
640 views

Bind shader storage buffer object for vertex input

I'm trying to learn about compute shaders, and as such decided to give it a go at implementing the particle system described in these slides: https://www.khronos.org/assets/uploads/developers/library/...
alexpanter's user avatar
0 votes
0 answers
68 views

geometry is invisible when culling front faces

I am trying to implement shadow mapping. Therefore I am trying to render the back faces of the geometry to reduce the shadow acne. When culling back faces everything works (the geometry will be ...
Thomas's user avatar
  • 1,198
0 votes
2 answers
104 views

How to get coordinates of opposite direction from mouse release point relative to a point?

I am trying to implement the pen tool from Adobe Illustrator in OpenGL. I am trying to get the coordinates of the reverse tangent upon mouse release. I tried negating the coordinates I got upon mouse ...
Arjan Singh's user avatar
  • 2,501
0 votes
1 answer
261 views

How to get coordinates of mouse after left mouse button is released after drag in OpenGL?

I want to get the coordinates of my mouse after the left mouse button is released after being dragged in OpenGL? I am new to this and wanted to know how I can implement it.
Arjan Singh's user avatar
  • 2,501

1
2
3 4 5
15