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
6 votes
1 answer
857 views

mapping 3d texture on view frustum (or part of it)

I'm implementing volumetric fog in my OpenGL renderer. First I inject color into 3D texture using compute shader, atomic operations and shadow map visibility check. The information I use to compute ...
mdkdy's user avatar
  • 2,169
6 votes
1 answer
410 views

Can't get output from a GLSL code

I'm trying to learn GLSL, I'm following this tutorial. I've done everything according to the tutorials but I can't get any output from my code. As you see I'm checking for both compile errors and ...
lino's user avatar
  • 163
6 votes
2 answers
549 views

How can I improve the performance of my custom Global Illumination approach?

I want to experiment with some new stuff about modern rendering techniques and in that way I'm trying to implement a custom GI (somewhere between pathtracing and instant radiosity). My scene is a bit ...
newin's user avatar
  • 363
6 votes
1 answer
1k views

Can I reuse glBindBufferBase in compute shaders to keep data on GPU?

(Apologies: I am cross-posting from SO, where there is no answer. I figured it might be more appropriate to be on this site.) I'm trying to build a compute shader in OpenGL to perform a ...
Maxthecat's user avatar
  • 181
6 votes
1 answer
292 views

How to render an object that recieves shadows but does not cast them in a variance shadow mapping system?

I'm currently preparing to implement variance shadow mapping based on this article. However, one point it makes concerns me: Rendering only casters (and not receivers) into the variance shadow map ...
user avatar
6 votes
2 answers
3k views

Always rotate in the direction of mouse movement

In my SharpGL application I do a very simple, mouse controlled rotation of the scene. gl.Rotate(cameraRotation.X, cameraRotation.Y, 0.0f); where ...
Patrick's user avatar
  • 61
6 votes
0 answers
908 views

How to implement PCSS correctly?

I'm trying to implement PCSS in OpenGL/GLSL, but I have problems understanding the details especially the conversions between the coordinate spaces. The existing implementations are so different from ...
racz16's user avatar
  • 161
6 votes
0 answers
1k views

Cascaded shadow maps. Seams between cascades

I implemented cascaded shadow maps, where shadow maps for each cascade is rendered to one canvas: The light projections for each cascade are calculated from the bounding spheres of camera sub-...
Zheden's user avatar
  • 161
6 votes
0 answers
1k views

OpenGL texelFetch causes black stripes

THE SHORT VERSION In my fragment shader I'm reading (using texelFetch) multiple times the same texel from a texture (created by another fragment shader) and write it to the output render buffer. ...
Christian_B's user avatar
6 votes
0 answers
944 views

Drawing to framebuffer texture - texture then split in half

I am doing exercises from the OpenGL SuperBible 6th Ed. I have managed to set up rendering into a framebuffer texture and then rendering from that texture to a cube. But for some reason, when the ...
Paweł Pela's user avatar
5 votes
1 answer
3k views

Modern way of light sources in OpenGL?

In older versions of OpenGL there were things like: glLight(...) gl_LightSourceParameters The modern way of doing lighting is passing light source parameters manually to the shader in vao-s? Or ...
Tudvari's user avatar
  • 313
5 votes
2 answers
549 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 ...
Quantum64's user avatar
  • 153
5 votes
1 answer
3k views

Bloom in DirectX

How can I make an object give the effect that it is giving out light when it isn't? I basically want to make an object glow, for example Neon Lights. Also Area Lights in my engine work properly but to ...
Arjan Singh's user avatar
  • 2,511
5 votes
1 answer
2k views

Alternatives to Ambient Occlusion

Recently I wanted to improve the lighting in my game engine, naturally I looked towards Ambient Occlusion. I was considering SSAO but are there any better techniques? Maybe some that are Physically ...
Arjan Singh's user avatar
  • 2,511
5 votes
2 answers
487 views

Why does rotation about an arbitrary axis have degree of freedom 6

I have been trying to figure out why does rotation about an arbitrary axis have degree of freedom 6. I know that it takes two points, each take 3 values to determine in a 3-D space. But what about the ...
Louis Kuang's user avatar
5 votes
1 answer
562 views

Where is the best place for Tangent-bitangent calculation, in shader or in C/CPP code?

I have two methods of calculating tangent and cotengent (needed for normalMap lighting calculation). The one is doing it from CPP code (with assimp library for example) The second is doing it ...
Irrmich's user avatar
  • 153
