Tagged Questions

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 ...

learn more… | top users | synonyms

0
votes
1answer
61 views

When and how to apply affine translations to vertices of a mesh with LWJGL

So, I have a rigid body class, containing a list of vertices and a 4x4 transformation matrix. At the moment, I'm applying the transformation matrix to each vertex individually, and am unable to revert ...
5
votes
3answers
660 views

How portable are OpenGL versions, really?

If I write a game engine that uses OpenGL 1.5 (not assuming what else I do), is it portable now and is it still portable five years from now or are/will support for OpenGL by hardware and drivers (be) ...
-1
votes
3answers
103 views

Most efficient way to do 2d tiles (VBO vs Instancing)

Ok so I am looking at building a game that uses 16*16 tiles, and renders anywhere from 400,000 to 1,000,000 tiles onto the screen at any given time. The tiles will be destroyable . What is the most ...
0
votes
1answer
103 views

GLSL to Cg fragment shader

I have found very useful resource on the Swiftless website on OpenGL. Unfortunately, I cannot manage to adapt a GLSL fragment shader to my project, which uses Cg. Here it is: uniform sampler2D ...
1
vote
1answer
75 views

OpenGL - Buffer Usage

I am currently working on a little OpenGL project. At the moment I am trying to find a good solution for rendering multiple objects. I have set up a terrain with its own buffers, which works just ...
0
votes
1answer
99 views

Skybox: OpenGL texCUBE vs a textured cube

In OpenGL, the typical way that I've seen to set up a skybox using cubemapping is to create a cube in camera space, prepare a cubemap sampler with the appropriate six-sided texture, and then in the ...
0
votes
1answer
90 views

How to efficiently change VBO size?

I have created a menu class and now I'm working on getting it to render using OpenGL's VBO's. The menu is fairly simple, it has a number of buttons, the user can press up and down to highlight the ...
0
votes
0answers
94 views

OpenGL - using gluSphere

I have an OpenGL code that currently draws several spheres at different locations. I generate the vertex buffer data (and normal data) myself. However, to simplify the code and increase efficiency, I ...
3
votes
2answers
164 views

GLM/OpenGL: How Can I Prevent Vector Magnitude From Increasing While Rotating Bones in Skeletal Rig?

ANSWER AT THE BOTTOM OF THIS QUESTION I have been reading tutorials, articles, questions on StackExchange and books all with the subject of skeletal rigging. I have boiled my program down to just the ...
5
votes
1answer
324 views

How to implement translation, scale, rotation gizmos for manipulating 3D object's transforms?

I am in the process of developing a basic 3D editor. It uses OpenGL for rendering a 3D world. Right now my scene is just a few boxes of different sizes and I am at the stage where I want to be able to ...
1
vote
1answer
269 views

LibGDX Box2DLights shadow offset problem on bodies

Hello I just started to use LibGDX, and it's awesome. I looked at the Box2DLights library, and started to learn how the lighting work here. I got something up: As you can see, it works, but the ...
0
votes
0answers
130 views

Problem when using two different shaders

I have created a simple shader for drawing my scene in OpenGL. When another shader was introduced, a problem appeared. I use the first shader and draw few objects in the scene. Then I use the second ...
0
votes
0answers
37 views

Slick2D changing image's color with drawFlash and using alpha

I have an image, where I have a round soft white feathered ball in the center of it. I plan to use it for my lighting in my 2D game. I could not find any proper way to drawing lighting with many ...
0
votes
1answer
128 views

How do you create a 2d world then view it in 3d?

I have been learning OpenGL for a while now and have a pretty good understanding so far. What I would like to know is if I create a 2D game in Orthographic Projection, is it possible to switch to a ...
0
votes
0answers
89 views

Slick2D/LWJGL Drawing coloured lights problem

I am using the Slick2D engine. I've followed this snippet for creating light sources. I have followed step step, added what is actually important for me, and tested it and the lighting effects ...
0
votes
1answer
64 views

OpenGL +SFML + GLFW3

I'am maybe asking a stupid question, but can we mix OpenGl + SMFL and add to it some GLFW in the same SFML window ?
3
votes
1answer
142 views

what happens with missing vertices in geometry shader

