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
62 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
23 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
29 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 ...
49
votes
2answers
7k 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
69 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
1answer
36 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 ...
1
vote
1answer
158 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
121 views

How to draw the simplest grid map OpenGL 1.0 [closed]

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
169 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
0answers
56 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
61 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 ...
1
vote
0answers
67 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
44 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
77 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
72 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
67 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
vote
1answer
147 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
98 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
177 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
38 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
43 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
134 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
117 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 ...
1
vote
1answer
108 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, ...
3
votes
1answer
119 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
68 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 ...
1
vote
3answers
139 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
203 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
44 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
69 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
98 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
39 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
126 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
241 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
100 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
41 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
65 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
112 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
58 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
125 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
137 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
89 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
116 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. ...
2
votes
2answers
112 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
84 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 ...
1
vote
1answer
74 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 ...
1
vote
0answers
62 views

OpenGL: Avoid geometry shader for cubemap framebuffer

I want to render an environment map into a cubemap framebuffer but I dislike the fact, that I have to use the geometry shader to set gl_Layer because the geometry shader would be a basic passthrough ...
3
votes
1answer
169 views

glBufferData consuming system memory

I am memory profiling my game in Visual Studio and about 60% of memory usage is happening from calls to glBufferData(). I may be missing something but should this consume GPU memory instead of system ...
2
votes
1answer
125 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
1answer
118 views

Do I necessarily need to write a vertex shader to use geometry instancing?

I've quickly read the GPU gem about geometry instancing, there are many wordings and I'm not sure I understand it well. If I understand it well, when you use instancing, if you want to apply ...