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
2answers
822 views

First person camera with Bullet Physics

Before integrating the Bullet Physics, the camera worked fine. But instead of using my own simple struct for transform data, I use rigid body structs provided by the physics library now. There are ...
1
vote
1answer
279 views

Using two FBOs results in the second FBO having nothing drawn to [closed]

I'm writing a deferred renderer, and I use two FBOs: the first one for G-buffer (color, normal, depth) and the second one for lighting (light output), so the first one has three textures bound and the ...
1
vote
2answers
627 views

SAT, How Do I Find The Penetration Vector?

I've just successfully implemented Separating Axis Theorem (SAT) in my game but I was wondering how do I find the penetration vector? I heard it can be useful for collision response. e.g. The harder ...
0
votes
1answer
149 views

Transparency in opengl - texture with alpha, color from background [duplicate]

I have to draw texture with transparent areas on square. But I don't want this transparencies to take color from this polygon, but from the background. Do you have any good tutorial to achieve it? ...
0
votes
4answers
1k views

Opengl lighting not working

I have rendered a spinning model in LWJGL. I have calculated normals and enabled lighting. Now I make a light: float lightpos[] = {0, 0, 0, 0}; FloatBuffer lightposb = ...
0
votes
3answers
342 views

How to deal with VBOs when rendering mesh's that may or may not be displayed?

I'm working on a multiplayer game and will be displaying other players near the player. At most 16 players could be near the gamer however there could also be 0. What I'm thinking of doing is ...
0
votes
3answers
666 views

OpenGL 2D Depth Perception

I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth perception is. So , for example, if the player goes in ...
0
votes
2answers
482 views

CubeRealm OpenGL rotation problems, need help. :\

I'm totally new to OpenGL and I'm working on a Sandbox game called CubeRealm. My problem you see is rotation. I've got it in my head that to rotate the 'camera' I just rotate all the scene by the ...
-9
votes
2answers
934 views

Creating a Game Engine with a C++ Compiler?

I'm thinking of creating a Game Engine with a C++ Compiler using OpenGL but I don't know how to create a compiler in an application. Do I have to write the compiler? or could I use (for example) the ...
32
votes
10answers
3k views

What makes a game look “good”? [closed]

I am working on a 3D space game using OpenGL and C++ and I am planning to focus on giving the game modern, eye-catching graphics, but the more I think of it the more I realise I don't really know what ...
17
votes
5answers
3k views

Procedural Planets, Heightmaps and Textures

I am currently working on an OpenGL procedural planet generator. I hope to use it for a space RPG, that will not allow players to go down to the surface of a planet so I have ignored anything ROAM ...
22
votes
6answers
10k views

How can I improve rendering speeds of a Voxel/Minecraft type game?

I'm writing my own clone of Minecraft (also written in Java). It works great right now. With a viewing distance of 40 meters I can easily hit 60 FPS on my MacBook Pro 8,1. (Intel i5 + Intel HD ...
17
votes
6answers
2k views

Separating game data/logic from rendering

I'm writing a game using C++ and OpenGL 2.1. I was thinking how could I separate the data/logic from rendering. At the moment I use a base class 'Renderable' that gives a pure virtual method to ...
19
votes
1answer
5k views

File format for static and animated 3D models

I'm currently writing a 3D game in C++ with OpenGL and I'm coming to the part where to load 3D models in. Therefore I'm looking for popular file formats and techniques to display static meshs and ...
21
votes
2answers
2k views

After a succesful glLinkProgram, should I delete / detach my shaders?

After I have a linked program, and thinking about defensive programming, should I delete and detach the shaders used to link this program? If yes, is that going to free any resources? Or do these ...
8
votes
5answers
8k views

What alternatives to GLUT exist?

I am trying to learn OpenGL, and I just found out that GLUT is obsolete. I already know SDL, and it seems it is a good alternative. Should I use SDL to develop games with OpenGL, or are there any ...
21
votes
3answers
6k views

For voxel rendering, what is more efficient: pre-made VBO or a geometry shader?

