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

Game written using C++, OpenGL 4.4 on SDL doesn't drop frame rate but runs in slow motion [on hold]

Our game written with C++ on SDL using OpenGL4.4 has a fantastically weird bug. When the game is run for enough time, things begin updating in slow motion. The framerate is still 100fps - 90fps, but ...
4
votes
3answers
244 views

Extract smaller frustum from camera frustum?

Background: I was thinking of implementing multiselection by performing a frustum culling on a sub-part of the screen. Problem: Given total screensize, a rectangle on the screen (pos, size), and ...
0
votes
0answers
27 views

How much is atomicAdd slower than an atomic counter?

I am considering replacing an atomic counter in my shader code with a SSBO an atomicAdd operation. What I need to know is the difference in performance of these two. I know the atomic counter executes ...
0
votes
0answers
33 views

Good system for experimenting with shaders in different languages

I'm trying to experiment a bit with shaders and they have been programmed in several different languages (GLSL, Cg and HLSL). Now most systems (dirrectX, openGL) have only support for one of them. ...
0
votes
1answer
45 views

Confused with how I should organize my code in a 2D game using OpenGL [on hold]

I've just now started learning OpenGL and I'm getting very overwhelmed and confused with some things. I don't want to permaturely optimize things, but I also don't make decisions about things I still ...
1
vote
1answer
79 views

OpenGL Positional 2D Texture Masking

I have a simple 2D java game engine running using LWJGL. I have my own vertex and fragment shaders, and I'm able to render quads with textures. I want to be able to mask one quad using the texture ...
0
votes
1answer
75 views

SDL & OpenGL - Artifacts when multisampling

Im trying to render a model with anialiasing using OpenGL and SDL, but when I do I get strange artifacts. When I render with antialiasing disabled everything looks fine. When antialiasing is ...
0
votes
1answer
34 views

Rotate a plane defined by its normal and its distance

First apologies for the amount of pictures, it's a bit hard trying to explain my problem without pictures. Hope I've provided all the relevant code. If you feel you want to know about how I am doing ...
0
votes
3answers
118 views

In OpenGL what's quicker, lots of smaller VAOs, or one large one updated each frame?

In my game engine, a mesh can be made of many submeshes. These submeshes may or may not share vertex data with the rest of the mesh, if they don't they have their own vertex data array. I've noticed ...
0
votes
0answers
35 views

opengl shaders getting started problem

I'm following this tutorial for shading in opengl. However I wanted to start with another shader to make things more interesting So this gives me the following code: // Include standard headers ...
-1
votes
0answers
15 views

OpenGL 2D tiles map [on hold]

So I am new in OpenGL and in Android games. I have been searching for a tutorial for using 2D maps that I can draw objects on it. I want a 3D object what will move on this map. I have a 3D object. Can ...
-1
votes
0answers
13 views

GLUT not taking key input [duplicate]

I'm pretty sure I'm using input correctly, I even copied source code to test it, but nothing will happen. I use this code and def keyPressed(*args): if args[0] == 'w': print("bruh") ...
-1
votes
0answers
13 views

PyOpenGL + GLUT input not working [on hold]

I'm pretty sure I'm using input correctly, I even copied source code to test it, but nothing will happen. I use this code and def keyPressed(*args): if args[0] == 'w': print("bruh") ...
3
votes
1answer
239 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 ...
50
votes
9answers
50k 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 ...
1
vote
1answer
68 views

How to draw a mini map OpenGL & OpenGL ES?

I'm trying to draw a mini map. Succeeded to put current screen to smaller screen (mini map) via FBO. But I do not know how to make the mini screen brighter when hover. You can imagine that, the real ...
1
vote
2answers
41 views

glsl uniform int as index of const array

I have a const array that define a few materials for directionnal light. I'd like to change the material using an uniform int as index of that array. Doing that leads to severe framerate drop. I know ...
-1
votes
0answers
24 views

PyOpenGL problem [on hold]

