Skip to main content

Questions tagged [opengl]

OpenGL is a graphics standard and API which targets the desktop and workstation markets. It is designed to be easy to accelerate with dedicated computer hardware, and hence most implementations give greatly improved performance over traditional software rendering. Currently, OpenGL is used for applications like CAD software and computer games. It is also cross-platform. The OpenGL standard is controlled by the Khronos group, which also controls OpenGL ES.

619 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
0 answers
566 views

Spherical Area Lights do not match reference

So I'm adding spherical area lights to my application, and comparing my results with mitsuba, I am getting some differences (left is my approach, right is mitsuba - a pathtraced reference): What I am ...
tobspr's user avatar
  • 410
12 votes
3 answers
1k views

How to hide a post-processed mesh outline when/where the mesh is hidden

I'm working on setting up an active outline in my 3d engine, a highlight effect for selected 3d characters or scenery in the screen. After working with the stencil buffer and getting some ...
nils's user avatar
  • 221
10 votes
0 answers
592 views

Environment mapping without cubemap (need coordinates projection)

I'm working on a project with C++ and glsl (4.1). I have implemented a mirror object which is a plane at height 0 that works as follow: I render the scene with a MVP computed such that the camera ...
Zick's user avatar
  • 99
8 votes
2 answers
465 views

How to generate a multiplier map for radiosity

I am following this tutorial: here I am at the part where you are creating a hemicube. I have got the code to render the scene into a texture and therfore an array. Now how can I generate a so-called ...
Dender Red's user avatar
8 votes
0 answers
407 views

How to draw Shadow Volumes in one draw call?

I've got a simple app that draws 3D cubes using instance rendering and I'm implementing Shadow Volume. Each cube's vertex, uv, normal and index data are statically stored in 4 vertex array buffers. On ...
XPac27's user avatar
  • 458
7 votes
0 answers
800 views

How to correctly implement 'layered lighting' with Box2D-Lights

How does one only allow Box2D-Lights to affect one and only one OrthographicCamera. After researching, I found the following answer. This answer goes into detail ...
BleedObsidian's user avatar
7 votes
0 answers
961 views

Irradiance Map ( Irradiance environment map)?

As irradiance map is generated for every possible normal for all the texels in environment map (as every texel act as a light source) so that we can look up irradiance map, based on normal of fragment ...
user2259784's user avatar
7 votes
1 answer
1k views

Draw Edges in OpenGL

I use blender game engine and blender uses OpenGL for graphics. How can I draw lines around all 3D objects? Would this be a job for a filter? Mainly, I want my end result to look drawn. I found this: <...
ruckus's user avatar
  • 193
7 votes
1 answer
4k views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
Allar Viinamäe's user avatar
6 votes
0 answers
188 views

Why is my OpenGL enabled Java game not detected by Fraps?

Recently I found out that I could enable OpenGL hardware acceleration in my Java game with the line System.setProperty("sun.java2d.opengl", "True"); Initial ...
Arthur's user avatar
  • 61
6 votes
0 answers
920 views

Text alignment in OpenGL with FreeType2

I'm trying to implement font rendering and have got into some trouble with glyph metrics. Here's the code where I get the metrics: ...
RenX's user avatar
  • 707
6 votes
1 answer
2k views

Water wave simulation

