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.

3
votes
1answer
39 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
65 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 ...
0
votes
0answers
4 views

qt - loading 3d model - precompiled headers problem [migrated]

I'm newbie in Graphics, I want to load 3d model (ex: .off) an use it data with cgal I'm using Qt creator on Fedora OS. I tried this example: http://www.codersource.net/2011/01/29/loading-3d-files-...
2
votes
1answer
89 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
42 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
40 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
50 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
39 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
26 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
78 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
48 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
30 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
39 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
35 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
152 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
44 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
60 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
28 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
68 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
61 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
60 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
51 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
87 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
108 views

What is OpenGL's paradigm?

OpenGL is not object-oriented, but more like "switches you turn on"? Like ...
0
votes
1answer
67 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
19 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
178 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
47 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
69 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
42 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
53 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 ...
0
votes
0answers
70 views

Texture coordinates for cone

I am new to OpenGL so forgive me for the basic questions. I am trying to draw a cone with texture coordinates and surface normals. The surface normals seems to be working fine for the lighting part ...
-1
votes
1answer
26 views

Cant seem to get pyopengl tutorial 4 to work

i am trying to work through some of the tutorials for pyopengl and cant seem to get it working. the only message i'm getting is a warning: python tutorial4.py <...
0
votes
1answer
85 views

Opengl black screen for a simple translation

i am a beginner to opengl following an online guide, I am trying to make a simple translation to my triangle. The triangle did render correctly when i made a float uniform to translate it, but when i ...
0
votes
0answers
54 views

How to properly modify a ray in a raytracer to achieve camera rotation

I am trying to make a particular kind of raytracer, but there is some strange bug occurring when I attempt to rotate the camera. As you can see, there is some important distortion ocurring when the ...
0
votes
1answer
138 views

Distorted OpenGL graphics in certain models of Intel GPUs under Windows; possible causes?

I'm not sure this is the best place to post this, but it definitely seemed more appropriate than programming. I'm one of the developers of Performous, essentially a karaoke (and instruments) game. We ...
0
votes
0answers
44 views

Performance drop caused by vertex shader

I'm rendering the Sponza scene and performance drops based on how many objects are located in camera frustum. Worst case scenario takes up to 25ms per frame, but when looking close at a flat wall ...
1
vote
1answer
223 views

How to use GLSL texelFetch?

I have read the OpenGl documentation of texelFetch, which is: gvec4 texelFetch(gsampler2D sampler, ivec2 P, int lod). I know the first argument "sampler" is just a texture. But I am very confused ...
3
votes
1answer
91 views

How to align Ray Marching on top of traditional 3D rasterization?

I'm trying to apply raymarching on top of 3D rasterization, ordering what 3D object gets displayed based on the depth of a rasterization pass and the raymarch depth. After getting the transform ...
1
vote
1answer
69 views

How different is the SPIR-V accepted by OpenGL (ARB_gl_spirv) from SPIR-V accepted by Vulkan?

The format of SPIR-V bytecode is probably one of the least documented parts of both OpenGL and Vulkan that I am aware of. I have compiled a very basic fragment shaders into both the OpenGL and Vulkan ...
4
votes
1answer
158 views

Manually fetching 8 neighboring texels from 3D texture greatly decreases performance

I'm implementing manual interpolation between texels in a 3D texture to be able to discard some of them when needed. Compared to hardware interpolation, this process takes a lot of time. If I simply ...
0
votes
1answer
53 views

Skeletal animation: What is the purpose of multiplying interpolated bone matrix with parent's matrix?

Let's say I have the following hierarchy: Bone A Bone B Bone C Here's how most tutorial is telling me how to calculate the finalMatrix to be sent to ...
1
vote
1answer
91 views

Confusion about how inverse bind pose is actually calculated and used?

I am trying to do skeletal animation using Assimp and the inverse bind pose matrix just trips me up. I will give a little example to illustrate my point. ...
3
votes
4answers
134 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 ...
0
votes
1answer
95 views

What is the typical use case for rendering to an image through imageStore?

The typical scenario for using a texture would simply be: ...
0
votes
2answers
30 views

How can DSA functions be used without extension names on lower versions of OpenGL?

My GPU supports OpenGL 4.4 but looking at the OpenGL extensions viewer the only part of 4.5 that it does not support is the GLSL version. I am able to use all DSA functions without specifying any ...
1
vote
1answer
36 views

What are the performance implications of the optional flags used when mapping a buffer?

The docs for glMapNamedBufferRange list several optional flags that can be used when a buffer is mapped such as ...