I'm using PyOpenGL on windows 8.1 64bit with Python 3.4. I got the win32 installer and all, but when I run basic OpenGL code I get this eception. OpenGL.error.NullFunctionError: Attempt to call an ...
-1
votes
0answers
37 views

How to make an OpenGL wrapper [on hold]

I noticed there was a lack on tutorials explaining how OpenGL is called in OpenGL bindings such as LWJGL or go-gl. I saw thex had things like 00xb100 in lists. How do I create my own OpenGL binding ...
0
votes
3answers
311 views

Calculating Projectile Movement

I'm having some trouble putting together a method that will constantly move a "bullet" in the same direction accurately. Here is what I have so far public Vector3f moveFromPosition(Vector3f location, ...
1
vote
2answers
170 views

Application of classes with critical non-static fields in LWJGL

I'm going to be as specific about this question as I can. Ultimately, how is it that I apply a class that uses non-static fields in LWJGL? More specifically, I know that OpenGL is quite nearly more a ...
1
vote
1answer
52 views

Can drawing to an FBO be done purely with a depth input texture, or do I also need a color attachment?

I am trying to implement Exponential Shadow Maps and I've got it almost working. The part I am stuck on is the "optional" separable Gaussian blur of the depth map to give soft-looking shadows. I am ...
3
votes
1answer
84 views

Texture loading: Everything at once OR un-/loading the needed assets? [duplicate]

Good evening. We've been developing quite a huge game for android on the basis of AndEngine. So we have a lot of assets to load, especially textures. At the moment everything (sound, textures etc) ...
0
votes
0answers
20 views

Collada Animation leads to distorted model

In collada the skinning equation is : v += {[(v * BSM) * IBMi * JMi] * JW} I'd like to clear something. 1) BSM = bind shape matrix , located in the tag "bind_shape_matrix"? 2) IBMi = inverse bind ...
2
votes
1answer
138 views

What version of OpenGL should I target for Steam?

I'm planning on developing a game (targeting towards PC and Linux) and putting it up on Steam in the future but I am not sure of what version of OpenGL to target so that the majority of steam users ...
0
votes
1answer
22 views

How can I render a simple lattice in LibGDX?

I have searched all over, but I can't find what I think will be a simple answer. I am using Opengl ES 2.0, and LibGDX. I simply want to use GL_LINES primitives to create a lattice structure. I have ...
0
votes
1answer
26 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 ...
3
votes
1answer
238 views

How do I use unpackHalf2x16?

I'm trying to use (un)packHalf2x16, without success so far. I'm drawing with: glVertexAttribIPointer(0, 2, GL_UNSIGNED_INT, 0, 0); glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, vbo); ...
0
votes
0answers
27 views

OpenGL Rendering Problem Windows vs OS X - Texture Glitch [closed]

I am working on a project and like to work on both a Macbook and a Windows PC. My code works fine across the two platforms with all of the same libraries with no problems. I'm coding in C++ and using ...
0
votes
1answer
158 views

OpenGL memory optimization and batching technique pitfalls

