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
105 views

Linking error at tessellation shaders in GLSL

I'm testing the triangle tessellation from the link http://prideout.net/blog/?p=48#shaders . All the shader are compiled correctly, but when I try to link the program using the command: ...
1
vote
1answer
220 views

What does “GL_CLAMP_TO_EDGE should be used in NPOT textures” mean?

I have two sRGB PNG images I am using for textures. One is 64x64, and works fine. The other is 64x47, and when I attempt to use it I get an error: reason: 'GL_CLAMP_TO_EDGE should be used in NPOT ...
2
votes
1answer
130 views

How can I render a single object that uses multiple textures?

I'm looking for a technique to render an object with multiple texture sources. One texture is static, the other is generated dynamically (it's a render target). For example, say I was rendering a TV. ...
6
votes
2answers
255 views

Fixed Function vs Programmable Pipeline performance with many batches

In OpenGL 2.0 I can easily make 10,000 draw calls per frame (with state changes in between each call). However, if i try to do this in either OpenGL ES 2.0 or DirectX9 with shaders, my peformance is ...
1
vote
1answer
130 views

LibGDX strange camera behaviour

I'm currently doing my final assessment for my study Game Development. I'm currently facing a real weird (maybe explainable) result from my camera. I just set up my scene with alot of tiles and a ...
7
votes
2answers
400 views

Deferred tiled shading, tile frusta calculation in OpenGL

I'm trying to do deferred tiled shading in OpenGL using the compute shader but I have hit a snag when trying to create the frustum for each tile. I'm using AMD's Forward+ demo (written in D3D) as a ...
1
vote
3answers
176 views

How do I efficiently use 16 bit texture coordinates?

While loading a model I get a big array of 32 bit floating point texture coordinates. I just upload that to a single vertex buffer (along with other data, such as vertices, normals, etc.) and use it ...
1
vote
1answer
85 views

Floating point memory usage on gpu

My question is simple: how much memory on GPU does one floating point value takes? I guess it is 4 bytes, but I'm not sure. So for example is it true that vec4, which holds 4 floats, each 4 bytes ...
2
votes
3answers
198 views

How can I apply a mesh distortion to walls like in Dungeon Keeper 2?

In Dungeon Keeper 2, the walls of the dungeon have different random shapes depending on its state (freshly dug or reinforced, and so on). They look like they are cubes of 3x3 vertices that have a ...
3
votes
4answers
226 views

Dynamic Terrain Triangulation

Is there someone who know/have an algorithm which can perform terrain triangulation like on the example image right under (there is a secondary image as well). The reason I say "Dynamic" is because I ...
0
votes
1answer
256 views

problem using glm::lookAt and glm::perspective

I'm trying to change the code from the 22th tutorial at http://ogldev.atspace.co.uk/, using the GLM library, but the result seems wrong. The problem is shown in the below picture: While it should be: ...
0
votes
2answers
72 views

Flip DDS Texture without original source image for OpenGL

I'm wondering if there's a converter for DDS textures after they've been created. We don't have access to the original source images and we would like to avoid changing our shaders, as I'm told it's ...
-1
votes
1answer
170 views

is instanced rendering faster? [closed]

Is instanced rendering used in GLSL faster than doing something like this.. for(int i=0; i<10; i++) { glDrawArrays(GL_POINTS, 0, 3000); } Suppose I want to render 'grass', which is the best ...
1
vote
0answers
71 views

Texture not visible on particles

This is the first time I am working with particles (GL_POINTS) I am using kinematic equations and controlling their movement in vertex shader. I am following an example given in OpenGL 4.0 Cookbook ...
1
vote
1answer
66 views

glIsBuffer unexpected result

