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

Failed to understand how to use glm::unProject (OpenGL 4.3)

Situation: I use OpenGL 4.3, FreeGLUT 3.0, and GLM library. Let say i have a simple 2D object (a ball) and it moves accordingly to the simple equations: x = x_0 + v_0 * t * cosf(alpha); y = y_0 + ...
0
votes
1answer
69 views

Image rendering with additional space around it

When I try to display an image that is 400 pixels wide and 800 pixels high, it is not displayed this way. Instead it is diplayed like this: Instead it is displayed like this You can see at the bottom ...
0
votes
0answers
69 views

How to dynamically draw a filled polygon with a given array of vertices?

Say I have a simple array of vertices (or floats with every odd index being the X of a vertex and every even being the Y), how could I paint all the area between the vertices? As in, I have maybe ...
1
vote
1answer
77 views

OpenGL App not setting cursor position appropriately

I have written a small application using OpenGL, and have implemented some rudimentary camera controls. Unfortunately, I cannot get the application to set my cursor position correctly. The cursor is ...
0
votes
1answer
72 views

Fragment shader, tint color problem

I am new to shaders, and I am trying to tint a texture to mark status of a enemy. I am implementing shaders on OpenGL ES 2.0 (Mobile) The problem is that with this shaders, I see the enemy without ...
0
votes
1answer
75 views

Aspect ratio of drawn quad messed up after rotating

When I draw a quad that is rotating the aspect ratio of the quad gets messed up and the size changes. Gif of what is happening I am confident it has something to do with the way I calculate the size ...
-1
votes
1answer
35 views

OpenGL/GLSL matrix in uniform block confusion

I'm a bit confused about the proper way to send a matrix from my code (C++) into a GLSL shader. My matrix object is stored in row major format in memory. If I use the following shader code it works ...
0
votes
0answers
26 views

Drawing Ray from ray picking is not working correctly

I have been implementing ray picking to select squares in my opengl program. I tried to follow this post I found http://gamedev.stackexchange.com/questions/109579/algorithm-for-triangle-picking after ...
-2
votes
2answers
166 views

C++ Multi-Platform (Windows, Linux, Android) OpenGL(ES) Solutions or Tutorials? [closed]

I'm sorry if this has been asked recently and I'm not Googling it right, but I've been digging all week for something. I've got a game prototype I made in Unity, and I have some decent experience ...
4
votes
1answer
88 views

Should texture regions sizes be power of two?

Is it advisable for my individual texture regions inside this texture to be power of two, or that won't make any difference? I've read on several places that it's recommended to use power of two ...
1
vote
1answer
50 views

How can I fade in 3D foliage smoothly?

Take a look at this picture: This is a picture of me diving down from a high height. As you can see, the world is a simple world with grass, snow, trees, etc. The problem here is the 3D foliage. If ...
1
vote
1answer
74 views

Heightmap terrain picking

I've implemented an OpenGL based terrain unsing a tesselation-shader for dividing each 'terrain-cell' into the desired tiles. The heightmap is uploaded to the GPU and applied on the shader. When it ...
1
vote
1answer
73 views

C++ Opengl transforming a glm::vec4 with a glm::mat4

Its easy enough doing it on the gpu via GLSL, but how would I do this in c++? When I try it gives me an error telling me I cant cast a glm::mat4 to float, Which makes sense, but how should I do it? ...
0
votes
0answers
46 views

What is the best way to group lots of squares into one VBO?

I'm making my first game in OpenGL, using procedural generation, and it is a similar concept to Terraria. At the moment, I have one, very small VBO for a square ('block') and an EBO for its vertices. ...
-1
votes
1answer
327 views

Will Vulkan Kill the use of GLSL? [closed]

After reading this link I am still unclear as to the shading language support in Vulkan. Is GLSL being phased out? If someone were just starting and wanting to master shading languages and computer ...
0
votes
1answer
41 views

OpenGL color overlay

I want to create a pause menu where everything in the background gets darker. I've looked up a bunch of possible solutions (even the second page on google) but it doesn't seem to work. I do already ...
2
votes
0answers
65 views

Would this 2D Lighting and Shadows implementation work? [closed]