5 votes
1 answer
903 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 ...
Startec's user avatar
  • 781
5 votes
2 answers
2k views

Is there ever a time when I should *not* use the GL* types?

If I am writing my own function to check shader compile errors, or do anything that interacts with the OpenGL API but ultimately returns as a result of my application code, should I use the C++ ...
Startec's user avatar
  • 781
5 votes
1 answer
4k views

How do double-buffers work in opengl?

As I understand, the back-buffer is used for rendering the image while the front-buffer is drawn on the screen. So if you have only one image to be drawn on the screen, then you only need to swap the ...
Adrian's user avatar
  • 667
5 votes
1 answer
2k views

Why does this gl_FragDepth calculation work?

I am raytracing in GLSL. My gl_FragDepth calculation wasn't right, so I did some hunting and found this solution (P is the world-...
spraff's user avatar
  • 299
5 votes
1 answer
632 views

Performance impact during texture layer loading

Recently I have been having a rather confusing performance drop with loading in layers of a 2D texture array, but only in one case from what I can tell, leaving me to speculate on why it is happening ...
Lemon Drop's user avatar
5 votes
1 answer
2k views

LWJGL/OpenGL get BufferedImage from texture ID

I have got a texture ID and would like to retrieve its data. The data should be stored in a BufferedImage for future use. I am using the LWJGL library in Java, so ...
piegames's user avatar
  • 297
5 votes
1 answer
148 views

Trying to understand environmental cubemaps

I am trying to implement a physically based renderer, in OpenGL. I was planning to implement the Cook-Torrance BRDF. I read about radiance cubemaps (for reflections), like the one discussed here, for ...
MKII's user avatar
  • 153
5 votes
1 answer
208 views

OpenGL VertexArray Data "Retention"?

After calling glVertexAttribPointer to associate data of the currently bound vertex array with data from the currently bound ...
salbeira's user avatar
  • 303
5 votes
1 answer
1k views

Is placing z value of vertex in w enough to achieve perspective projection in OpenGL?

I have been learning about projection matrix in OpenGL and I am finding it really hard to understand. All I know is that there are other configurations in the projection matrix besides placing z in w ...
videogamechef's user avatar
5 votes
1 answer
549 views

Binary scene voxelization using imageStore - problem

This problem has been haunting me for some time but I was busy with other things. I can't finish my GI technique (specifically occlusion step) without solving it. I made a binary scene voxelization ...
mdkdy's user avatar
  • 2,169
5 votes
1 answer
463 views

How do CAD programs render non-polygonal 3D objects?

How CAD programs handle displaying B-Reps and NURBS/T-Splines in their viewports? Assuming viewport uses OpenGL API - are those programs transform every object into triangles and creating/deleting ...
pmakal's user avatar
  • 53
5 votes
1 answer
2k 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 ...
IneQuation's user avatar
5 votes
2 answers
3k views

Rotating object around its own center

I am trying to implement Blades of Waving Grass and I am still stuck at the point where I need to achieve texture arrangements like in the figure below (the first one). So my plan is to draw the ...
チーズパン's user avatar
5 votes
1 answer
77 views

Texture Parts Terminology

I'm generalizing my texturing code, and have become confused by the frankly contradictory information about textures' pieces. Specifically, I'm looking to understand what exactly the terms "face", "...
geometrian's user avatar
  • 1,990
5 votes
2 answers
986 views

Sharing calculation result between shader programs in OpenGL

Question Is there a way to compute something in a first shader program (eg. screen-space coordinates from word-space ones) and access those results in an another shader program? Possible solutions ...
BPiek's user avatar
  • 307
5 votes
1 answer
423 views

SVG opengl implementation - strokes overlap on transparency

I am trying to implement svg rendering by opengl using meshes. In paths with opacity less than 1, the color of overlapping strokes add up. But it should be like this the opengl calls are: ...
user3902333's user avatar
5 votes
1 answer
162 views

Renderbuffer needs to be bound before glFramebufferRenderbuffer?

The documentation of glFramebufferRenderbuffer only says that renderbuffertarget needs to be ...
salbeira's user avatar
  • 303
5 votes
1 answer
1k views

Ray-triangle intersection algorithm not intersecting (C++)

I've been trying to implement the Moller-Trumbore ray-triangle intersection algorithm in my raytracing code. The code is supposed to read in a mesh and light sources, fire off rays from the light ...
Haley's user avatar
  • 51