I'm having a strange behavior simulating water waves. It works perfectly with directional waves, but point waves don't work like expected. If i do not normalize the directional vector(WoldPosition - ...
Haruko's user avatar
  • 368
5 votes
0 answers
297 views

Rotation of a ball moving on a surface

I have a ball that moves along a platform. The ball is characterized as a sphere that has a radius and a position. The platform basically is a rectangle consisting of two vertex triangles. Its class ...
vigilanum's user avatar
5 votes
0 answers
113 views

How do I align the cube in which shadows are computed with the view frustrum? ("View Space aligned frustum")

Short and concise: Given 8 world space positions that form a cube of arbitrary size, position and orientation and given an arbitrary light direction. How do I compute the View and Projection matrix ...
Xardes's user avatar
  • 51
5 votes
0 answers
1k views

OpenGL Depth Cubemap with Geometry Shader Not Rendering Correctly

I was having some trouble with cubemaps in OpenGL, and was hoping to get some help. I've been following a tutorial about point light shadow mapping using cubemaps, where a geometry shader is used to ...
kingsapo's user avatar
5 votes
0 answers
2k views

How do I mix 3D skeletal animations?

I'm trying to create a 3D-model skeletal animation system for C++/Open GL. I would like to be able to mix animations by allowing animations to only affect specific bones. My game has ride-able ...
Joshua's user avatar
  • 51
5 votes
1 answer
765 views

Error drawing two VAO, each one using different shader programs (vertex + fragment shader) in OpenGL Core 4.3 / GLSL 430

I am trying to draw over a GL_TRIANGLE_FAN one texture to render video frames, using shaderProgram1, and render above it some points (GL_POINTS) using shaderProgram2. By this way: (OpenGL Core 4.3) ...
JHH's user avatar
  • 51
4 votes
0 answers
553 views

How to implement a pannini projection in opengl?

I have read about the pannini projection, which involves (I think) projecting a scene onto a cyclinder instead of a rectangle. How can I implement this projection in a vertex shader? Blinky is using ...
jokoon's user avatar
  • 5,253
4 votes
0 answers
296 views

Determine user mouse selection of 3D Object for multiple viewports

I am currently working on setting up some world objects for my level editor and am running into a bit of a snag. When I get the hit location from the mouse raycast, I would like to determine what part ...
Chaz H's user avatar
  • 41
4 votes
0 answers
388 views

SSAO shader program produces no occlusion

I'm attempting to implement screen-space ambient occlusion by the method shown here. My SSAO shader program is the one part that isn't working. Here are the outputs of the initial rendering pass, ...
Mac O'Brien's user avatar
4 votes
0 answers
1k views

How and when to split draw calls in OpenGL and OpenGL ES

My application (with a modernish OpenGL >= 3.0 and an OpenGL ES 2.0 backend) renders more or less streaming data with up to millions of vertices with different vertex layouts and sizes (some simple, ...
Bim's user avatar
  • 181
4 votes
2 answers
291 views

Fine tuning light shader mechanics

I'm currently trying to implement the lighting technique described in this article. I've done pretty much exactly what is done in the article. My technique is the same, and my shader is the same. ...
grimrader22's user avatar
4 votes
0 answers
1k views

OpenGL cubemap binding

I'm experimenting a strange behaviour of textures inside my shaders. Basically I need and bind two cubemap textures inside my shader but only one gets actually bound. I've tried swapping the two ...
zeb's user avatar
  • 263
4 votes
0 answers
281 views

GLSL shader with light colors wrong on nvidia optimus

So, I built some code to draw a spinning cube with a red light on the right side, and a blue one on the left. I run it on my laptop with optimus graphics, and on my desktop with nvidia. On the laptop, ...
Joao Pincho's user avatar
4 votes
1 answer
3k views

SDL2, OpenGL, Nvidia laptop screen tearing

EDIT 2017-05-14 dvb. Issue still active to this very day, see geforce forum link in main question. Note 3: "Stoltverd" has posted a "fix guide" on geforce forum. It has workarounds for non-OpenGL ...
david van brink's user avatar
4 votes
0 answers
927 views

Shadow mapping - Can't get the right texture coordinates

I'm trying to implement shadow maps for Spotlight's, but alas I can't get them to work. I have verified that my fragment shader is getting the shadow map texture. I can sample from it in the ...
Yattabyte's user avatar
  • 1,033
4 votes
0 answers
324 views

How do you fix wobbling shadow edges?

I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really ...
SvinSimpe's user avatar
  • 215
4 votes
0 answers
1k views

Normal Mapping a Cubemap

I posted a question on Stackoverflow and it was suggested that it would be better asked here. I have a sphere. It was created via the icosphere method outlined here: http://blog.andreaskahler.com/2009/...
NeomerArcana's user avatar
4 votes
0 answers
189 views

OpenGL Planet Generation - Simple Matrix Issue (Planet “Spins” With Mouse)

I originally asked this question on StackOverflow & was directed here by a commenter. Im currently working on a OpenGL planet rendering. I'm using the Tessellation pipeline. So far things are ...
Brian's user avatar
  • 41
4 votes
1 answer
4k views

Rendering text with SDL2 and OpenGL

I've been trying to have text rendering in my OpenGL scene using SDL2. The tutorial I came across is this one Rendering text I followed the same code, and I get text rendering fine. However the issue ...
Kakalokia's user avatar
  • 253
4 votes
0 answers
106 views

Tangents face the same direction on opposite sides of mesh

I have noticed that the tangent vectors that I am calculating are not always facing the correct direction. The tangents on the left and right of the mesh both face the same direction. Here is a ...
Ahsan Fayaz's user avatar
4 votes
0 answers
1k views

Shadow map shimmering, indexing outside the shadow map

I have tried to reduce the shadow shimmering/flickering using the technique described here: http://msdn.microsoft.com/en-us/library/windows/desktop/ee416324%28v=vs.85%29.aspx It works as I want and ...
Harry's user avatar
  • 690
4 votes
0 answers
354 views

Render on texture with alpha 0 for the background colour

Sorry if the question is stupid but I am very new to opengl. I render on a target a scene with a couple of object on a background that is nothing more than the clear colour (which is 0.0,0.0,0.0,0.0)...
fayeWilly's user avatar
4 votes
0 answers
1k views

implementing shadows into my 2D GLSL-based lighting system

I'm writing a lighting system in OPENGL using GLSL shaders, and I'm pretty happy with the light casting I have so far, but I'm totally stuck on casting shadows. Everything I've found online on this ...
Liyara's user avatar
  • 41
4 votes
0 answers
4k views

Arcball 3D camera

I have checked multiple threads before posting, but i havent been able to figure this one out. Ok so i have been following this tutorial, but im not using glm, ive been implementing everything up ...
user38873's user avatar
4 votes
1 answer
635 views

Fog shader camera problem

I have some difficulties with my vertex-fragment fog shader in Unity. I have a good visual result but the problem is that the gradient is based on the camera's position, it moves as the camera moves. ...
MaT's user avatar
  • 1,055
4 votes
1 answer
131 views

Optimizing black and white matrix block drawing

Disclaimer: I am uncertain if this is the best place to post this question, so please advise me of how I can best find the answer if I am doing something wrong. I am asking this question because I am ...
MrNoise's user avatar
  • 73
3 votes
1 answer
145 views

Is it possible to use a pre-existing texture buffer containing vertex data to initialise a vertex buffer for rendering in OpenGL v4.6?

I'm generating a heightmap in a compute shader in OpenGL v4.6 and storing it to a texture. Lets say I actually store the full vertex data in that texture instead of just the height, which is a trivial ...
Iron Attorney's user avatar
3 votes
0 answers
320 views

Avoiding z-fighting when reimplementing Freescape games

I need to avoid z-fighting in exactly co-planar surfaces that are too close to the other solids. I'm re-implementing the Freescape engine in ScummVM (all my code is open-source, available here), and ...
Gustavo Grieco's user avatar
3 votes
0 answers
140 views

Help in understanding atmospheric scattering shading

I have a made a planet and wanted to make an atmosphere around it. So I was referring to this site: Click to visit site I don't understand this: As with the lookup table proposed in Nishita et al. ...
TheCodeDemon's user avatar
3 votes
0 answers
545 views

How to convert screen to world coordinates while using gluLookAt / gluPerspective or similar matrix transforms?

I am just starting an adventure in looking under the hood of graphics for a game project I've been working on for a while, and I could use some guidance. I am using Python/Kivy (though that is not ...
Mike DePeel's user avatar
3 votes
0 answers
331 views

Strange normal mapping artifacts - OpenGL / GLSL

I have been following a few tutorials to learn some graphics programming with OpenGL, and recently implemented Normal Mapping. It works well for the most part, especially for objects with normal-...
cstr_'s user avatar
  • 31
3 votes
0 answers
57 views

issue with Compute Shader macbeth chart

I'm trying to generate a macbeth chart using the compute shader, but there seems to be an issue with the output image. here is the glsl code: ...
Jay Ebhomenye's user avatar
3 votes
0 answers
247 views

timing rendering to monitor screen update

I have an application with a very light rendering loop, taking a predictable and small time to execute. Right now, I have two solutions. The first solution uses Vsync: after a screen update, my ...
low latency's user avatar
3 votes
0 answers
225 views

Voxel Game - Lag when camera is inside of the terrain

I am making a voxel game in OpenGL and I currently render 8 x 8 chunks to the screen. The first thing I do is generate the map using Simplex Noise and this is done once when the chunk is created. I ...
AtomProgrammer's user avatar
3 votes
0 answers
561 views

Combine a light and water shader in libgdx glsl

I am trying to combine a light shader with a water shader in libgdx. Shader programming is not one of my strengths at all. This is the water effect rendering nicely: And when I have added the ...
zimspy's user avatar
  • 347
3 votes
0 answers
170 views

What am I doing wrong, in regards to multi-texture?

I am writing a bump mapping demo, so I need an image texture, and a normal texture which should be loaded into the fragment shader. This is the texture part of my OpenGL code: ...
Yuheng Zou's user avatar
3 votes
0 answers
56 views

Testing spheres without extracting planes

I am currently a bit stuck. On OpenGL I am attempting to do view frustum culling, so far I managed to do it by using a PCM. Where center is the world position of the mesh. ...
Eloh's user avatar
  • 31
3 votes
1 answer
2k views

Converting Euler rotation angles from Z up to Y up (Max to OpenGL)

I'm working on pulling geometry and it's transformation from a 3DS Max exported FBX (Z-up) to an OpenGL model format (Y-up). The main problem is I intend to keep the transformations as Translation and ...
Enam Desak's user avatar
3 votes
0 answers
75 views

why collision not detection not happened in Two Sphere

I start practice 3d collision detection of sphere in OpenGl containing two sphere one sphere hit using cannon gun but collision not detect when it hit and when i debug code collision statement triger ...
Abdul Wahab's user avatar

1
2 3 4 5
13