I'm studying OpenGL optimization techniques. What I'd like to achieve is to emulate as closely as possible Mantle/DirectX12 programming patterns (aggressive batching, flexible memory handling, complex ...
2
votes
1answer
71 views

Is there a way to manipulate a pixel Array on the GPU?

I'm currently working on a 2D-Game and i want to draw and calculate the whole screen myself through a pixel array. I'm programming in C++, using SDL 2 and OpenGL specifically a OpenGL Texture which is ...
0
votes
2answers
46 views

node-webkit and OpenGL 4

Is there any way to get OpenGL 4 to work within a node-webkit app? It would have to be OpenGL 4 and since it's running on a desktop app I would think there must be a way to get it to work. I can't ...
0
votes
2answers
41 views

Passing array to uniform in glsl error

Here is my attemps to pass array to uniform array: struct Vector{ float x,y,z; } float threshold[2] = { 0.5, 0.25 }; Vector *kernel = new Vector[_kernel_size]; // _kernel_size==16 // fill kernel ...
0
votes
1answer
84 views

FBO and VBO for performance

I discovered VBO's recently and changed my code to use them instead of immediate mode. Now I'm rendering 25000 squares and it's really slowing down my FPS. If I drew all the squares VBO's to an FBO, ...
-1
votes
0answers
33 views

OpenGL - Problem rendering multiple meshes [closed]

I'm building a graphics engine that loads models using Assimp. I can load and render single meshes just fine but when i try to load a .obj model with multiple meshes i can't render the whole model. ...
2
votes
0answers
81 views

Understanding normal mapping

I am trying to understand the basics of normal mapping using this tutorial : http://ogldev.atspace.co.uk/www/tutorial26/tutorial26.html What I don't get there is the following equation : E1 = ( U1 - ...
1
vote
1answer
94 views

Problems with texture orientation in space

I am currently drawing texture in 3D space and have some problems with it's orientation. I'd like me textures always to be oriented with front face to user. My desirable result looks like ...
0
votes
1answer
39 views

Get fragment from mouse position

I have a painting app for texture artists that I am working on. I am able to paint to a flat canvas that updates the texture of a 3d object in an object viewer. Now I want to be able to paint directly ...
0
votes
1answer
30 views

Rotate heading relative to agent's local space

I'm having a little trouble translating a point in my game's world space to an object's local space. I have a cannon in my game with a normalized heading vector that's always supposed to point in the ...
2
votes
1answer
63 views

OBJ file, face materials and drawing them with OpenGL

I'm implementing a model class which loads OBJ and MTL files, and ran into an issue or question with face materials. Consider the following example: It's a cube with 5 sides Gray and 1 side Green. ...
-1
votes
2answers
86 views

How can I optimize these GLSL bitwise operations?

I need the following part of my vertex shader simplified. Sb=Sb|((gl_VertexID&(128+1))<<9); Sb=Sb|((gl_VertexID&(512+4))<<6); Sb=Sb|((gl_VertexID&(2048+16))<<3); ...
1
vote
1answer
50 views

OpenGL Post Processing Introducing Artifacts on Certain Systems

Playing around with God-Rays in my framework, I was greeted with the following artifacts on my laptop: The artifacts themselves act almost like noise, flickering around the image rapidly. They also ...
0
votes
2answers
36 views

How do I change a shape without affecting the rest of the screen?

I have drawn a shape like this in OpenGL: glColor4f(red,green,blue); glBegin(GL_QUADS); glVertex2f(x1,y1); glVertex2f(x2,y2); glVertex2f(x3,y3); ...
0
votes
1answer
72 views

How can this kind of entity/component organization improve cache efficiency?

I've been reading up about entity component systems as a design pattern for an OpenGL engine. The style I'm trying to implement has entities only being integers, and components being long contiguous ...
0
votes
1answer
51 views

SFML - How do I create an OpenGL context before showing the window?

I want to create an OpenGL context to initialize some assets before actually showing the window with SFML. How can I do this?
0
votes
2answers
44 views

Rotating an object with quaternion

I have a question in regards to using quaternions for the rotation of my graphics object. I have a Transform class which has the following constructor with default parameters: Transform(const ...
2
votes
2answers
49 views

Translating an object in the rotation direction

I am creating a graphical scene with OpenGL and SDL, and I'm running into a problem in regards to translating an object in its rotation direction. Each of the graphical objects in the scene has a ...
0
votes
1answer
36 views

First Person Camera Target

I have a camera at position P, and a normalized direction vector D (where the camera is facing). I want the target of the camera to be 5 units forward from the position. Here's my attempt: F = (0, 0, ...
30
votes
5answers
11k 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 background but terrible on brighter colours, ...
0
votes
2answers
75 views

OpenGl indices array

I have a class terrain which create a grid of Quads. I do it like this for(int z=0; z<_length;z++){ for(int x=0; x<_width;x++){ ...