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

-2
votes
1answer
50 views

Collision Detection in OpenGL

For a 3D Game using OpenGL i have to implement a simple collision detection. After thinking about that, i have had the idea to read out the glm::mat4 MVP values and compare them to each other. Is that ...
0
votes
1answer
38 views

How to use a buffer in GLSL to do a LUT-lookup?

I am currently on a medical application which needs different kinds (up to totally individual) lookup tables (LUT) for image display. And this done with 10bit finish. So it is most of the time ...
0
votes
0answers
35 views

Pre- or post-multiplication for rotation between coordinate frames

I have three 3D coordinate frames: O, A and B, as shown below. I want to know the rotation matrix RAB between A and B, that is the rotation that is required, with respect to the frame A, to move ...
0
votes
0answers
12 views

converting HSLS gives error

I'm using the following parser: https://github.com/unknownworlds/hlslparser I also have the following code: /* * Bo Sun, Columbia University, All rights reserved * ...
0
votes
0answers
22 views

Rotating between two coordinate frames

I have two coordinate frames, A and B. I want to create the rotation matrix RAB which takes you from A to B. A is a right-handed system, and B is a left-handed system. Furthermore, after moving from a ...
35
votes
2answers
3k views

What is Vulkan and how does it differ from OpenGL?

Khronos Group (the standards body behind OpenGL) has just announced Vulkan: Vulkan is the new generation, open standard API for high-efficiency access to graphics and compute on modern GPUs. This ...
1
vote
1answer
46 views

Calling Shader Functions Inside Other Shaders

I'm new to OpenGL and GLSL, and bit confused about calling conventions of shader functions. I'm trying to implement various procedural noise algorithms in GLSL. I'd like to have separate files for ...
0
votes
0answers
8 views

Slick2D crashes on Image.getGraphics() on some machines

On some machines, creating a new Image and calling getGraphics() on it causes lwjgl to enter into some kind of faulty state that crashes when swapping buffers. Any idea what causes this and how to ...
0
votes
0answers
40 views

OpenGL messy lighting on sphere

I made a set of objects that are animated and move around the screen. The animation looks fine, but I'm having issues with the material settings. The lighting on the sphere looks very bizarre. A ...
1
vote
1answer
55 views

How do I get GLEW to use my Nvidia GPU instead of an integrated Intel card?

I'm new to graphics programming, though not to coding generally. I've been learning opengl from the OpenGL Superbible, 6th Edition. I was trying out the shader examples from the book but couldn't get ...
0
votes
1answer
40 views

How to draw the simplest grid map OpenGL 1.0 [on hold]

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
1answer
69 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
15 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
30 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
85 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
18 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
69 views

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

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
30 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
38 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
58 views

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

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
19 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
vote
1answer
76 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
46 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 ...
2
votes
1answer
150 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
24 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
24 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
79 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
51 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
88 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
82 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
41 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
44 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
169 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
54 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
86 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
81 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
46 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?
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
70 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. ...