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

Using normal maps in irrlicht lime with Direct3D9

I am using Irrlicht Lime, a .NET wrapper for the Irrlicht Engine. In my scene I render some simple geometries, that I construct "by hand". These are textured and shoud get a better look through normal ...
0
votes
0answers
12 views

Is it possible to loop over an array of samplerCube/samplerCubeShadow using OpenGL/GLSL?

I try to manage a scene with several point lights. For the moment my program works perfectly with just one point light. So I have in my fragment shader the following uniform declaration: uniform ...
0
votes
1answer
67 views

OpenGL segfault in DrawElements

I've asked this question on regular StackOverflow but without much success yet. The below program produces a segfault on the call to glDrawElements. I've looked at my max and min index values and they ...
1
vote
2answers
72 views

How do I ensure my skybox is always in the background, with OpenGL?

I created a skybox in OpenGL (through LWJGL), but the only way I found to render it behind all objects was to make it very big. This leads to ugly edges between the 6 skybox planes. Optimally, I ...
0
votes
1answer
55 views

New to OpenGL , having trouble understanding matrix transformation

I have modest experience of developing games with sdl , libgdx , unity etc. But never got into learning any low level API. So I thought about learning OpenGL and got started with tutorials provided by ...
1
vote
1answer
137 views

OpenGL (ES 2.0) Function Dependencies

In OpenGL (ES 2.0), there are many functions that can be called in any order, and still others that must be called after other functions had been called and not before. For example, attaching a shader ...
1
vote
1answer
84 views

Architecture to draw many different objects in OpenGL