I'm writing a top-down 2D tile-based game and I'm trying to decide on how to implement lighting and shadows. The game will have a large number of light sources, some static and some moving around the ...
2
votes
0answers
152 views

Jagged light bleeding where surface is roughly parallel to shadow mapping light direction

I am using Unity but this question might not be proper to this engine. I have projected the shadow map onto this sphere but there are grazing shadows. Is it possible to avoid it or to correct it as I ...
0
votes
0answers
28 views

Rotate object from an origin using a transformation matrix

I'm making a project in lib GDX and I want to rotate an object by changing the transform matrix of the sprite batch to one that rotates an object rendered on screen a given number of degrees from a ...
0
votes
0answers
32 views

How to implement UIBezierPath on IOS OpenGL

I have started the OPenGL IOS application development with GLImageProcessing OpenGL ES2.0 application. I could successfully load large jpg image and changed brightness using fragment shaders. Then I ...
-4
votes
1answer
32 views

m_Entries is undefined [closed]

I am following this tutorial and this guy puts in his code m_Entries and doesn't explain it at all at least I think. So any one who has done skeletal animation show me what he is talking about by ...
1
vote
1answer
56 views

Effect of vertex winding on normals and shading

I have implemented a Phong and Gourand shader for a triangle mesh that is being imported from an STL file. It appears to be working fairly allright but some triangles seem to be what I can only ...
0
votes
0answers
23 views

How can I gain depth buffer as a array in Unity or OpenGL

When I have an object (obj) and a material (mtl) file, I can load the 3D model in OpenGL or in Unity. After this, I want to get an array of 3D model's depth buffer from the Scene. By using the array, ...
1
vote
1answer
44 views

OpenGL ES 2.0 facet lighting

I am trying to figure out if there is a way to achieve facet lighting in OpenGL ES 2.0 without extensions. I know it is possible if I don't used indexed vertices but I don't really want to do that ...
5
votes
1answer
355 views

Calculated normals for mesh not working

I am trying to implement a 3D mesh viewer with C++ and OpenGL ES 2. I am currently struggling with the calculation of the normals for the vertices, or at least I think that is where the problem ...
1
vote
0answers
38 views

blending with OpenGL glBlendFunc and glBlendEquation

