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.

Filter by
Sorted by
Tagged with
74 votes
7 answers
44k views

Good resources for learning modern OpenGL (3.0 or later)? [closed]

I stumble upon the search of a good resource to start with OpenGL (3.0 or later) . Well, I found a lot of books but none of them can be considered a good resource! Here two examples: OpenGL ...
21 votes
1 answer
10k views

What are screen space derivatives and when would I use them?

I see the ddx and ddy glsl functions and the hlsl equivalents come up in shader code every now and then. I'm currently using ...
NeomerArcana's user avatar
88 votes
15 answers
53k views

What are some good learning resources for OpenGL? [closed]

I have been using the OpenGL ES on the iPhone for a while now and basically I feel pretty lost outside to the small set of commands I've seen in examples and adopted as my own. I would love to use ...
52 votes
5 answers
54k views

How to avoid texture bleeding in a texture atlas?

In my game there is a Minecraft-like terrain made out of cubes. I generate a vertex buffer from the voxel data and use a texture atlas for looks of different blocks: The problem is that the texture ...
danijar's user avatar
  • 5,661
19 votes
4 answers
55k views

How can I orbit a camera about it's target point?

I'm drawing a scene where the camera freely moves about the universe. The camera class keeps track of the view (or look at) point, the position of the camera, and the up vector. These vectors/points ...
Luke's user avatar
  • 355
9 votes
2 answers
12k views

How do you determine which object/surface the user's pointing at with lwjgl?

Title pretty much says it all. I'm working on a simple 'lets get used to lwjgl' project involving manipulation of a rubik's cube, and I can't figure out how to tell which side/square the user's ...
Flynn1179's user avatar
  • 291
4 votes
3 answers
4k views

Optimized rendering of a cube mesh world

I want to render a cube-mesh (a.k.a. Minecraft-style) world. If I render each existing cube it will eat up FPS pretty quickly. How can I optimize it? I understand that the point is to not render ...
Tamás Szelei's user avatar
18 votes
2 answers
25k views

How can I convert a mouse click to a ray?

I have a perspective projection. When the user clicks on the screen, I want to compute the ray between the near and far planes that projects from the mouse point, so I can do some ray intersection ...
Will's user avatar
  • 6,937
0 votes
1 answer
684 views

How to generate or smooth really large procedural terrain?

I'm currently trying to generate a really large procedural terrain in WebGL. I use a quadtree for LOD and plan to generate 1 heightmap for each quadtree node (terrain patch). The heightmaps are ...
EnhancedElegance's user avatar
66 votes
9 answers
108k views

Good GUI for OpenGL? [closed]

I am starting to learn OpenGL with FreeGLUT using the Superbible and the knowledge I have from my elementary graphics to brush up on my skills. To get more from this experience I want to integrate a ...
44 votes
10 answers
22k views

Is learning OpenGL 2.1 useless today?

I'm new to 3D OpenGL/DirectX world and I found out that OpenGL 4.1 and GLSL specifications were just released today. A friend of mine gave me the Red Book for OGL v2.1 but, as far as I've read, 3.x ...
jorge_codes's user avatar
  • 2,308
11 votes
3 answers
10k views

How do I implement occluded lighting in a block-based 2D game?

I want to have 2D lighting that can be blocked by in-game objects. My game has a top-down view and all game objects are described by rectangles. Let's say I have a 10x10 world and I place a light at ...
LiquidFeline's user avatar
  • 1,381
5 votes
2 answers
10k views

An efficient way for generating smooth circle

I'm looking for creating smooth circle. OpenGL supports point, line, and triangle. To create other primitives like circle, we utilize the preceding shapes. In my case, I've utilized points as follows: ...
CroCo's user avatar
  • 245
1 vote
1 answer
9k views

OpenGL calculate UV sphere vertices

I am trying to implement a class Sphere in C++. Therefore I want to calculate the vertices in the constructor of the class (or in a seperate function..). Although ...
linux_lover's user avatar
94 votes
9 answers
57k views

