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

Collision between a sphere and a mesh(height-map)

I am trying to implement a method that detects the collision between a sphere and a mesh and reflects the vector of speed. I have a method, that detects a collision between a sphere and a triangle and ...
0
votes
1answer
55 views

Wrong texture position on camera move

When in my game i move my character, the camera follows it. I have no problem drawing this char when it is moving or moving another char when the camera is still. Now, when i move both of them, the ...
3
votes
1answer
444 views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
0
votes
0answers
18 views

How should I go about creating a generic Scene object for managing VBO data?

To simplify managing multiple types of data with different shaders and textures, I thought about creating a generic Scene object (is there a name for this?) which would allow me to pre-configure how I ...
0
votes
2answers
40 views

Opentk Textured Full Screen Quad

I want to display a texture on a full screen quad. What I get is a completely green quad and after a week of debugging I cannot understand why. I am currently using OpenTK 1.1.2225 and ...
4
votes
1answer
86 views

What causes seemingly random triangle artifacts in OpenGL?

When switching version of OpenGL from 4.5 to 4.4, I suddenly started seeing these weird random triangles flickering over my scene They move around somewhat randomly and are always pointed towards ...
0
votes
1answer
56 views

Is glxinfo saying that the 980 GTX doesn't support a 32 bit depth buffer?

I've been using the glxinfo command (glxinfo -v) to explore the supported framebuffer configurations. There are two values relating to depth, "depth" and "depthsize." According the source, it appears ...
0
votes
1answer
200 views

Java OpenGL Perspective matrix not working

I'm trying to render a simple triangle with OpenGL in Java using LWJGL3. Everything is working great, but the projection matrix (perspective) is not working. In C++ I just used to apply the ...
0
votes
1answer
44 views

Parsing .OBJ to fit the gldrawelements() call. c++/opengl

I'm struggling trying to get this to work like it should. Ive been able to make an obj loader that fits the glDrawArrays() call, with uv and facenormals, but when trying to modify it to fit ...
0
votes
1answer
111 views

OpenGL strange lighting/model problem

I've made a .obj reader in c++ and I've tried rendering some models. I've got the whole concept from here: ...
0
votes
2answers
221 views

Render specific part of a texture in OpenGL (2D Sprite Sheet)

I've looked at this answer to find out how to render just a part of a texture: http://stackoverflow.com/questions/6884285/c-opengl-render-part-of-an-image I tried that, but the problem is, this is how ...
0
votes
0answers
30 views

Unable to translate the object such that it looks like it is moving

This is the code I'm using in the display function to translate the object. ` while(a<500.0) { glPushMatrix(); glTranslatef(a,0.0,0.0); glScalef(0.5,0.5,0.5); ...
0
votes
1answer
17 views

GLSL uniform array with size set by another uniform

Will the follwing GLSL code work? #version 330 uniform int size; uniform float[size]; void main() { //do something }
2
votes
1answer
61 views

Cannot connecting texture to heightmap using mapped uniform location

In my shader program, I have my attributes and uniforms added to a map for each. What I have displayed is a heightmap, but cant seem to connect the graphic texture to display. mUniformList ...
1
vote
1answer
583 views

OpenGL Tessellation makes point

A little problem with my tessellation shader. I try to implement a simple tessellation shader but it only makes points. Here's my vertex shader : out vec4 ecPosition; out vec3 ecNormal; void ...
1
vote
1answer
230 views

Minecraft Modding - How do I use OpenGL stencil functions alongside the game's GlStateManager?

Note: I am using Minecraft Coder Pack 9.10 for game version 1.8.0 (official release). I am trying to make a multiline text field similar to the game's original net.minecraft.client.gui.GuiTextField. ...
0
votes
1answer
63 views

Issue with detecting collisions in Pong

I've been working on making Pong in OpenGL and SDL and currently have both paddles and the game ball set up properly. I have an Object (or Entity) class which is used to instantiate each of the ...
1
vote
2answers
48 views

OpenGL [LWJGL3] - Matrix4x4 not rotating correctly