5 votes
1 answer
748 views

How to convert decomposed transformations between different coordinate systems?

I am converting some Unity3D scenes to a proprietary json format to be used by my OpenGL renderer that uses a different coordinate system from Unity's. I have multiple sets of {translation, rotation(...
Fr0stBit's user avatar
  • 101
5 votes
1 answer
2k views

GLSL - Merge two textures

I would like to display arbitrary 3d meshes with black edges (black outline, black ridges, etc.). Thereby I have created two different textures: One color texture and one anti-aliased edge texture. ...
enne87's user avatar
  • 601
5 votes
1 answer
4k views

How could I use bent normal map

This might be a general question but I have some difficulties about understanding baked bent normal maps and how to use it inside a shader in Unity. From what I understand, bent normals are ...
MaT's user avatar
  • 1,229
5 votes
1 answer
127 views

Seamlessly transitioning between nearby environment maps

I'm wondering what is the best way to achieve an effect like here: https://matterport.com/try/ when the camera is traveling between points in space. Apart from simple color crossfade there seems to ...
MasterM's user avatar
  • 151
5 votes
1 answer
494 views

Frustum - problem with z dimension

I'm beginner in OpenGL and I stumbled into a problem. I'm in OpenGL 2.1 for the time being, if that's of any help. I set my Frustum as such: ...
Paweł Pela's user avatar
5 votes
1 answer
740 views

glMultiDrawArraysIndirect does not work when specifying an offset

I'm trying to use glMultiDrawArraysIndirect to render a batch of object. In my example I have a cube and a sphere (in this order) in a ...
Soapy's user avatar
  • 171
5 votes
1 answer
586 views

Honouring Depth Test with Stencil Test

I'm using OpenGL's stencil test to carve out a semicircular hole in a transition frustum with a cylinder oriented perpendicularly. However as one can see below, while this objective is achieved, the ...
Sharat V Chandrasekhar's user avatar
5 votes
1 answer
2k views

OpenGL Instanced Rendering with Level of Detail

Problem: I'm trying to draw a scene with a lot (about 10000) of similar objects (in my case bushes, but could be anything). For each bush I have three meshes with a different number of triangles and I ...
AlbertM's user avatar
  • 153
5 votes
1 answer
295 views

How to set the GLFW OpenGL target?

I'm programming on a Mac and I'm learning OpenGL in the library GLFW. My problem is that my Mac supports OpenGL up to version 4.1, but when I try to compile the shaders with ...
Leonardo D. Mariscal's user avatar
5 votes
0 answers
1k views

How to disable Perspective Correction in Texture Coordinates Interpolation in OpenGL(without using shaders)?

I need to do planar reflection mapping in OpenGL. By using a virtual camera (with a reversed camera ray) at the back of reflective plane (a mirror), I rendered the scene to texture, which is then ...
DQLin's user avatar
  • 51
5 votes
0 answers
323 views

How to make double working in OpenGL 4.1 on OS X ( Intel HD Graphics 5000 )?

I've recently rebuild shaders for my program and it stopped "working" ( black screen ) on OS X ( El Capitan ), but it's ok on Linux on GTX 660. I've tested it on another Apple hardware and it worked ...
Marqin's user avatar
  • 151
5 votes
0 answers
351 views

Indexing gl_TessLevelOuter[] with gl_InvocationID on a tessellation control shader

I'm using hardware tessellation to render a terrain mesh with variable LOD. I have this snippet on my tessellation control shader: ...
MadEqua's user avatar
  • 238
5 votes
0 answers
366 views

Incorrect instanced rendering

Previously, to render a bunch of quads, I was simply using a few uniforms (one for a model matrix and another for the texture layer ID). However, I'd rather not have to loop through each quad and set ...
Darkilon's user avatar
5 votes
0 answers
928 views

How Texture Prefetch works? [closed]

I know GPU prefetches textures and that's why dependent texture reads are slower, but how does it work and at what point that happens? EDIT: Split the content of this question into others as ...
Felipe Lira's user avatar
  • 1,246
5 votes
1 answer
2k 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 ...
Pavlo Muratov's user avatar
4 votes
2 answers
161 views

Is there a way I can make this easier for openGL to draw?

I have a very basic grasp of computer graphics however I threw it all away when I wrote this simple application that I am using for scientific purposes. I didn't have a lot of time to write it ...
CalebK's user avatar
  • 243

1 2
3
4 5
15