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

1
vote
0answers
42 views

Consistent Shadow Map Filtering

I want to filter my shadow map generated by PSSM, but the problem is that I have a inconsistent filter size. The problem is that the shadow map sources rotate to find the best fit for the camera ...
1
vote
0answers
45 views

glTextImage2D with GL_UNSIGNED_BYTE giving weird results while with GL_FLOAT just works, driver bug?

Update: OK, not being able to see the textures loaded by FreeImage was just one of the common mistakes when using modern OpenGL. My texture loading code did not set GL_TEXTURE_WRAP_S/T and ...
2
votes
1answer
83 views

Slick2d fullscreen with black bars

NOTE: I am moving this question here from Stack Overflow because I feel it belongs better on this forum. I am deleting the original question from Stack Overflow. I'm working on a game in Slick2D and ...
1
vote
0answers
75 views

OpenGL RayCasting and Intersection with plane

I have been trying for a couple of days to raycast. I have a Renderable/Texture/Primitive/Whatever placed in the WORLD at 0.0f,0.0f,0.0f, and when I click the mouse I want to know at what X,Y ...
1
vote
2answers
57 views

opengl z index changing does not zoom in

I am making a simple opengl application where I have a cube and I want to move forward to it with the glTranslate3d function, where I change the z index. One would expect the object to get bigger ...
1
vote
1answer
95 views

How can I make terrain texturing look detailed both close-up and far away?

I attempting to make my game have very detailed textures, and in general look pretty. However, I'm having some issues with that. Let's take a look at a rock texture close up: Picture. As you can ...
2
votes
1answer
40 views

Shaders wont bind to the uniform block

I'm having an issue with interface block binding. Example shader: const char* vertexShader = "#version 330 core\n" "uniform globalMatrices" "{" " mat4 ...
3
votes
0answers
85 views

Is there a 3d game engine without a built-in physics engine? [closed]

I know about jMonkeyEngine, Ardor3D, etc. Yes, I've also heard of LWJGL and OpenGL (the both are essentially the same, though) but neither of them really suit me. I don't want to deal too much in the ...
1
vote
1answer
107 views

Pixelation shader explanation?

I was looking for a pixelation shader for my postprocessing and came across this shader snippet - Works pretty well! - Not a whole lot of explanations on how it works except for "Pixelation is process ...
2
votes
1answer
36 views

Change value of uniform for each VAO

I've heard from several sources that it's a better approach to pass the model matrix to a shader via a uniform rather than an attribute. I also know that the idea of a uniform is, that it has the ...
3
votes
0answers
60 views

Is it possible to use OpenCL in libgdx?

Been looking for a way to implement some OpenCL stuff in my libgdx project. It's possible via LWJGL which libgdx is based on, but it's only for the Desktop environment. Would like to have it cross ...
1
vote
1answer
100 views

OpenGL shaders messed up

So after a long attempt at DirectX I switched back to good old OpenGL. Now I'm running into this weird problem. My code involves shaders, of course, and drawing a basic cube. But I'm getting this ...
1
vote
3answers
47 views

Storing component vectors to avoid matrix and quaternion inaccuracies?

I read that I "should really be storing the component vectors (rotation, translation, scale) in addition to the quaternion and matrix forms." The reason for this is that, over time, compound numerical ...
5
votes
2answers
134 views

Is glDrawArraysInstanced in OpenGL parallel when drawing those instances?

Is glDrawArraysInstanced in OpenGL parallel when drawing those instances? I cannot figure out by referring to its reference and numerous online tutorials. [Update] To be more clear, I mean, for ...
1
vote
1answer
59 views

Applying Transformation Matrices to VBOs in OpenGL

So I've recently tried to add Vertex Buffer Object Matrix transformation to an OpenGL engine I'm working on. I could go about this by applying the matrix to a copy of each vertex individually, but ...
1
vote
2answers
117 views

OpenGL SDL Texture doing really weird things

I am trying to render a .png image to the screen using C++, SDL and glut. This the texture I made using paint This is what I get on the screen: Does anyone have an idea what could cause this? ...
3
votes
2answers
109 views

Increase the speed of my grid/render system?

