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

14
votes
6answers
3k views

Modern Shader Book?

I'm interested in learning about Shaders: What are they, when/for what would I use them, and how to use them. (Specifically I'm interested in Water and Bloom effects, but I know close to 0 about ...
14
votes
3answers
2k views

How can I unit test rendering output?

I've been embracing Test-Driven Development (TDD) recently and it's had wonderful impacts on my development output and the resiliency of my codebase. I would like to extend this approach to some of ...
14
votes
1answer
3k views

Rolling my own scene graph

Hello Game Development SE! I'm crawling my way through OpenGL with the hopes of creating a simple and very lightweight game engine. I view the project as a learning experience that might make a ...
14
votes
1answer
3k views

Which is the best LOD method for planet rendering?

I'm currently working on my thesis, it is an engine to render terrains of planetary size. I'm still finishing my research and I have encountered a lot of stuff about this subject, the problem is that ...
14
votes
4answers
4k views

Real time shadow casting in a 2D isometric game

I'm writing a small 2d isometric engine in C++ and I'm trying to implement real time shadow casting. I followed a simple approach described on this page and here is the result (light is located at the ...
13
votes
3answers
6k 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 ...
13
votes
2answers
1k views

How can I simulate a limited (256) color palette in OpenGL?

On Twitter, I found this screenshot of a game in development: The image on top seems to be without any color limitation. But the two other pictures at the bottom have a 256 color palette. I want ...
13
votes
4answers
20k views

Fastest way to draw quads in OpenGL ES?

I am using OpenGL ES 2.0 I have a bunch a quads to be drawn, would love to be able to have to pass only 4 vertices per quad as if I were using GL_QUADS, but basically I just want to know the best way ...
13
votes
1answer
1k views

Normals vs Normal maps

I am using Assimp asset importer (http://assimp.sourceforge.net/lib_html/index.html) to parse 3d models. So far, I've simply pulled out the normal vectors which are defined for each vertex in my ...
13
votes
2answers
12k views

GLSL Shader Effects: How to do motion blur, etc?

I am not sure how right it is to ask this question, but still here it goes. I have a full 2D environment, with sprites going around as landscape, characters, etc And to make it more state-of-art ...
13
votes
1answer
2k views

Should I distribute shaders in a compiled form or in plain text?

Having an application that uses shaders that have been wrote in GLSL, what is the best strategy for the distribution in the real world and for the desktop and mobile? I'm aiming to distribute this in ...
13
votes
2answers
1k views

Do I lose/gain performance for discarding pixels even if I don't use depth testing?

When I first searched for discard instruction, I've found experts saying using discard will result in performance drain. They said discarding pixels will break GPU's ability to use zBuffer properly ...
13
votes
3answers
6k views

How do I implement a quaternion based camera?

UPDATE The error here was a pretty simple one. I have missed a radian to degrees conversion. No need to read the whole thing if you have some other problem. I looked at several tutorials about this ...
13
votes
1answer
450 views

Orthographic unit translation mismatch on grid (e.g. 64 pixels translates incorrectly)

I am looking for some insight into a small problem with unit translations on a grid. Update and Solved I solved my own issue. See below for details. Everything in this part of the post turned out to ...
13
votes
1answer
729 views

Is there any performance benefit to sharing shaders between programs?

OpenGL allows you to share the same shader between multiple programs. Aside from saving small amounts of memory and a shader handle, are there any GPU-side performance benefits to doing this?
13
votes
4answers
4k views

Getting a texture from a renderbuffer in OpenGL?

I've got a renderbuffer (DepthStencil) in an FBO and I need to get a texture from it. I can't have both a DepthComponent texture and a DepthStencil renderbuffer in the FBO, it seems, so I need some ...
12
votes
7answers
2k views

Why does the resolution of floating point numbers decrease further from an origin?

My OpenGL scene has objects that are positioned at ridiculously far distances away from the origin. When I view these objects, and pan/rotate/zoom a camera around them, they 'jitter'. That is, the ...
12
votes
4answers
2k views

How can I use the graphics pipeline to render volumetric data based on a density function?

Both graphics APIs (OpenGL and DirectX) devise a well defined pipeline in which several stages are programmable. These programmable stages require to take a fixed minimum amount of data and are ...
12
votes
1answer
1k views

How to emulate PSX's graphics with OpenGL?

I want to know what options (or shaders) to set so that my OpenGL game looks like Playstation 1 game. I know it probably can not be achieved 100 % because PSX used television and television renders ...
12
votes
3answers
4k views

Why do pixel shaders not let us read directly from the framebuffer or the depth buffer?

Letting me sample the framebuffer or the depthbuffer in the pixel shader would be an extremely useful feature. Even just being able to know the depth or the color of whatever is behind the current ...
12
votes
1answer
1k views

OpenGL - white edges on cubes

In a minecraft-like game I'm making, I get white edges on my cubes: It is much more noticeable in darker textures. The textures are being setup like this: glTexParameteri(GL_TEXTURE_2D, ...
12
votes
1answer
5k views

How can I tell how much video card memory I'm using?

I want to programmatically determine at runtime how much video card memory is being used by my program. Specifically I'm wondering about how to do it on a Windows machine using OpenGL, but am ...
12
votes
1answer
9k views

Making a HUD/GUI with OpenGL (LWJGL)

I'm at the stage in my game development where I need to make a HUD or GUI. I've never gotten to this part, so I don't know how its done. I tried rendering a simple quad at a fixed position on the ...
12
votes
5answers
4k 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 ...
12
votes
1answer
663 views

Does the order of vertex buffer data when rendering indexed primitives matter?

I'm building a 3d object's triangles. If I can write them to the buffer in the order they are calculated it will simplify the CPU code. The vertices for the triangles will not be contiguous. Is there ...
12
votes
6answers
917 views

Seamless tilemap rendering (borderless adjacent images)

I have a 2D game engine that draws tilemaps by drawing tiles from a tileset image. Because by default OpenGL can only wrap the entire texture (GL_REPEAT), and not just part of it, each tile is split ...
11
votes
7answers
5k views

Best (Most Popular?) Image Format For Texturing [closed]

Okay, so I am using C++ with OpenGL, and I am going to create a loader to load in textures for my 3D game. (But the textures are 2D). I want the option of transparency, even if I decide not to use it. ...
11
votes
5answers
1k views

What are the benefits of capping frames per second? (If any)

I am working on a simple game in OpenGL, using SDL for display initialization and input, and it appears in terms of timing I have two options available to me. Number one being just sleeping for the ...
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 ...
11
votes
2answers
4k views

Am I allowed to make my Minecraft clone open source?

I'm developing in my spare time a game like Minecraft. In fact, it isn't "like Minecraft", because I'm trying to make it a close as possible copy of it (meant as exercise for myself at the age of 16 ...
11
votes
4answers
4k 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: ...
11
votes
8answers
18k 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 ...
11
votes
7answers
3k views

Fastest way to create a simple particle effect

I am looking to the fastest way to create really simple particle effect that will be spammed like hell on the game... Basically, my game looks like a vectrex game, made mostly of lines... I want to ...
11
votes
4answers
7k views

OpenGL: why do I have to set a normal with glNormal?

I'm learning some basics of OpenGL but I'm wondering why there is a call glNormal to set the normal of vertices. If I create a simple triangle like this: glBegin(GL_TRIANGLES); ...
11
votes
6answers
7k views

What version of OpenGL should I code for, given compatibility and performance considerations?

When the OpenGL spec is updated, they only ever add features. So in theory, the latest and greatest hardware with support for the Core and Compatibility profiles should run super old OpenGL1.1 code ...
11
votes
5answers
5k views

Learning OpenGL: Red and Blue book still relevant?

I've recently purchased the Orange book( GLSL ) and am wondering if it is important at all to read through the red and blue books as well? Any thoughts?
11
votes
2answers
2k views

What should I worry about when changing OpenGL origin to upper left of screen?

For self education, I'm writing a 2D platformer engine in C++ using SDL / OpenGL. I initially began with pure SDL using the tutorials on sdltutorials.com and lazyfoo.net, but I'm now using SDL to ...
11
votes
3answers
9k views

Trying to understand light on Opengl, how to simulate a realistic sun light?

I don't know if I'm doing something wrong or missing anything but I want to simulate sun light, like in a sunny day. When the object is facing the directional light, it's well lit and there's no ...
11
votes
1answer
441 views

How to achieve light that changes color mid-way?

I thought of creating light sources, and some colored windows. Now, the windows are semi-transparent. How could I make it so that when the light (say, pure white) hits the glass and continues through ...
11
votes
1answer
3k views

How does UVW texture mapping work?

I'm trying to understand the mathematical theory behind UVW mapping. Can anyone explain me how UVW mapping works? Or at least provide me a pointer?
11
votes
3answers
3k views

What is the difference between OpenGL 1.x and 2.x?

Is there a good tutorial that shows the difference between OpenGL 1.* and 2.*? It would be very helpful to know which functions I should not be calling (like glBegin(), I assume).
11
votes
2answers
495 views

How does Halo draw projectiles?

I am trying to draw projectiles and doing billboarding. A projectile consists of a bill-boarded "particle" and a "tracer". When I billboard a projectile, it cannot be seen when the player's viewing ...
10
votes
12answers
10k views

Is it a waste to learn OpenGL?

What I've gathered around the internet and various sources is that DirectX has pretty much taken a stronghold grip onto the graphics API domain. And to be honest, I gave learning DirectX10 a chance, ...
10
votes
2answers
5k 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 ...
10
votes
1answer
964 views

How to reduce image size without pixelation?

I see lots of games with smooth edges characters and high res images, however when I try to reduce images to say 64x64 for my character I just get a pixelated mess. even if I start with a 64x64 canvas ...
10
votes
3answers
4k views

How can I bend an object in OpenGL?

Is there a way one could bend an object, like a cylinder or a plane using OpenGL? I'm an OpenGL beginner (I'm using OpenGL ES 2.0, if that matters, although I suspect, math matters most in this case, ...
10
votes
3answers
2k views

Go pure OpenGL or GLSL? [closed]

I got interested in studying graphic programming so the obvious entry point was to learn OpenGL. But gathering scattered information around forums and sites, it seems that a pure OpenGL implementation ...
10
votes
3answers
10k views

How can I make OpenGL textures scale without becoming blurry?

I'm using OpenGL through LWJGL. I have a 16x16 textured quad rendering at 16x16. When I change it's scale amount, the quad grows, then becomes blurrier as it gets larger. How can I make it scale ...
10
votes
2answers
9k views

OpenGL ES 2.0 Point Sprites Size

I am trying to draw point sprites in OpenGL ES 2.0, but all my points end up with a size of 1 pixel...even when I set gl_PointSize to a high value in my vertex shader. How can I make my point sprites ...
10
votes
5answers
666 views

API agnostic bridges (ie. OpenGL/D3D/Whatever). Do you use them, how you make them. Pro's and Con's

You are making a 3d engine. You want best of multiplatform worlds. Suddenly you realize that if you want to use Direct3D on Windows machines and OpenGL on OSX/Linux, you'll have to sacrifice supported ...