Given a fairly static voxel array, what is more efficient: using the CPU to pre-generate a VBO to render the voxel faces (ignoring more advanced forms of rendering like marching cubes for now) or ...
13
votes
3answers
5k views

Why does OpenGL >= 3 only allow VBOs?

I see that OpenGL versions 3 and up eliminate the use of client-side rendering. Immediate mode has been eliminated, and vertex arrays seem to be deprecated. Instead, if I understand correctly, VBOs ...
25
votes
4answers
11k views

why would you use textures that are not a power of 2?

In the early days of OpenGL and DirectX, it was required that textures were powers of two. This meant that interpolation of float values could be done very quickly using shifting and such. Since ...
9
votes
3answers
2k views

Lighting in a Minecraftian World

Minecraft is a game that is largely based on a heightmap and uses that heigtmap information to flood the world with light. From my understanding the highest point in the heightmap is the end of the ...
15
votes
2answers
562 views

OpenGL: Where shoud I place shaders?

I'm trying to learn OpenGL ES 2.0 and I'm wondering what is the most common practice to "manage" shaders. I'm asking this question because in the examples I've found (like the one included in the API ...
11
votes
2answers
2k views

What OpenGL version(s) to learn and/or use?

So, I'm new to OpenGL... I have general knowledge of game programming but little practical experience. I've been looking into various articles and books and trying to dive into OpenGL, but I've ...
7
votes
3answers
1k views

What is a better abstraction layer for D3D9 and OpenGL vertex data management?

My rendering code has always been OpenGL. I now need to support a platform that does not have OpenGL, so I have to add an abstraction layer that wraps OpenGL and Direct3D 9. I will support Direct3D 11 ...
7
votes
3answers
3k views

Draw contour around object in Opengl

I need to draw contour around 2d objects in 3d space. I tried drawing lines around object(+points to fill the gap), but due to line width, some part of it(~50%) was covering object. I tried to use ...
3
votes
1answer
2k views

Skyboxes using glsl Version 330

So I am trying to get a skybox working with OpenGL 3.3 and glsl Version 330. After scouring the web for a while, I could not find a completely modern OGL skybox tutorial anywhere, so I found an older ...
11
votes
4answers
3k views

Fixed-Function vs Shaders: Which for beginner?

I'm currently going to college for computer science. Although I do plan on utilizing an existing engine at some point to create a small game, my aim right now is towards learning the fundamentals: ...
10
votes
3answers
4k views

Animation in OpenGL using 3D Models

I have created a model in Blender. Now i want to read that 3D model in my c++ program. I figured that a model can be exported to various file formats e.g. .obj, .3ds or COLLADA and then can be read in ...
10
votes
2answers
3k views

Efficient skeletal animation

I am looking at adopting a skeletal animation format (as prompted here) for an RTS game. The individual representation of each model on-screen will be small but there will be lots of them! In ...
8
votes
3answers
2k views

Font outline in OpenGL, FTGL

I'm using FTGL library to render fonts in my game, but I have completely no idea how to create an outline around text. Achieving a shadow could be easy, because I can simply do it like this: (pseudo ...
7
votes
4answers
1k views

glsl demo suggestions?

In a lot of places I interviewed recently, I have been asked many a times if I have worked with shaders. Even though, I have read and understand the pipeline, the answer to that question has been no. ...
5
votes
1answer
526 views

How to insert and remove blocks quickly in a Minecraftian world?

I currently have volume data for the world stored as an array of booleans. I then check each empty block and if it has non-empty neighbors the faces get drawn. This prevents me from sending a bunch ...
4
votes
7answers
4k views

openGL book recommendation

I wanna start learning OpenGL especially for android game programming but I would eventually want to be able to use this knowledge for windows\linux as well. I'm having difficulty choosing between ...
14
votes
4answers
1k views

Why do we use 4x4 matrices to transform things in 3D?

To translate a vector by 10 unit in the X direction, why do we have to use a matrix? We can just add 10 to the mat[0][0], and we got the same result too.
14
votes
7answers
2k views

For 2D games, is there any reason NOT to use a 3D API like Direct3D or OpenGL?

I've been out of hobby Game Development for quite a while now. Back when I did it, most people used Direct Draw to create 2D games. By the time I stopped people were saying OpenGL or Direct3D with ...
12
votes
5answers
3k views

What is the purpose of the canonical view volume?

I'm currently learning OpenGL and haven't been able to find an answer to this question. After the projection matrix is applied to the view space, the view space is "normalized" so that all the points ...
11
votes
8answers
17k views

Getting Started with 2d Game Dev (C++): DirectX or OpenGL? [closed]

So, i'm a student looking to get my foot in the door of game development and im looking to do something 2D, maybe a tetris/space invaders/something-with-a-little-mouse-interaction clone. I pointed ...
10
votes
2answers
4k views

OpenGL: VBO or glBegin() + glEnd()?

I recently was given this link to a tutorial site from someone who I gave the original OGL Redbook to. The third header down says distinctly to forget glBegin() & glEnd() as the typical render ...
7
votes
1answer
584 views

Most efficient way to draw large number of the same objects, but with different transforms

I'd like to draw a large number (multiple thousands) of simple meshes (each maybe... a maximum of 50 triangles, but even that is a very large upper bound), all of which are exactly the same. As a ...
6
votes
1answer
235 views

With what projection matrix should I render a portal to a texture?

I'm using OpenGL. I have problem with my engine's portal implementation. To create the first portal I do: create a virtual camera with the position of the second portal and the correct orientation ...
6
votes
2answers
956 views

OpenGL 2 and back vs 3 and forward: What are the key differences for 2D graphics?

OpenGL contexts before and after OpenGL 3.0 are rather different. So far I've really only worked with buffers on either side anyway, I do know the most notable difference is lack of Immediate Mode. ...
5
votes
2answers
2k views

OpenGL: Is it possible to use VAO's without specifying a VBO

On all the tutorials I can find about VAO's (Vertex Array Objects), they show on how to use them by configuring vertex attributes and binding a VBO (Vertex Buffer Object). But I want to create a VAO ...
3
votes
1answer
3k views

GLSL if-else statement unexpected behaviour

This question is related to this other one I asked a few days ago. Because I have finally get to the bottom of the issue, I have rather preferred to open a new question with a more detailed ...
2
votes
1answer
932 views

How do I implement camera axis aligned billboards?

I am trying to make an axis-aligned billboard with Pyglet. I have looked at several tutorials, but they only show me how to get the up, right, and look vectors. So far this is what I have: target = ...
17
votes
3answers
2k views

What's the difference between mesh and a model?

Which one is created first? For example if a team worked on a graphical asset of a car, what would be a model and what would be a mesh of the car?
8
votes
1answer
2k views

Should I give each character its own VBO or should I batch them into a single VBO?

I'm making a 3D first person game. Should I give each character its own VBO or should I batch all characters into a single VBO? What are the pros/cons?
6
votes
1answer
2k views

How to invert background pixel's color

I'm writing a game and map editor using Java and jMonkeyEngine. In the map editor, I've got a brush done by wireframed sphere. My problem is: I want to make it visible everywhere, so I want to invert ...
6
votes
1answer
4k views

GLSL - Rewriting shaders from #330 to #130

I recently created a game (LD21) that uses a geometry shader to convert points into textured triangles/culling. Since I was under the impression that the support for #330 was widespread I only wrote ...
5
votes
2answers
3k views

Toggle Fullscreen at Runtime

Using the library GLFW, I can create a fullscreen window using this line of code. glfwOpenWindow(Width, Height, 8, 8, 8, 8, 24, 0, GLFW_FULLSCREEN); The line for creating a standard window looks ...
5
votes
2answers
1k views

Should the modelview and projection matrices be calculated in the shader or on the CPU?

At minimum I would have a camera with rotation and world position; projections parameters such as angle of view and perspective vs. orthographic; and meshes with scale, angle, and world position. ...
5
votes
1answer
703 views

Particle System OpenGL (ortho)

I want to implement a particle system in my game but i have no idea where to start :S I've never programmed a particle system, so this is my first time >.<. I only want to display pixels ...