I currently have a simple Minecraft-like grid system setup. The game has a world -> a world has multiple chunks -> a chunk has blocks. The world asks the chunks to render (if needed), but the render ...
2
votes
1answer
40 views

OpenGL - Bind Buffer Arrays question

So this is probably a simple question: But how come sometimes I see it like this: GLuint vbuffer; glGenBuffers(1, &vbuffer); glBindBuffer(GL_ARRAY_BUFFER, vbuffer); but when done in multiples: ...
3
votes
1answer
154 views

Is there a way to bypass Directx Effect Files?

I am now trying to abstract my rendering pipeline, and I've been able to abstract OpenGL fairly easily. But now I have ran into a rather ugly problem with Directx. Most of my knowledge about Dx9, 10, ...
2
votes
1answer
79 views

Texture Not Rendering in C++ SDL OpenGL(glut)

I don't understand why my texture("texture.bmp"), is not showing on the screen. Please help me. The whole drawing function: ///HERE EVERYTHING IS BEING RENDERED void Main::display(){ int ...
4
votes
1answer
155 views

Is this the typical approach to modern OpenGL UI & Text rendering, for mobile?

I'm implementing GUI in OpenGL ES 2.0 to fit with my application framework's existing structure. I'd like to have the UI rendering eat as little mobile processing capacity as possible. So to ...
2
votes
1answer
77 views

Which game consoles can I target as an indie with C++ and OpenGL [closed]

I am an indie game developer and I wish to build games using C++ and OpenGL for game consoles. I've read that there are strict requirements for developing games for some consoles. So does anybody know ...
1
vote
1answer
44 views

openGL : render each mesh at their respective locations

At the moment I have a single mesh, and I give the vertex-shader a matrix which holds the objects position, scale and rotation, and it seems to work. in vec3 position; uniform mat4 object; uniform ...
2
votes
1answer
65 views

Render scene depth to texture via FBO?

I'm trying to render my scene's depth via FBO and Render To Texture. I have a scene that I'm rendering to a texture, then render that texture to a fullscreen quad in a second pass using a fragment ...
1
vote
1answer
25 views

GL_INVALID_OPERATION in glGenerateMipmap(incomplete cube map)

