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

How to draw the simplest grid map OpenGL 1.0

I want to draw a simple black & white grid map, like that: I have been searching for a way to generate tile, a tile map and tho and I want to draw this map and thats all. I mean that I want to ...
3
votes
0answers
37 views

What are the advantages of tangent space shading/lighting, and what about attenuation?

In several topics here it was suggested by people that doing lighting in tangent space is better than doing it in world space. Right now I am doing it in camera space, but it's really similar to world ...
0
votes
1answer
14 views

Loading Indices Collada File

I have been writing a COLLADA loader in c++ and I have run into a problem loading the indices for the mesh vertices whenever I try and find what indices correspond to the vertices and I try and draw ...
0
votes
0answers
24 views

OpenGL using VBO to draw a tile map [on hold]

So I read about VBO and I want to draw a tilemap with that. How do I put something in a VBO?
0
votes
0answers
25 views

Why are my OpenGL textures warped?

I am writing a graphical program using OpenGL for rendering, Assimp for mesh loading and SDL for window etc, but also image loading. As can be seen in the image, the white outlines at the left of ...
0
votes
0answers
83 views

Is transparency a performance drain? [on hold]

I use a lot of transparency in my games, and I'm wondering if that is a performance drain. It's worth noting that I use MonoGame to make games. I'm on a Mac so I use OpenGL instead of DirectX.
0
votes
0answers
7 views

How to clip or mask entity in adnroid/andengine?

I want to implement masking with sprite in andengine. I want same functionality as in ios class called SKCropNode which works like an masking node! Is there any workaround like this in ...
0
votes
0answers
59 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 ...
0
votes
0answers
28 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
36 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
54 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 ...
0
votes
1answer
37 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
0answers
36 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
17 views

OpenGL 2D tiles map [closed]

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 [closed]

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
vote
1answer
72 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
votes
0answers
26 views

PyOpenGL problem [closed]

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
vote
2answers
43 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
37 views

How to make an OpenGL wrapper [closed]

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 ...
2
votes
1answer
143 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
0answers
22 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 ...
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 ...
1
vote
1answer
77 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 ...
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
47 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
1answer
86 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, ...
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 - ...
0
votes
1answer
40 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
2answers
42 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
163 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 ...
0
votes
1answer
32 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 ...
1
vote
1answer
51 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 ...
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
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); ...
-1
votes
2answers
88 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); ...
0
votes
1answer
73 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
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 ...
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, ...
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?
-2
votes
1answer
55 views

What does render in SDL2? [closed]

Good afternoon! What does render in SDL2? Is it possible to display text with a SDL2_ttf library without using a render, but only the standard OpenGL context?
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++){ ...
2
votes
2answers
50 views

What is buffer “target” in OpenGL?

What is a target in OpenGL, actually? For example, in the function void glBindBuffer​(enum target, uint bufferName) I know what the function does (more or less), but the target was only a ...
2
votes
1answer
69 views

What are the implications of using multiple OpenGL Contexts on a single thread?

I'm trying to integrate two third-party OpenGL rendering pipelines into the same application, namely Cinder's OpenGL API for 3D drawing and backbuffer rendering, and Google Skia's API for 2D drawing. ...
1
vote
1answer
80 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 ...
1
vote
3answers
76 views

Rendering many similar objects [closed]

I am writing an city builder. The graphics should look pretty simple, there are no fancy models or textures. Something like Synekism. Thus I have only simple models for buildings and splines for ...
0
votes
1answer
108 views

Is there a way to start with OpenGL 3.0+ without need to write my own shaders?

I'm starting with OpenGL and found out that after OpenGL 3.x you must write your own shaders (think it's obligatory). Am I right here? I have made some research but I can't seem to find the answer. ...
-1
votes
0answers
71 views

OBJ Loader Incorrectly loads textures

I have this OBJ loader function that I have created within my Object class that loads in an *.obj file and when the object is rendered onto the screen the textures seem to be loaded incorrectly I ...
2
votes
2answers
50 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 ...
1
vote
1answer
65 views

What is the fastest way of reading an atomic counter?

I have an atomic counter in my fragment shader that my application reads after each drawcall. I am currently using glMapBufferRange with GL_MAP_READ_BIT set. This absolutely destroys my applications ...