I have some objects that I want to draw. I am not sure how I can create my architecture in a way where I can draw everything as fast as possible. As example: class MyObject { float[] vertices; ...
0
votes
0answers
17 views

How to get the exact vector location of a loaded model in jMonkey engine

I am new to game developing and using the jMonkey engine. I started to develop an endless running type game. To run, I have created a map with blender and imported it to jME. As the shows, I have ...
2
votes
0answers
40 views

Text rendering overlap

I'm trying to display text with a texture and font description created with BMFont in OpenGL 3.3, but whenever I display the text there is some overlap between certain characters. Here is the text at ...
-1
votes
0answers
24 views

changing the color of gl_quads inside loop

I am trying to make a chess board with black and with quads , it should display black and whiote alternate quards but its not doing that for some reason here is my code #include <glut.h> void ...
1
vote
1answer
55 views

Tons of textures using vbo

I recently learned how to create shaders and was looking to make a simple top down game, starting with a tilemap. The problem I encountered, Whilke I can store a vbo of all the blocks in a "chunk" of ...
0
votes
2answers
59 views

How would I start my multiplayer game? (JAVA) [closed]

I'm Bryce. I'm trying to create an online game. To give you an idea on what scale I am imagining this game to be at, I'm basically recreating Notch's cancelled game, 0x10c. I'm here to ask: where ...
1
vote
1answer
102 views

How do I add a border to rectangles using a shader?

I want to draw some rectangles with a border. Currently I render the fill with glDrawArrays(Triangles, ...) and the border with glDrawArrays(LineLoop, ...). Is there a neater way? I'm targeting ...
1
vote
1answer
55 views

Correct multiplication order for a 2D Matrix

I'm currently trying to create a camera and entity/model matrix for my 2D game similar to that of Unity3D. I've already tried to find answers to this question on stackoverflow/gamedev but i couldn't ...
3
votes
2answers
95 views

Rendering Many Objects in OpenGL4

Sorry for asking such a basic question. I am reading books on OpenGL4 but in most examples they generally render only objects. So I understand how to deal with vertex buffers and vertex array buffers, ...
3
votes
0answers
68 views

Why does accessing a uniform float make my shader more than twice as slow?

My fragment shader was significantly slowed down by a recent change, and I've been trying to understand why. I isolated the main slow-down to accessing a single particular uniform float. If I include ...
0
votes
1answer
84 views

3D position of an arbitrary UV coordinate

I have a UV map for a 3D mesh that encodes "links" between pairs of UV coordinates. I have previously defined this links (or pairs), one to one. The links are enconded using the function rgb_color(u1, ...
2
votes
1answer
26 views

Swapping Framebuffers or swapping attachments?

I wanted to know what the better approach would be for post-processing: swapping between framebuffers or swapping between textures attached to one framebuffer?
2
votes
2answers
53 views

How to smooth mask texture edges correctly regardless it's size

I have a texture intended as a mask. The texture type is GL_R32F (32 bit float) and the data inside is a signed distance field (= value of each texel is distance to nearest mask edge). For test ...
1
vote
1answer
62 views

OpenGL ES draw pre-rendered background onto depth buffer

I want to create a scene with 2D pre-rendered background and 3D models for characters (like those classic Final fantasy games). For the background, I have 2 textures: one to be displayed, with ...
1
vote
0answers
14 views

Android OpenGLES, getting number of fragments passed depth test/Occlusion Query?

Afeter reading many blogs and searching on Internet, I did not get any sloution for getting number of fragments/pixels which are occludded or not occludded of the object on OpenGL ES3.0 Android ...
0
votes
1answer
42 views

Applying transformations in Geometry Shader

So, I am trying to program in opengl (3.3) a kind of robot. The idea is that I have some simple blocks that represent his body (4 rectangles for his arms, one for the torso and the last one ...
3
votes
1answer
71 views

OpenGL - Drawing multiple meshes at once using VBOs and IBOs

I have been learning OpenGL 2.1 but using shaders, VBOs, IBOs, etc. I have gotten a rendering engine that can load and draw meshes, materials, forward lighting (no shadows yet), SceneNodes, and ...
1
vote
0answers
75 views

OpenGL - Texture disappears

I'm making a simple program with C++, SDL and GLEW. So far it is going great but I ran into a weird problem. One of my four textures would not show up on screen even though it used the same code as ...
1
vote
1answer
50 views

Selection with region (when rendering with shaders and VAO)

I am currently render my geometry using "Modern OpenGL" approach (with shaders and buffers). I have already implemented picking of single primitives using glReadPixels. Now I am faced with problem how ...
1
vote
1answer
70 views

Draw selected instances of VAO (glDrawArraysInstanced)

I'm using glDrawArraysInstanced to draw multiple instances of a tree at different positions to generate a forest. Is there a way to draw selected instances? For example: I got 100 trees with ...
3
votes
1answer
97 views

glm direction vector rotation

I'm working on a flight simulator, but I'm stuck with my airplane orientation. I tried some things but noone worked correctly. This is what I have : To be able to move it and roll it around himself, ...
0
votes
0answers
26 views

High-Performance Concurrent Model-View Rendering Architecture [migrated]

I have a single-threaded file indexing/scanning engine in D I want to extend with a view thread that visualizes the scanned content as a tree (or later force-directed graph). I want this solution to ...
2
votes
1answer
52 views

How to know when graphics driver or card changes

I'm about to start work on implementing GLSL binary shader compilation and I was curious how to handle the cases when the shaders need to be recompiled, such as when the driver (or perhaps even the ...
0
votes
1answer
84 views

Blurring part of the screen - optimisation

I develop 3d menu and sometimes I need to blur only part of the screen. I use a forward rendering. I create a frame buffer object with 3 color attachments. Rendering looks like this: bind fbo ...
1
vote
1answer
30 views

Only affect pixels in buffer with alpha 0

I'm working on a transition effect where I have a texture and simply draw that as a pattern to my buffer. Here is a demo, use "e" to start the effect again. This looks fine but it won't work if the ...
0
votes
2answers
81 views

What does glMultiDraw* do?

I'm having trouble understanding exactly what glMultiDraw* does, and when it should be used. Is it to be used if I have one VBO with multiple objects in it or do I use it with many VBO's? It would ...
0
votes
0answers
47 views

Fixing/avoiding Z-fighting with decals OpenGL

I'm trying to draw animated flames as a decal in OpenGL (just a simple quad with an animated texture as a decal on another quad). Problem is as the camera moves away I get terrible Z-fighting in the ...
1
vote
1answer
67 views

OpenGL Compute Shader Uniforms

I am trying to use a compute shader to generate some data in a texture. My compute shader looks something like this: #version 430 //uniform int u_CurrentMipSize; const int u_CurrentMipSize = ...
2
votes
0answers
26 views

problem loading Collada DAE model using Assimp in OepnGL 4.4

I am loading a model in my OpenGL application using Assimp library like this : bool CGameObject::LoadModelFromFile(char* sZFilePath) { std::string fn = sZFilePath; std::string td = "\\"; std::string ...
7
votes
2answers
835 views

How many OpenGL programs should I use to render multiple objects?

My scene has multiple objects in it. (Let's say 3 cubes, 1 cylinder, 8 spheres.) I assume I should create a vertex shader for each. How many programs should I have? Alternatives: One program per ...
1
vote
0answers
92 views

Is it reasonable to use a 2D texture as a lookup table in GLSL

I need a lookup table in a shader. The input values would be color values and the output other color values. Something like: uniform float lut[256]; color = vec3(lut[int(color.r*255.)], ...
5
votes
1answer
142 views

“Normal” Blend Mode with OpenGL Trouble

I've been having a lot of trouble trying to get a OpenGL blend function to work as I'd expect it to with like what I'd expect (or from any sensible image editing program). As an example, I'll use ...
1
vote
1answer
57 views

Lookup table in shader opengl es

What I need is apparently very simple, a lookup table in a fragment shader. It seems that the natural way would be an array float lut[], but in some implementations of OpenGL ES I am getting an error ...
2
votes
0answers
21 views

Render on texture with alpha 0 for the background colour

Sorry if the question is stupid but I am very new to opengl. I render on a target a scene with a couple of object on a background that is nothing more than the clear colour (which is ...
7
votes
2answers
176 views

How to avoid subpixel values in a resolution independent 2D game with orthographic projection?

I'm trying to do resolution independent rendering of moving sprites in a 2D game. My plan is work in a fixed coordinate system in my world (for example 960x540) and use orthographic projection to ...
1
vote
1answer
49 views

Using depth texture for depth testing

I was wondering if it is possible to render my scene onto a depth texture then using that texture for depth testing in another pass. I have an idea to that in shaders, but is that possible ...
0
votes
0answers
64 views

Gaussian blur not working correctly

So pretty much I tried to add a gaussian blur to something I am making and it is acting oddly. The setup is like: [All framebuffers are cleared to rgba(0,0,0,0), normal blend enabled] Draw some solid ...
1
vote
1answer
71 views

Vertex shader in OpenGL/GLSL - transformation of the interior of a textured quad

I have a LWJGL project and ran into a problem with a vertex shader I wrote. In my scene I am rendering a map whose ground consists of rectangular tiles. On top of that there are other objects (I used ...
2
votes
1answer
155 views

Anti-Aliasing in OpenGL [C++]

I'm trying to make anti-aliasing work inside of OpenGL, here's what I've tried: glEnable(GL_POINT_SMOOTH); glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); glEnable(GL_LINE_SMOOTH); ...
0
votes
1answer
58 views

Proper way to encapsulate a Shader into different modules

I am planning to build a Shader system which can be accessed through different components/modules in C++. Each component has its own functionality like transform-relevated stuff (handle the MVP ...
0
votes
0answers
20 views

OpenGL textures trigger error 1281 if SFML is not called

I am using SOIL to apply textures to VBOs, without textures i could change the background and display black (default color) vbos easily, but now with textures, openGL is giving an error 1281, the ...
1
vote
1answer
50 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
2answers
59 views

Best way to detect if vec3 is between vec3(x) and vec3(y) in glsl

As titled I am sampling from a texture and if the color is somehow gray [vec3(.8), vec3(.9)] and an uniform is 1 I need to substitute that color with another one I am not a glsl veteran but I am ...
1
vote
0answers
70 views

OpenGL - Cascaded shadow mapping - Texture lookup

I'm trying to implement cascaded shadow mapping in my engine, but I'm somewhat stuck at the last step. For testing purposes I've made sure all cascades encompass my entire scene. The result is ...