Why do we move the world instead of the camera?

I heard that in an OpenGL game what we do to let the player move is not to move the camera but to move the whole world around. For example here is an extract of this tutorial: OpenGL View matrix ...
danijar's user avatar
  • 5,661
46 votes
5 answers
36k views

Should I use textures not sized to a power of 2?

In the early days of OpenGL and DirectX, texture sizes were required to be powers of two. This meant interpolation of float values could be done very quickly, using shifting and such. Since OpenGL 2....
Will's user avatar
  • 6,937
33 votes
2 answers
37k views

A good way to build a game loop in OpenGL

I'm currently beginning to learn OpenGL at school, and I've started making a simple game the other day (on my own, not for school). I'm using freeglut, and am building it in C, so for my game loop I ...
Jeff's user avatar
  • 2,438
31 votes
3 answers
46k views

How do I implement anti-aliasing in OpenGL?

I want to do full-screen anti-aliasing in OpenGL, and dont want to use the anti-aliasing that is provided by OpenGL itself, since I am building a game and want good effects in it. How should I ...
noddy's user avatar
  • 647
22 votes
4 answers
9k 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 ...
notlesh's user avatar
  • 3,867
16 votes
1 answer
20k views

Implementing a skybox with GLSL version 330

I am trying to get a skybox working with OpenGL 3.3 and GLSL version 330. I could not find a completely modern OGL skybox tutorial anywhere on the web, so I modernised an older one (using ...
sm81095's user avatar
  • 533
16 votes
1 answer
17k 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 ...
smoth190's user avatar
  • 906
16 votes
4 answers
5k views

How to load a spherical planet and its regions?

I'm designing a game partially composed of planets exploration. I want to use pseudo-random generation for them, regenerating from a defined seed when I have to load them rather than store every ...
Aracthor's user avatar
  • 1,009
7 votes
1 answer
21k views

The view matrix finally explained

I must say that I am really confused by how a view matrix is constructed and works. First, there are 3 terms: view matrix, lookat matrix, and camera transformation matrix. Are those 3 the same, or ...
Raouf's user avatar
  • 73
7 votes
2 answers
3k views

Square game map rendered as sphere

For a hobby project of mine I have created a finite voxel world (similar to Minecraft), but as I said, mine is finite. When you reach the edge of it, you are sent to the other side. That is all ...
Ross Hays's user avatar
  • 487
7 votes
2 answers
6k views

What is the order-less rendering technique that allows partial transparency?

I've seen somewhere rendering technique that allows order-less rendering of partially transparent sprites/objects. Though I can't remember what the technique is called, so I'm having trouble Googling ...
kravemir's user avatar
  • 1,657
6 votes
1 answer
451 views

LWJGL Eclipse Resource Deployment

I'm still experimenting with some OpenGL in LWJGL, and as I get to know more and more about OpenGL, I start to do more complicated things like multi texturing, shadowmapping and more. Now, right now I'...
Basaa's user avatar
  • 1,053
1 vote
3 answers
3k views

How to draw only visible tiles?

I have a big map with isometric tiles(3d camera), how can i draw only visible tiles ? Whats the best way to do that ? space partitionning (octrees etc...)?
Aldo's user avatar
  • 309
43 votes
1 answer
9k views

How can I reduce aliasing in my outline glow effect?

I'm trying to replicate the glowing outline effect in the Left 4 Dead game. The effect causes an objects outline to glow, even when the object is occluded. Here is a screenshot of the effect: I'm ...
flashk's user avatar
  • 533
42 votes
5 answers
21k views

How can I achieve a good fire effect with alpha blending and particles?

Using the following setting for the OpenGL particle effect: SRC: GL_SRC_ALPHA DST: GL_ONE Creates an additive blend, which looks spectacular on a black ...
Aram Kocharyan's user avatar
35 votes
7 answers
19k 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 ...
Martijn Courteaux's user avatar
29 votes
9 answers
6k views

Should I continue studying OpenGL or just switch to DirectX to give me a better chance of landing a job in the game industry? [closed]

I've been learning graphics programming for some time now using OpenGL and Linux. I'm pretty familiar with most of the concepts, but I would really like to further my knowledge and eventually pursue a ...
adivasile's user avatar
  • 757
28 votes
2 answers
12k views

How many threads should an Android game use?

At minimum, an OpenGL Android game has a UI thread and a Renderer thread created by GLSurfaceView. Renderer.onDrawFrame() ...
kvance's user avatar
  • 383
26 votes
1 answer
14k 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 ...
nosmirck's user avatar
  • 785
23 votes
2 answers
14k 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 ...
Ali1S232's user avatar
  • 8,697
19 votes
2 answers
14k views

What are the common rendering optimization techniques for the geometry pass in a deferred shading renderer? [closed]

I have been developing a game engine using OpenGL 3 and C++ (and glfw for window management). I have advanced so far, got most of the things done except sound entities and optimizations. The engine ...
deniz's user avatar
  • 505
19 votes
1 answer
6k 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 ...
KaiserJohaan's user avatar
  • 1,456
18 votes
2 answers
9k views

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

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 ...
Kenmore's user avatar
  • 283
16 votes
5 answers
12k views

Starting out with OpenGL when most tutorials are out of date [closed]

I'm sure there are already a bunch of questions like this asked, but the constant updating of the OpenGL library throws them all away, and in a month or two, the answers here will be worthless again. ...
Codesmith's user avatar
  • 279
14 votes
2 answers
7k 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 ...
Grimshaw's user avatar
  • 3,101
13 votes
1 answer
6k 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?
Jack's user avatar
  • 425
10 votes
3 answers
4k 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 ...
Armin Ronacher's user avatar
9 votes
1 answer
14k views

How do I generate a 3D race track from a spline?

I want to generate a 3-dimensional race track around a spline that describes its shape. Here's an illustrative video. The track should be an endless tunnel that sweeps along a 3D spline, with some ...
Valentin Galea's user avatar
8 votes
4 answers
6k views

2D Platformer Collision Handling

I am trying to create a 2D platformer (Mario-type) game and I am some having some issues with handling collisions properly. I am writing this game in C++, using SDL for input, image loading, font ...
defender-zone's user avatar
7 votes
2 answers
4k views

Low quality bilinear sampling in WebGL/OpenGL/DirectX

I'm seeing low quality bilinear texture sampling in WebGL, OpenGL and Directx, and was wondering if anyone knew how to make it higher quality? The picture below should help show what I mean. The ...
Alan Wolfe's user avatar
  • 2,363
6 votes
1 answer
13k views

Combining rotation,scaling around a pivot with translation into a matrix

In short: I need to combine rotation (in the form of a quaternion), scaling around a pivot point along with translation into a transformation matrix. The long: I am trying to implement a proprietary ...
wd40bomber7's user avatar
6 votes
2 answers
13k 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 ...
danijar's user avatar
  • 5,661
5 votes
3 answers
41k views

SDL for 3D game programming? [closed]

I have been studying SDL for a few weeks and I have succeeded in making a 2D Ping-Pong game, but I want to get started in 3D development, and I'd like to know if SDL is capable (and suitable) for 3D ...
Narek Babajanyan's user avatar
1 vote
2 answers
2k views

How do I ensure my skybox is always in the background, with OpenGL?

I created a skybox in OpenGL (through LWJGL), but the only way I found to render it behind all objects was to make it very big. This leads to ugly edges between the 6 skybox planes. Optimally, I ...
mojomex's user avatar
  • 91
44 votes
6 answers
39k 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.
ngoaho91's user avatar
  • 714
32 votes
3 answers
36k views

What is the difference between OpenGL ES and OpenGL?

Android uses OpenGL ES, what is the difference between it and OpenGL?
Dr. Snoopy's user avatar
  • 5,105

1
2 3 4 5 6