I'm trying to learn OpenGL and i'm using SOIL to load images. I have the following piece of code: GLuint texID = 0; bool loadCubeMap(const char * baseFileName) { glActiveTexture(GL_TEXTURE0); ...
3
votes
1answer
80 views

Make Camera Look at point using a World transformation matrix?

Variants of this question might have been asked on this site, but none of the answers I found worked in my case. I am trying to make a Camera look at a point. The camera has a world transformation ...
4
votes
3answers
148 views

Can't find the solution to the “shadow acne” problem

This is how it looks now: This is the code that generate the shadow matrix an shaders source: void shadow::calculateShadowMatrixFromLightPointOfView(vector3f lightPosition, vector3f ...
1
vote
0answers
112 views

Cube map or 2D texture map

I'm trying to map quadsphere with COBE spherical cube (CSC) projection in OpenGL (wanna map planets). I managed to create a 2D texture and it works well except seams at edges. Then I learned that ...
0
votes
0answers
50 views

OpenGL model rendering issue

Currently my game will not display models properly on my PC but they load right on a pc that supports openGL 3.0, and as my laptop only supports 2.1 the last model rendered will show properly but the ...
3
votes
0answers
67 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 ...
1
vote
0answers
121 views

Restart a 2D game - OpenGL, GLUT

I started learning OpenGL and GLUT by making a snake game. The problem I encountered is that when I press the "new game" in the menu, the window has to be resized so that the content of the window to ...
2
votes
1answer
57 views

Directional Light shadow mapping error - opengl

i need some help with shadow mapping (directional light) in opengl 3.3 and GLSL. The problem is that the shadows are not displayed correctly over de 3d models and primitives: This is the code that ...
1
vote
0answers
146 views

Implement Candy Crush like level graph

I want to implement road-map like level graph where in you can see what level are you and your friends are on. Just like we see in Candy Crush Saga.For people who have not seen Candy Crush Saga, ...
10
votes
1answer
133 views

OpenGL binding and relations among entities

This is mostly a documentation question. I hope this is the proper place to ask and not, for example, programmers or stackoverflow. I did not read the OpenGL specification, but from books (Red Book) ...
4
votes
0answers
64 views

OpenGL: Frame partially jumps back and forth

I'm working on a project with SDL and OpenGL. The game works great on Windows, Linux, OS X and iOS. However, the Android version is showing a problem on my phone in particular. I have tested another ...
1
vote
1answer
118 views

How to fix texture edge artefacts?

This issue has been annoying me for a long time now and even after reading a lot of articles about it, I am still unable to fix the issue. First, to my setup. I'm using LWJGL for a 2D project, ...
3
votes
1answer
55 views

GLSL uniforms are returning -1, but they are being used in output

I have looked this up, and found some answers and people said that if uniforms aren't important to the final output than they get thrown away by the compiler. However, in my case they are being used ...
2
votes
0answers
74 views

How to create a MessageBox in OpenGL using C++ [closed]

I have a game that needs results displayed upon exit with a messagebox. I have the following code that works but I need to add an integer variable to the text. This works: MessageBox(NULL, ...
6
votes
4answers
273 views

Is index drawing faster than non-index drawing

I need to draw a lot of polygons consisting of 6 vertices's (two triangles). Without any texture coordinates, normals etc., both approaches result in 72 bytes. In the future I would definitely also ...
6
votes
1answer
198 views

In a shader, why does substituting a variable with the expression producing it cause different behaviour?

I have this correctly-working OpenGL shader producing Perlin noise: float left = lerp(fade(v), downleft, topleft); float right = lerp(fade(v), downright, topright); float result = lerp(fade(u), ...
1
vote
1answer
347 views

Multiple lights shadows

I'm trying to achieve multiple lights shadows. Currently my program works using only 1 spotlight as a light source that produces shadows. Well... I want to involve multiple lights to give a more ...
1
vote
0answers
25 views

Formula for model matrix with mouse coordinates

I'm trying to create a simple OpenGL app where I can drag objects with the mouse. In its current state, I am able to do this, but the aspect ratio is off, so the object is moves faster or slower than ...
1
vote
1answer
48 views

OpenGL: Interpole keyframes of animated 3d object inside vertex shader

Lets say I have N vertex buffers that hold the N key frames of an animated 3d object, that was created by an application like blender. To smoothly interpolate these frames, I would like to bind two ...
0
votes
1answer
92 views

Making a house in jogl java eclipse?

here's what I'm trying to do: One house, with 3 rooms, a window in two rooms, doors in the front and back of the house and into each room (the back door has to be through one of the rooms). I've added ...
1
vote
0answers
71 views

Error OpenGL null Cocos-2D/Visual Studio [closed]

When I try to execute a game code fully functional on Visual Studio 2013, using Cocos-2D (3.8.1) library this error jumps on screen. (I'm working on a laptop) OpenGL 1.5 or higher is required ...
1
vote
1answer
123 views

Raymarching on a Hi-Z buffer in GLSL

So I'm trying to implement Screen Space Reflections using a Hierarchical z-Buffer in GLSL. I'm following the approach from GPU Gems 5 and the Frostbite presentation linked here ("Stochastic ...
0
votes
1answer
31 views

How to use default framebuffer's depth/stencil when rendering to a texture?

Is it possible to use the default framebuffer depth buffer when rendering to a texture (instead of using a depth texture)? The Idea is to continue to render part of the scene normally but on a ...
1
vote
2answers
86 views

Is FreeGLUT still a good choice? [closed]

I recently decided to utilize the C++ library called FreeGLUT to have a window be managed from my program, where I can draw things via OpenGL. But at the same time I saw some people telling that it is ...
2
votes
0answers
79 views

How to develop a good game project? [closed]

I have enough experience in both C++ and Java, since I've been working on them a lot. My graduation project is, in my case, a game (I still have almost 8 months remaining). I already took down the ...
1
vote
2answers
74 views

Reading mesh data back from OpenGL vs storing two copies

I'm wondering if whether it's a good idea or not to keep a copy of vertex data in the main memory or just read it back via glGetBufferSubData (or glMapBuffer/glMapBufferRange). The reason why I'd do ...