static void BindBuffer(BufferTarget target, GLuint buffer) { if(!glIsBuffer(buffer)) throw runtime_error("This is not a buffer. WTF?"); glBindBuffer((GLenum)target,buffer); ...
1
vote
3answers
156 views

Rendering order

In this thread Rendering a model with transparent or translucent uv map applied doesn't work , I asked about what was wrong with my model that the transparency wasn't working. I've got an answer ...
0
votes
0answers
66 views

Rendering a model with transparent or translucent uv map applied doesn't work

Before I try to make anything transparent, the model renders nicely. When I change the uv layout so that one piece of the model will be transparent, it renders horribly. This is the result with a ...
-1
votes
2answers
105 views

Using Geometric Slerp to move Camera

I'm writing a program in C++ using OpenGL and GLM; I'm trying to get my camera to follow my car. So far it successfully follows it around the screen, but I'm having trouble adjusting the Camera's ...
6
votes
1answer
182 views

How to debug framerate drops with VBOs, OpenGL

I'm working on an experimental app to test how VBOs perform when rendering a minecraft-like world. If the performance is better than what I use now I'll update my actual game. Based on what everyone ...
4
votes
1answer
188 views

Best (for performance) practices for using texture slots (glActiveTexture)

Where exactly does the cost from switching textures come from? Would it be a good strategy to just fill all available texture slots from 0 to GL_MAX_IMAGE_TEXTURE_UNITS - 1 using glActiveTexture and ...
2
votes
1answer
182 views

How to crop camera's viewport?

I'm making an Android game using LibGDX. I want to do something hard to explain but I'll try nonetheless. Look at this camera view (it's from 3ds max): I can get same exact view in LibGDX without ...
3
votes
3answers
509 views

How can I draw a quad in wireframe with modern OpenGL, without rendering the interior bisecting edge?

I want to draw a quad (not two triangles). I actually know that triangles are faster, as I answered this question. But let's say I am building a 3D modeling tool. It makes sense to draw a quad for ...
3
votes
2answers
189 views

How can I improve the performance of this rendering code?

I've created a practice application for rendering triangles/squares/cubes using VBOs. This is mainly so I can get it right before upgrading a 3D block world game I've written that currently is using ...
1
vote
1answer
33 views

VBOs no longer renger when gluPerspective applied

I've written a basic program so I can make sure I'm properly learning VBOs before converting my 3d game's rendering to them. Essentially, this question is why changing the perspective is the GL setup ...
1
vote
0answers
37 views

after calculating normals texture is full of black triangles

After I added normal calculation to my project - the surface of landscape became full of black triangles and even have a deformity on one side. Here I calculate normals int x, y; int Index = 0; ...
1
vote
1answer
152 views

lighting for landscape

I've got a landscape(created in Photoshop .raw file) and a .tga texture for it. I read .raw file and read .tga file like this LoadRawFile("landscape.Raw", MapSize * MapSize, &HeightMap[0][0]); ...
1
vote
2answers
144 views

How can I create a VBO when I don't yet know how many vertices it will contain?

I'm trying to convert my 3D block work rendering from immediate mode and display lists to VBOs. I'm having trouble understanding how to properly handle creating the buffers: I really don't know how ...
2
votes
0answers
180 views

Help with 2D sprite instancing [closed]

Alright, so I'm pretty new to OpenGL programming. I've been writing my own engine, initially using the fixed function pipeline. I then did a 1:1 replacement of the fixed-function methods with shaders ...
2
votes
3answers
122 views

Can I store D3D9 textures so that they don't consume process memory and also don't require “lost device” handling?

I have an OpenGL application that uses a lot of texture memory. While the texture is stored in the system memory, that texture memory is not part of my application process memory. When this ...
1
vote
1answer
118 views

Separate shader programs or branch in shader? [duplicate]

I have a bunch of point lights and directional lights. Instead of checking the light type in the fragment shader and then branch for either point light calculation or directional light calculation, is ...
0
votes
2answers
174 views

How forward rendering done using OpenGL?

Recently I come across the term forward rendering. I'm kind of curious how this could be done in OpenGL. I have done a lot of search on this, majority of the result I get are on theory but not code ...
3
votes
1answer
198 views

Solving banding with additive blended particles

I needed to implement particles for my 2D game, written in C++ with OpenGL for graphics, so I went ahead and created a nice geometry container to batch particles together and then implemented the ...
0
votes
1answer
101 views

How can I improve the rendering speed of procedurally-generated curved shapes (while keeping them smooth)?

I'm trying to render a large, procedural-generated shape with OpenGL, but I'm having some issues. I'm rendering the shape by composing it from many cubes, as follows: int TRACK_MIDDLE2 = 107; for ...
0
votes
1answer
110 views

Material properties and deferred renderering

I'm using assimp to import 3d models, and each model defines a set of material properties as well, such as material diffuseColor, ambientColor, specularColor and emissiveColor. Where would I store ...
1
vote
2answers
157 views

Tangent on generated sphere

I have difficulties understanding the tangent/bitangent concept for normal mapping, or rather the calculations of them. I draw a sphere which is generated with the code in the OpenGL redbook ...
1
vote
1answer
200 views

glGenerateMipmap confusion

I'm trying to get a grip on mipmaps with OpenGL. I believe I understand the concept, but when trying to have OpenGL generate them I wonder how it determines how many mipmaps to generate? Here's what ...
1
vote
1answer
149 views

How can I improve the performance of texture switching without resorting to atlasing?

I'd like to use texture images that are not a sprite sheet or other form of texture atlas, mainly because I'll be consistently adding and swapping textures while I figure out the direction my game ...
2
votes
0answers
123 views

Blank texture in Frame Buffer Object in Deferred Rendering

I'm running the tutorial 35 from olgdev.atspace.co.uk, and it's so strange that the result is a blank screen. This tutorial is performing the first step of Deferred Shading, which means decoupling of ...
0
votes
1answer
134 views

glRotatef rotation never applied to 3d cube

I have a floating cube that I want to rotate around the Y axis. The cube renders fine, the proper size, the proper coordinate, the proper texture/faces, etc. However, the rotation is never applied. ...
0
votes
1answer
33 views

Versions of GL and its device that don't display or required powers of 2 for the sprites

From this question aside from identifying possibilities of displaying images that don't needed to require powers of 2, what are the versions of GL that can actually display images even if don't needed ...
0
votes
1answer
69 views

Is it possible to display no white images/sprites when using the latest Android OS?

Was it okay to use Texture.setEnforcePotImages(false) in order to disable conditional width and height pixel size that requires power of 2? I'm planning to sell the game app at Google Play. I want to ...
0
votes
3answers
262 views

Encode two integers into colour values and compare them in a HLSL shader

I am writing a 2D point and click adventure game in Monogame, and I'd like to be able to create an image mask for every room which defines which parts of the background a character can walk behind, ...
2
votes
1answer
384 views

OpenGL - texelFetch vs texture

I know main difference between texelFetch and texture. But I have two question Is there some penalty with texelFetch ? Like not using cache etc. Is it the same, if I use texelFetch instead of ...
1
vote
1answer
232 views

View to normal calculation in GLSL

Sorry for the terrible title, but I really cant think of anything better.. Suggestions welcome. I am trying to do something like showcased in this video: http://www.youtube.com/watch?v=CaTI2d0tQME ...
0
votes
1answer
158 views

Why am I seeing undesirable rendering results using VBOs like this?

I am trying to write a program that renders using VBO(vertex buffer objects). Everything works great except that when I run the program, It looks like the object is spazzing out. I think its due to ...
1
vote
1answer
630 views

Basic Car Movement, Converting 2D Vectors to 3D problems

I'm trying to follow this guys method for steering a basic car. Link. It's the first example I can sort of get my head around and I'm trying to convert it to a working 3D version. To get some scope, ...
0
votes
1answer
77 views

Blending and shadowmapping?

I am trying to implement shadow mapping, and currently I have 2 point lights and 1 global ambient light source and my rendering loop looks roughly like this (the details are not relevant): void ...
5
votes
2answers
448 views

atmospheric scattering and sky geometry

I'm trying to implement an atmospheric scattering in my graphics (game) engine based on the gpu gems article: link. An example implementation from that article uses a skydome. My scene is different - ...
0
votes
1answer
105 views

Storing attributes in static geometry

I have a Minecraft like world where I statically create one instance of each tile type, and then place it around the world. However, I don't know how to actually change individual attributes for each ...
1
vote
1answer
116 views

How can I handle errors when there is no valid OpenGL context?

I'm writing cross-platform (iOS, Android, OSX, Windows) library code that draws its output using OpenGL. I expect my users will often try to call my library's rendering functions without a valid ...