I am relatively new to GLSL shader programming, and the documentation I found is unfortunately often inscrutable. I am having trouble understanding a few things with how geometry shaders fit into the ...
3
votes
1answer
177 views

What happen if I try to run OpenGL 4.4 code on an unsupported graphic card?

I'm learning OpenGL because I'd like to build my own engine. I'd like to know what happens if I try to run OpenGL 4.4 code (the latest version at the moment of writing) on an unsupported graphic card ...
1
vote
1answer
169 views

Shadow Map field-of-view

I'm implementing a shadow map algorithm with a spotlight (a spotlight that always "looks" at a given object). My issue is that for some configuration, part of the object the light is "looking at" is ...
1
vote
0answers
87 views

OpenGL/GLM Camera

I want to make a camera that can freely look and walk on X/Z plane and rotate 360 degrees. I'm using OpenGL and the lookAt function from the GLM library to create the view matrix. I've looked through ...
1
vote
2answers
261 views

How are red dot/reflex/holographic sights implemented?

In first-person-shooters like Call of Duty, the hologram only appears when it is behind the glass portion of the sight. In OpenGL, would it be implemented by rendering the glass to the stencil buffer ...
1
vote
1answer
71 views

glDeleteBuffers causing other objects not to draw

I have few objects in scene and they exist until I turn off the application. Their calls for glDeleteBuffers are in destructor. Since I don't delete anything in the middle of the game everything is ...
1
vote
1answer
164 views

Reflection and shadows in OpenGL

I'd like to implement shadows and reflective surfaces in my OpenGL app. I already have ideas which I will provide below. But I would like to ask someone more experienced than me before I put too much ...
0
votes
1answer
47 views

Geometry design and buffers

I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do: Init: Stock array with positions, array with colors, array with ...
2
votes
0answers
42 views

SDL_AddTimer + SDL_GL_MakeCurrent not working on Windows [closed]

I'm messing around with C++, OpenGL and SDL doing a game that should be able to run in Windows and Mac OS X. I have a problem that only happens on Windows. Let me describe the scenario. First I ...
1
vote
0answers
109 views

How to shade hair (line segments) correctly in GLSL

I render my hair geometry in line segments. The problem I have is with the correct shading of the hair. From what I've read I understood that I need the direction of the line segment and the ...
0
votes
0answers
32 views

Shadow bias selection with moving light

I've been looking at shadow mapping and although I managed to get them to work selecting an appropriate bias. The problem is when I start moving the light. The shadows work fine for not extreme ...
0
votes
1answer
59 views

Does LibGDX abstract OpenGL ES away or can I still use my OpenGL ES knowledge?

I've been learning OpenGL ES, and am now turning my attention to using LibGDX. My main concern with LibGDX is, if needed, will I be able to apply my OpenGL ES knowledge to something if needed and ...
8
votes
1answer
126 views

How can I profile the speed of my vertex and fragment shaders separately?

I'd like to know how I can check to see if either my vertex or my fragment shader is a bottleneck in my rendering pipeline. I've read about using glQueryCounter with the GL_TIMESTAMP target to get ...
0
votes
1answer
162 views

More than 8 lights without deferred shading / lighting [closed]

I want to know if there is any technique (efficient) to use more than 8 lights in a scene made ​​with OpenGL and GLSL. Without making use of deferred shading / lighting. I have not implementadon ...
0
votes
0answers
72 views

Tile Collision - subtracting a minor value to the box size

I'm having a certain problem when doing collision checks on bounding boxes that have their edges aligned with upper or right tiles. It shouldn't count as an intersection but I don't know a good ...
1
vote
2answers
651 views

2D Outline shader in GLSL

I have a simple prototype with 2D worms-like destructible terrain. I use a trivial shader to discard pixels based on a mask. varying vec2 v_texCoords; uniform sampler2D u_texture; uniform sampler2D ...
1
vote
0answers
122 views

OpenGL Hello Triangle troubles [closed]

Just trying to get the simple OpenGL hello world program set up and for what ever reason I just cant see why I can't get it to work. I'm able to create a resizeable window and set the background ...
1
vote
1answer
123 views

Collision between player and heightmap