I want to draw a bunch of images in front of a background. Where images overlap, I want those to be blended together (for now, using a mix of 0.5 source * 0.5 destination color every time an image ...
1
vote
0answers
138 views

OpenGL Render Queue Design

I am currently designing the rendering system for a 2D game built in C++ and OpenGL, and am unsure about how to go about implementing a sorting procedure to maximise efficiency and minimize OpenGL ...
-1
votes
1answer
42 views

FRAMEBUFFER_UNSUPORTED (0x8cdd)

I've tried to implement bloom following this tutorial. But everytime I get the framebuffer object error 0x8cdd, which I believe means FRAMEBUFFER_UNSUPORTED. I'm pretty sure the problem occures ...
0
votes
0answers
92 views

Why is my OpenGL 4.1 shader not working on OS X Macbook ( works on Linux )?

I've recently rebuild shaders for my program and it stopped "working" ( black screen ) on OS X ( El Capitan ), but it's ok on Linux. What could be the cause? There are no shader compilation errors, ...
0
votes
2answers
126 views

Why does rotating my quad appear to move it farther away?

I have created a 3x3 matrix class which is then passed over to OpenGL Vertex Shader for transform my Quad. I have been trying to rotate my Quad around Z-Axis. Rotation is working but the Quad getting ...
0
votes
1answer
45 views

OpenGL: strange thing with depth and text rendering

TL;DR I render a scene with M,V,P matrices as always. Than I render something (in this case - text) without any matrices and using separate shaders pair on coordinates with Z = -1. Somehow it's ...
0
votes
0answers
59 views

Unity - _LightMatrix0 and Directional Light

I am trying to access the _LightMatrix0 in a forward base pass to calculate some light point of view coordinate but it seems that the _LightMatrix0 is empty with directional light. Any idea how can I ...
1
vote
1answer
68 views

Strange artifacts when using gl_FragCoord to access texels

I ran into a problem with using gl_FragCoord variable to access texels. The problem can be illustrated by following example: First I render a textured quad into texture of size (W, H) where W and H ...
5
votes
3answers
204 views

Painter algorithm vs. 3D rendering with Z-buffer when drawing 2D Sprites

I'm currently developing a tile base engine. I want it to look like your average old school tilebased RPG like Zelda - Link to the past (orthographic projection, squared tile texture, textures ...
0
votes
0answers
32 views

Shader - Directional Lights Depth

Is there a way to retrieve the deph from directional lights ? I can access the _ShadowMapTexture but this is not the depth. I found how to access the shadow map of, I think, every light type by using ...
0
votes
2answers
41 views

Cannot get mask with multiple textures to work

I am trying to render three textures: Background, Black/White Foreground Mask and Foreground. I have used this OpenGL - mask with multiple textures, but I cannot get it to work. I only get the last ...
0
votes
1answer
45 views

m_BoneMapping is undefined in OpenGL Step By Step Skeletal Animation Tutorial [closed]

I am new to this website I was following this specific tutorial on skeletal animation and I have a good idea on what it is, but when I was following his implementation he used a variable called ...
0
votes
1answer
45 views

Unity - Access to svPosition in fragment shader

I am trying to access to the svPosition in my fragment program in Unity but I keep having this error. invalid input semantic 'POSITION': Legal indices are in [1,15] invalid ps_3_0 input semantic ...
1
vote
1answer
25 views

Vertice combination code crashes when “large” amounts of vertices are introduced

I have a 2D tile rendering system. In my tile storage class, I have a two dimensional array of Tiles, and a build method which combines all of the vertices of the tiles which are not equal to ...
1
vote
0answers
70 views

Subsurface Scattering - Transmittance

I have a question related to SSS and especially transmittance. I've looked at several papers about that topic, most of them from Jorge Jimenez, which are very interesting and, I admit, a bit hard for ...
1
vote
1answer
74 views

Little question about glPolygonOffset

q1. After passing stencil test, depth test, etc. what version of "depth" of fragments after primitive rasterisation will be written to depth buffer? With shifted values or without? (Due to ...
0
votes
0answers
25 views

How to screen color blend spritebatch?

batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); batch.setColor(new Color(0xFF0000FF)); batch.draw(...); Expected result: Current result: How can I achieve something ...
2
votes
1answer
61 views

Cannot connecting texture to heightmap using mapped uniform location

In my shader program, I have my attributes and uniforms added to a map for each. What I have displayed is a heightmap, but cant seem to connect the graphic texture to display. mUniformList ...
0
votes
1answer
41 views

Using one GLSL shader program for textured and untextured rendering?

Rather than have two separate shaders in my OpenGL code (one for when a texture is bound, one for when none is bound) I usually go for one shader program which handles both. This is my usual fragment ...
1
vote
0answers
163 views

How to use OpenTK (OpenGL) with MonoGame?

So I've been making a snake game using MonoGame (DirectX Only). I added movement, controls, feeding and growing in length. I wanted to add smooth animations to the game because the snake is just made ...
6
votes
2answers
373 views

Know if you're fully utilizing the GPU

I render ~17.000 VAOs each frame. 2.840.386 triangles. Only applying texture, nothing else. I have three computers and the performance across them is not as expected. Cheap laptop(i3-4010U & ...
-1
votes
1answer
102 views

How to pitch, yaw, roll, an object like a flight simulator in OpenGL?

I'm working on a college Graphics project using LWJGL (OpenGL in Java). I've done most of the scene but I got a problem in figuring out the jet's orientation. Here's how I tried it at the very ...
1
vote
1answer
112 views

OpenGL/SDL2 How to resize the render area with the window?

After calling SDL_SetWindowSize, the area being rendered to doesn't change with the window, so if the window gets bigger, it leaves a black area on the top and right sides. I am adjusting the OpenGL ...
0
votes
1answer
54 views

My point light shadows only really work if my point light is at the world origin (0,0,0)

When I move the light, the shadows will fall apart as if their occluders aren't occluding them in certain areas. For example, in the following scene, I move a pointlight 400 units down the Z axis, I ...
0
votes
1answer
35 views

OpenGL Face Order

i have written a simple OBJ-file loader to render meshes using OpenGL. But there is a problem displaying the loaded mesh. It seems that faces that from the background (far) are displayed above the ...