I tried today to make my own matrix4f class because of that LWJGL 3 does not include a class for it. So I arrived at rotation and it does not seem to work. I tried using the old util from LWJGL 2 and ...
1
vote
1answer
84 views

OpenGL Applications Bring computer to halt

Whenever I run any application that utilizes the OpenGL interface, my entire computer comes to a halt, but it doesn't do this when it utilizes the DirectX interface. I run both Linux (Ubuntu 15.10) ...
3
votes
2answers
509 views

Signed Distance Fields: How are different colour channels used to improve output of sharp corners?

The naive approach to implementing signed distance field font rendering suffers quality issues where sharp corners get softened (either outward- or inward-facing corners, i.e. convex or concave ...
1
vote
1answer
285 views

Trying to implement Camera

I'm trying to implement a Camera class in order to walk and look on the world as follow: #ifndef _CAMERA_H_ #define _CAMERA_H_ #include <glm\glm.hpp> class Camera { public: Camera(); ...
0
votes
1answer
66 views

CPU and RAM usage in OpenGL too high in Swift

My game is set up so the the display controls the game loop, usual in Cocoa. The callback function calls run() which is this. The thing is, the thread running the callback is using 63% CPU and the RAM ...
0
votes
1answer
90 views

Should I always prefer a Uniform Buffer Object to a uniform variable for per-model uniforms in OpenGL?

I was looking for a way to update uniforms for all of my scene objects efficiently and I came across the following gamedev stackexchange question, where the top answer gives a bonus tip. It states: ...
0
votes
0answers
50 views

World texturing techniques in FPS game

Texturing for small objects (pickups and enimies) can easily be done UV-unwrapping the model, and use a texture of reasonable size to make the model look good. But how can texturing be done for the ...
4
votes
1answer
467 views

Using textureGrad for anisotropic integration approximation

I'm trying to develop a real time rendering method using real time acquired envmap (cubemap) for lightning. This implies that my envmap can change as often as every frame and I therefore cannot use ...
-1
votes
2answers
56 views

What does a perspective projection matrix look like in OpenGL?

I've been trying to construct a perspective projection matrix myself and finding it extremely difficult. I realize that a perspective projection matrix is by default a frustum in OpenGL 3.3+ that is ...
1
vote
2answers
123 views

Cumulative transformation matrices for hierarchical object transformations

I'm having a small issue with my design for hierarchical 3D objects. I'll try to sum things up concisely. Every object has a vector3 for its position, scale, and rotation, as well as a std::vector of ...
0
votes
2answers
40 views

OpenGL perspective matrix far plane

The near plane clips at exactly the value I set just fine but instead of clipping at 1000 the far plane clips at 1. Here is the code for the projection matrix: public static Matrix4f ...
2
votes
1answer
168 views

Instanced rendering with ARB_vertex_attrib_binding

I'm trying to separate the vertex format specification from the vertex data. I was able to do that for the mesh vertices successfully. For instanced rendering I wanted to further separate the instance ...
0
votes
2answers
212 views

Fragment shader compiling in webGL but not in OpenGL

I am programming in Haxe (language compiling to multiple platforms) and I have written some shaders. My fragment shader runs fine in html5, but when I try to compile for native (OS X and/or Neko, a ...
0
votes
1answer
48 views

How do animation works with mesh?

I'm currently developing a game using OpenGL and my dev has run into a small problem. I'm having some problems understanding how "array of vectices works with animated object". For example, if we have ...
0
votes
2answers
29 views

glUniformMatrix4fv - INVALID OPERATION?

I'm attempting to manually setup a matrix in my vertex shader purely because I like to learn as much as possible about anything I do usually. So the problem is that I'm getting an ...
0
votes
1answer
33 views

Making a GUI shader in GLSL c++/opengl/freeglut

How do you make a shader that will draw ontop of everything else? Im using an approach where I draw square faces in 3d space to simulate a 2d box, but when I make a 3d object, it will clip over the 2d ...
-2
votes
0answers
21 views

Help with first person camera | Java OpenGL [closed]

Hey i cant seem to find out how to make a first person camera Could anyone suggest wasy to make it and/or suggest codes
1
vote
1answer
77 views

OpenGL App not setting cursor position appropriately

I have written a small application using OpenGL, and have implemented some rudimentary camera controls. Unfortunately, I cannot get the application to set my cursor position correctly. The cursor is ...
0
votes
0answers
6 views

Qt 5 - QOpenGLWidget not updating the screen

I'm creating a level editor for my game using Qt for gui and i'm in really early stages. Right now i'm trying to dynamically add objects ( entities ) on screen when i click a button. So far the ...
1
vote
0answers
21 views

Applying different materials to an object

I'm currently implementing an Object Loader for the Wavefront File Format (*.obj). When exporting a model (with associated materials) from blender, a material for a group of faces is specified like ...
3
votes
2answers
106 views

How to hide a post-processed mesh outline when/where the mesh is hidden

I'm working on setting up an active outline in my 3d engine, a highlight effect for selected 3d characters or scenery in the screen. After working with the stencil buffer and getting some ...
0
votes
1answer
329 views

GL_SPOT_CUTOFF not working properly

I'm new to OpenGL. I'm studying OpenGL 2.1 and I'm trying to make a little program to test the GL_SPOT_CUTOFF property, but when I set a value between 0.0-90.0, the light doesn't work and everything ...
0
votes
1answer
67 views

How do i make floors of varying height in OpenGL?

So I am currently working on a small Game(/engine) in OpenGL and I want to build a little world editor. Nothing too fancy: Just some functions to add objects to a scene and manipulate them (rotation, ...
0
votes
1answer
118 views

OpenGL: How to map point inside frustrum to normal device coordinates (NDC)?

I read this article http://www.songho.ca/opengl/gl_projectionmatrix.html. It's explain how calculate projection matrix coefficients. But I completely can't understand how author perform mapping from ...
0
votes
1answer
27 views

Drawn frustum does not match with glm::perspective

I am working on a personal project and I got a 3d viewport with moving camera working nicely. Now I am working on being able to freeze the time and switch to a debug camera and move in the game ...
2
votes
1answer
101 views

What is the best way to interpolate vertex data in OpenGL?

I am working on a game which has a board of falling down blocks, similar to Tetris. Each block is represented with for vertices and two triangles, each vertex consisting out of its location and ...
2
votes
1answer
2k views

Opengl-es picking object

I saw a lot of picking code opengl-es, but nothing worked. Can someone give me what am I missing? My code is (from tutorials/forums) Vec3 far = Camera.getPosition(); Vec3 near = ...
5
votes
1answer
422 views

OpenGL Fast-Object Instancing Error

I have some code that loops through a set of objects and renders instances of those objects. The list of objects that needs to be rendered is stored as a std::map>, where an object of class ...
0
votes
1answer
40 views

When do I need to call `glUseProgram`?

Looking at examples at http://learnopengl.com/#!Getting-started/Hello-Triangle and many different places, I've found that the draw sequence usually goes like this: // setup VBO, VAO, load shaders ...
0
votes
1answer
43 views

OpenGL is box blur this slow?

I've never tried blur until recently, and by that i've noticed fps drop when doing box blur. My fps will go down from 4000-5000 fps to 1000-1500 fps. Currently rendering at 853x480 frame buffer and ...
0
votes
1answer
49 views

Create a crosshair openGL

How do I draw a white crosshair in the middle of screen in openGL, it's all well and good knowing how to render objects in 3d space, but I have literally no idea on how to draw something that sticks ...
1
vote
1answer
52 views

Creating a DPI and Resolution Independant GUI

How would one best go about it? Assuming I'm using OpenGL to do all the drawing. It seems like the best approach is to have the GUI elements maintain the same physical size regardless of the screen ...
0
votes
1answer
173 views

How to calculate spherical harmonic coefficients for indirect diffuse?

After reading the article "An Efficient Representation for Irradiance Environment Maps", I'm a bit confused as how to calculate the spherical harmonic coefficients. I'd like to generate these ...