Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [opengl]

For questions involving use of the OpenGL graphics library.

0
votes
1answer
34 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 ...
0
votes
0answers
24 views

GLSL texture not applying properly

I was following the model loading tutorial here and am having issues displaying the model correctly, specifically applying the texture correctly. I am sending the diffuse textures to the shader in an ...
1
vote
1answer
83 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
82 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
64 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
40 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
55 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. ...
-1
votes
0answers
38 views

Shapes in OpenGL not displaying properly

I'm working on the below code for an assignment and I'm running into a snag. The shapes are supposed to be colored but when I run it they show up as white. I'm not sure what I am missing. ...
2
votes
1answer
68 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
114 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
33 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
77 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
29 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 ...
0
votes
0answers
38 views

GLFW Window creation Problem

I recently started programming my own little "game engine", but sometimes I have the problem that the function "glfwCreateWindow" takes up to 10 seconds before my program can continue. This is the ...
0
votes
0answers
51 views

Basic Question: Installing OpenGL 4.6 in Ubuntu

I apologize if this is a documented problem and solution somewhere, but I am having trouble setting up OpenGL development libraries in Ubuntu. I'm on Ubuntu 17.10 and am trying for OpenGL without any ...
2
votes
0answers
47 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 ...
2
votes
2answers
85 views

What's the point of “work groups” for OpenGL compute shaders?

glDispatchCompute has the number of work groups as arguments. What is the point of having work groups? How are they useful, compared to just having NxM independent pixel calculations with a known (x,...
4
votes
1answer
77 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 ...
-1
votes
2answers
73 views

Relatively new to OpenGL, need guidance/tips on an assignment with interactive user input

I'm currently taking a Computer Graphics class at university, and have been given an assignment which involves loading an obj file and manipulating it with keyboard and mouse controls (eg. arrow keys ...
2
votes
1answer
98 views

Why are depth buffer values clamped to (0, 1)?

This is a simple question. I know that in OpenGL or other graphics API, the values stored in the depth buffer are automatically clamped to (0,1). I just want to know why people do this instead of ...
1
vote
1answer
46 views

What does “region to be shaded” mean in the PCF paper?

I am reading the percentage closer filtering (PCF) paper by Reeves, W. et al. (https://graphics.pixar.com/library/ShadowMaps/paper.pdf). At at section 3.2, it mentioned that "each shading calculation ...
3
votes
2answers
53 views

Can gl_WorkGroupSize be set outside the compute shader?

I am migrating code from CUDA to OpenGL compute shaders. I could not find a way to set the local workgroup size outside the shader; is there a way to set gl_WorkGroupSize in the calling program like ...
0
votes
0answers
60 views

Reading Z-buffer with glReadPixels always return 1.0 (OpenGL 3.3)

I'm trying to use glm::unProject (), however, it gives wrong results. I discovered that it is caused by wrong depth returned by ...
0
votes
1answer
55 views

Multiple VAO share a EBO (OpenGL 3.3)

As mentioned here, multiple VAOs can share a single VBO. However, can multiple VAOs share a single EBO? For example, I want to create 2 rectangles. So, I do the following: ...
0
votes
1answer
32 views

Difference between relativeOffset and offset in VAO with Direct Access Ext

Using The DSA Ext with opengl , API calls to guide opengl to the buffer format are : ...
1
vote
1answer
81 views

Issue with loading a texture on the GPU with OpenGL 4.1 Core profile

I’ve been trying to render a texture on the whole screen in OpenGL 4.1 using the Core profile and followed a few tutorials on the matter, but all I have so far is a blank screen. I tried using my ...
1
vote
0answers
51 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 ...
0
votes
0answers
34 views

What is the use of effect files?

I am reading Real Time Rendering and getting confused by something called effect files. From what I understand, it is like a library of pre-written shaders so instead of writing my own shaders for a ...
0
votes
0answers
44 views

How to compute size of OpenGL's image buffer?

I am trying to retrieve OpenGL's color buffer with the following code. My program is crasing in the line that makes the call to glReadPixels() apparently image.data ...
0
votes
0answers
38 views

Should I jump straight to DirectX 12 or is it better to start from DirectX 11 given some OpenGL experience?

I've been studying OGL and developing an engine on it for about 2 years now. I'd like to port this engine to Windows/DirectX eventually, but, before I start, I'd like to ask for advise from people who ...
1
vote
0answers
256 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
1answer
49 views

Drawing a plane super-imposing over another plane

I wish to draw a plane (A building's floor in this case) over a canvas plane (assume the plane is smooth). The planes are drawn as QUADS. The problem is that both plane are located at the same height....
0
votes
0answers
67 views

Hard edges appearing in voxel cone tracing (how to remove them?)

I am generating shadows using a voxel pyramid (commonly called voxel cone, although I hate that term). Some of my shadows come as expected, however some are very strange. For example in this image: ...
0
votes
0answers
29 views

Problem with imageStore to 3D texture on old AMD card

I've been updating an old project that does Marching Cubes using compute shaders, and it fails on my laptop with an old AMD GPU (7670M). After investigating a bit, I found the problem is with writing ...
0
votes
0answers
80 views

Changing coordinate system from texelFetch to textureLod is breaking the algebra

I have a scene rendered using texelFetch() and I am trying to modify the shader to use textureLod() instead. This is the image generated with texelFetch: When I try to change the shader to use ...
0
votes
0answers
75 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
63 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
74 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
2answers
117 views

How to convert from glBegin() and glEnd() to VBOs?

How to convert from glBegin() and glEnd() to VBOs (Vertex Buffer Objects)? I found a simple example here: ...
4
votes
2answers
111 views

What is OpenGL's paradigm?

OpenGL is not object-oriented, but more like "switches you turn on"? Like ...
0
votes
1answer
84 views

Self intersection artifacts in 3D image raytracing

I am developping a voxel raytracer for global illumination. I have been successful in multiple aspects but there is a problem I am not sure how to solve. The model works as most other Voxelization ...
0
votes
1answer
25 views

Texture units parameters in OpenGL

I am writing a procedural terrain renderer for OpenGL. To shade the terrain I use multitexturing, that is 4 material textures and a blend map which distributes them across the terrain (encoded in RGBA)...
0
votes
0answers
50 views

Least painful way of porting OpenGL renderer from Mac to Windows

Can experienced people advise me some tools/approaches for porting my OpenGL engine from Mac to Windows? I've been developing a renderer using C++ as much as possible, but the 'tool' part is written ...
0
votes
0answers
42 views

How to ensure that the raytrcing coordinate system is teh same as the projection one?

I have 2 shading models right now, one is using voxels the other one is the standard projection absed renderization method. Putting them side by side I have noticed that no matter what I do one is ...
2
votes
0answers
180 views

Circular pattern aliasing in voxel ray tracer

I am doing a voxel based raytracer. In other words, I first voxelize the scene using rasterization and I proceed to raytrace the volume in a 3D image to generate a final frame. Currently I noticed ...
1
vote
1answer
50 views

Can you avoid querying for a texture location in OpenGL?

The way I learnt to send a texture to a shader is more or less ...
2
votes
1answer
75 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 ...
1
vote
0answers
35 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
2answers
47 views

How to assign a texture to a single entry of a texture array?

The C++ psuedo code to transmit the idea of what I want to do would be: Texture_array tarr = Texture_array(6); tarr[0] = texture; Which I am attempting to do as ...
1
vote
1answer
110 views

How do you load multiple textures into an array texture with OpenGL?

I have been reading the OpenGL documentation but it is not clear to me how to achieve the following. Say we have an array of strings. Each string in the array is a valid relative path to an image ...