Im programming a small project, an opengl height map. It is build of triangles, which points are fit to the right y position (read out of an image). The player is represanted by a cuboid. (p1, p2, ...
3
votes
1answer
108 views

How do you create a game overlay that makes the underlying graphics inactive?

I've created a simple game, and I drew a large rectangle in photoshop with faded edges that I want to use to overlay the game until the user presses "Begin" (on the overlay). The problem I'm currently ...
0
votes
0answers
45 views

InvocationTargetException caused by IllegalArgumentException due to trying to create a new OpenAL instance

So, after creating this class, (in this LINK) , I ran into a new problem, I recieved an InvocationTargetException, which is generally caused when a method is invoked and an exception is created when ...
1
vote
2answers
110 views

Bad pixels on shader when loading cached binary programs

I have been trying to cache binary shader programs in my game and load them accordingly using "glGetProgramBinaryOES" and "glProgramBinaryOES" respectively. I was successfully able to cache and load ...
7
votes
1answer
164 views

Slow uniform array in shader causing FPS drop

I'm trying to use an uniform array of matrices in my compute shader. However, it's really slow. I've narrowed it down to this lines of code: uniform mat4 someMatrixArray[64]; ... vec4 result = ...
3
votes
1answer
102 views

Handling multiple lights of different types in GLSL

I want to be able to support multiple lights of different types (point, spot & directional). Note that I also want to be able to render transparent/translucent objects, which rules out deferred ...
2
votes
3answers
421 views

GLSL Sphere from Vertex

I am working on a particle simulation where we have a lot of spheres which can have different radii. Using this tutorial http://mmmovania.blogspot.de/2011/01/point-sprites-as-spheres-in-opengl33.html ...
3
votes
1answer
121 views

MSAA deferred implementation issue

I recently implemented MSAA in my deferred renderer, it looks good but I just got a feeling I might have done it wrong. Here is what for example the directional light fragment shader looks like: ...
0
votes
0answers
59 views

gl_ClipDistance[] not working

I am unable to get gl_ClipDistance to work. The results I'm getting are the same as if I didn't enable clip distance. I have called glEnable(GL_CLIP_DISTANCE0); and glEnable(GL_CLIP_DISTANCE1); in ...
0
votes
0answers
78 views

Sometimes my game runs fine, other times it's shaky, why?

I'm trying to learn how to make games. I just did this very simple 3D game where you control a cube that shoots at incoming cubes. Sometimes I start the game and it runs smoothly from start to end. ...
1
vote
1answer
52 views

Obtain linear depth values on FBO and deal with small differences

I've a render target on which I have both a color and a depth attachment. In a second pass I need to run a filter whose width depends on the derivative and values of the depth. Now, if I try, in the ...
1
vote
1answer
143 views

Should all primitives be GL_TRIANGLES in order to create large, unified batches?

Optimizing modern OpenGL relies on aggressive batching, which is done by calls like glMultiDrawElementsIndirect. Although glMultiDrawElementsIndirect can render a large number of different meshes, it ...
0
votes
1answer
73 views

Can you specify which VBO/EBO to use with glDrawElements?

I'm creating a voxel-like game. I'm not sure if I am using VBO/EBO's correctly. I am creating a new VBO & EBO for every chunk. This is done once, but chunks call a render function in every block ...
1
vote
1answer
119 views

How to create a regular grid of triangles correctly?

I am trying to create an terrain using opentk/opengl. I have a problem with the VBO/IBO. I think a picture of the problem is the best way to show it: I dont understand why the last triangle of a ...
1
vote
2answers
94 views

Accessing uniform variables from a Cg shader in OpenGL

I am trying to implement a simple PC program with OpenGL, using mandatorily Cg shaders (no Unity whatsoever). I have found some tips on this page http://bobobobo.wordpress.com/2008/10/05/cg-1/ and ...
0
votes
3answers
768 views

Confusion over GLViewport

I'm hoping someone can help me understand the GLViewport and what happens when we resize it This will illustrate my confusion.... So, here I have a quad stuck in the middle of the screen. If I ...
0
votes
0answers
19 views

Manual occlusion culling with glDrawElements [duplicate]

How should I go about doing occlusion culling with glDrawElements? I am dealing with voxel-like terrain. I want to avoid drawing the faces that are facing another block. I just don't know how to ...