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
0answers
16 views

Arcball camera rotation

I need some help adding Arcball camera rotation in my LWJGL modern OpenGL game. Right now, I have a camera that follows the player. I want to be able to hold down the right mouse button and move the ...
0
votes
0answers
80 views

Performance differences when it comes to dynamic vector graphic between using OpenVG and OpenGL [on hold]

In my Game Engine I want to add an advanced GUI framework. It will have dynamic vector based graphic elements. Consider it similar to HTML5 and CSS3 or GTK/Qt. I could implement this via OpenGL (low ...
0
votes
0answers
30 views

Camera Rolling when Implementing Pitch and Yaw

I am implementing a camera in opengl for an android game and am having problems getting the pitch/yaw/roll of the camera correct. I have read many tutorials on quaternions and have implemented a basic ...
0
votes
0answers
19 views

How to load and render PhysX 3.3 heightfield

I'm trying to load a PhysX 3.3 heightmap and render it with OpenGL using glm and glfw, but so far it doesn't seem to be working. I'm basing my code on the PhysX samples, and am also using FreeImage to ...
0
votes
0answers
33 views

OpenGL: What's the best way to convert a screen coordinate to a world coordinate? [duplicate]

For example, suppose I'm building a first-person shooter and the player pulls the trigger. I want to convert the screen coordinate (x, y) into a world coordinate (x, y, z) to know what they've hit. ...
0
votes
1answer
65 views

Per vertex diffuse lighting not propogating across entire model

I'm not sure how to describe this problem so I've added a picture. When I add per vertex diffuse lighting to my model (just a field of cubes for simplicity) the lighting effect applies to each ...
1
vote
1answer
49 views

What is the relationship between glVertexAttribPointer index and GLSL location?

I've been getting some strange results when trying to implement a normals buffer for the purpose of rendering lighting. It seems to be related to the indexes for glEnableVertexAttribArray, ...
1
vote
0answers
31 views

Variance shadow maps less blurred than normal shadow map

I've implemented VSM (and also ESM) in my engine but results are for me not as I expected and saw in many examples published on network. I set filtering of shadow maps to GL_LINEAR but when I compare ...
1
vote
0answers
38 views

Shadow map shimmering, indexing outside the shadow map

I have tried to reduce shadow shimmering/flickering using technique described here: http://msdn.microsoft.com/en-us/library/windows/desktop/ee416324%28v=vs.85%29.aspx I works as I want and shimmering ...
0
votes
0answers
23 views

Artoolkit, transform pixels coordinates to be aligned to the marker

I'm working with artoolkit, i was trying to get the marker pixels using dataptr and marker_info (x,y coordinate), then i used opengl (GL_POINTS) to draw on these pixels and that was working right in ...
1
vote
0answers
45 views

Easy way to set face colors with indexed VBOs?

I'm loading OBJs, which lend themselves well to setting up as indexed VBOs, since each vertex is only defined once and then a face definition will reference the same vertex more than once when they ...
0
votes
0answers
64 views

Garbaged textures on OpenGL [closed]

I've been struggling with this for a long time, and now I've hit a dead-end, I have no idea what to do. I'm pretty new to OpenGL (roughly about eight months), and I've been developing an engine for ...
1
vote
1answer
63 views

IBO interfering with VBO data?

I have a vertex and color VBO that render a plane (2 triangles) just fine. However, when I attempt to use an IBO to render the plane, the vertices are completely off. My nice square looks all crumpled ...
2
votes
1answer
85 views

How to share values between different shader programs?

I am using Unity but this might concerns all type of shaders. I would like to know if this is possible to share values between different shader pass.Let's imagine that I am computing something in the ...
0
votes
1answer
31 views

Using IBO's with color

I am trying to familiarize myself with IBO's by drawing triangles etc but I'm finding no way to get the color to apply properly. Can I not use an IBO to index the color values as well? I am having ...
-1
votes
0answers
23 views

How difficult is to port a Cocos2D-iPhone game to Android AndEngine? [closed]

I'm considering to develop a new game for iOS using Cocos2D. If the app shows good results, I want to port it to Android. I have a few options for porting it: Use apportable to port the ...
3
votes
2answers
147 views

Shader - Calculate depth relative to Object

I am trying to calculate depth relative to the object.Here is a good solution to retrieve depth relative to camera : Depth as distance to camera plane in GLSL varying float distToCamera; void main() ...
0
votes
0answers
23 views

How to upload lights when doing one pass per light

Suppose I have a reasonable amount of light sources that I upload at once in my forward rendering and accumulate them in shader. Now that I am willing to move to deferred, and so one pass per light, ...
0
votes
1answer
52 views

Why does my modern OpenGL heightmap render as line segments instead of faces?

I'm brand new to OpenGL and have been trying my hand modern openGL. A few days ago, I tried to create some terrain by using a heightmap stored in a grayscale 32-bit BMP. I am using SDL 2.0, GLEW and ...
-3
votes
0answers
51 views

GLSL array with variable index? [closed]

I have a GLSL fragment shader with this part of code: for(int i = 0; i < 10; i+=3){ vec3 l_pos = vec3(lightMat * vec4(light_poses[i],light_poses[i+1],light_poses[i+2],1)); vec3 ...
0
votes
1answer
44 views

GLSL: Vertex attribute to int

I'm trying to write a shader which renders a multitextured geometry wihout rerendering the geometry with each texture. In my test I'm not using textures, I just convert the texture index to a color ...
0
votes
0answers
36 views

Depth texture white in shader

I am trying to implement shadow mapping into my project and am stuck at this problem: If I'm reading the shadow map values with glReadPixels and linearize those values, I am getting exactly the value ...
2
votes
0answers
100 views

Problem with uniforms in OpenGL

I have a strange problem I can't figure out. On the CPU I have class that handles the material properties for a model. material = new Material(); material->Emissive = vec3(0.1, 0.0, 0.0); ...
1
vote
1answer
62 views

Design question: best way to model and visualize a long grid of data [closed]

Perhaps some noob questions for a scientific application that you can assist with: I am trying to render a large, evenly spaced grid of data in 2D. The full data set dimensions could be anywhere from ...
0
votes
3answers
66 views

Arbitrary number of VBO to Vertex Shader

I am currently using standard modern OpenGL way to render a mesh via VBO and attributes glEnableVertexAttribArray(aVertexPosition); glBindBuffer(GL_ARRAY_BUFFER, VBO); ...
-1
votes
0answers
34 views

Incorrect texture applied to triangle

I am trying to draw a certain part of a texture based on data from another texture. A texture is passed into the fragment shader. Its red component contains a value from 0-255 (shader maps it to 0-1) ...
0
votes
0answers
55 views

Shader - Objects Depth or Thickness

I am using Unity and would like to render the thickness of an object.My first thought was to use the ZBuffer and the depth but it is always depend to the camera, it seems legit.But I would like to ...
1
vote
1answer
69 views

libgdx glClearColor not setting right color?

i just new to libgdx and trying to understand the example code, the following code sets the bg color Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); Gdx.gl.glClearColor(60,181,00,0f); my ...
1
vote
1answer
148 views

How do I call OpenGL methods that require pointers in C#?

I have found the following C++ code in this tutorial to draw a triangle with OpenGL 4: float points[] = { 0.0f, 0.5f, 0.0f, 0.5f, -0.5f, 0.0f, -0.5f, -0.5f, 0.0f }; GLuint vbo = 0; ...
0
votes
3answers
88 views

Can I mix the use of VAO and direct usage of glVertexAttribPointer?

Let's say I am not using VAOs. I have an array of vertex positions in memory that I want to send to the shader. I do the following (assume I have enabled the corresponding vertex attrib arrays): ...
0
votes
1answer
78 views

OpenGL / Soil Image Loading Difficulties [closed]

The Problem I am attempting to load and display an image in OpenGL using the SOIL library. I originally started with lodePNG but I had difficulties getting the image to display so I assumed it was ...
5
votes
1answer
65 views

Texture is black when manually building mipmap

I am trying to manually build a mipmap from a series of images. For the sake of brevity, let's assume the file containing the images I want (from 256x256 to 32x32) have paths file_1...4. What I do ...
0
votes
1answer
98 views

What is wrong with my normals?

I am trying to build a cube as a composition of many quads, with each quad being composed of two triangles. All the triangles have the same size. I am dong this (instead of drawing a single cube with ...
1
vote
0answers
64 views

Rotating a scene around a fixed axis

I am looking for a way to move my scene so that when I translate forward/back/left right it moves directly up/down/left/right on the screen. Currently it does do that until I rotate (by anything ...
-2
votes
0answers
22 views

Mouse Selection custom shape opengl render select

I'm using openTk for a my project. I have serious problem with mouse selection. I tried unsuccessfully a lot of examples found on the web. So, I have to draw a grid with some coils (custom cylinders ...
0
votes
0answers
30 views

Load different grayscale images into the same texture

I have a series of images loaded as data1 = stbi_load_from_file(file1,&width,&height,&comp,1); data2 = stbi_load_from_file(file2,&width,&height,&comp,1); data3 = ...
4
votes
1answer
198 views

Do OpenGL buffers overflow to CPU memory?

This is a question about OpenGL buffers and memory. My game world is mid-sized, one contiguous space, unchanging, and only partially visible from any position. Will modern OpenGL overflow buffers ...
7
votes
2answers
365 views

stencil shadows - doom 3 engine - precision errors - shadow cracks - why?

I am testing the limits of the Doom 3 engine - in regards to maximum map size. I noticed some stencil shadow precision errors that become more pronounced when objects get further and further away ...
-1
votes
1answer
50 views

MVP Matrix * Vector3 = Black Screen? [closed]

I'm relatively new to computer graphics so please take it easy. I created a ModelViewProjection Matrix and I sent it to my shader: #version 330 core layout(location = 0)in vec3 vert; uniform mat4 ...
0
votes
1answer
57 views

Why does my vertex shader produce no output until I add some arbitrary value to the position attribute?

I want to draw a textured quad but there is nothing drawn and the setup should be right. This is my vertex shader: #version 330 in vec2 position; in vec2 texel; out vec2 texCoord; void main() { ...
2
votes
0answers
78 views

Skybox rendering

I am sorry if this is trivial, but I got into OpenGL just very very recently. I am trying to render skybox (with cubemaps) and this is what I have done: Created a VBO with vertices positions (36 ...
0
votes
0answers
55 views

Problems texturing a sphere using a cubemap

I have a single problem which I've attempted two methods to resolve. Neither is giving me 100% results. I've read about 100 tutorials and looked at code but it's just not working out for me; I believe ...
1
vote
2answers
78 views

Weird GLM perspective problems with my 2D Game

I am trying to create the graphics system of a 2D game using OpenGL 3.3. To help me in this task I am using the GLM math libraries. However I am having some trouble. When my objects (for now they ...
1
vote
2answers
113 views

How can rotate a 2D textured quad in legacy OpenGL immediate mode?

I have a texture of a tank, and I want to it appearance on the screen depends on its current direction, so I decided to use rotating texture functions of OpenGL. I followed some advices through Google ...
3
votes
0answers
75 views

Are there alternatives to multiple buffering? [duplicate]

I'm learning about game programming. So far, my sources lead me to believe that multiple buffering is the best technique for redrawing in OpenGL. Are there other redrawing techniques? What are their ...
0
votes
0answers
17 views

Using normal maps in irrlicht lime with Direct3D9

I am using Irrlicht Lime, a .NET wrapper for the Irrlicht Engine. In my scene I render some simple geometries, that I construct "by hand". These are textured and shoud get a better look through normal ...
2
votes
1answer
81 views

OpenTK GL.DrawElements is never called

I found this C++ code here. It draws simple rectangle. Works great. #define GLEW_STATIC #include <iostream> #include <glew.h> #include <freeglut.h> const GLchar* vertexSource = ...
0
votes
0answers
24 views

Is it possible to loop over an array of samplerCube/samplerCubeShadow using OpenGL/GLSL?

I try to manage a scene with several point lights. For the moment my program works perfectly with just one point light. So I have in my fragment shader the following uniform declaration: uniform ...
0
votes
1answer
86 views

OpenGL segfault in DrawElements

I've asked this question on regular StackOverflow but without much success yet. The below program produces a segfault on the call to glDrawElements. I've looked at my max and min index values and they ...
1
vote
2answers
113 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 ...