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

Problem setting up OpenGL dev environment in Ubuntu 14.04

Currently I'm using this tutorial to get started with opengl.So when I try to compile the example program : #include <GLFW/glfw3.h> #include <thread> int main() { glfwInit(); ...
1
vote
0answers
26 views

How do I fill a shape with a texture in Libgdx?

I am making a 2D racing game. I want to fill the area of the ground object with a texture. I have the shapes of the ground (a Box2D shape). If I make images of the ground with textures, it uses a lot ...
4
votes
0answers
57 views

physically based shading, how to combine specular & diffuse parts?

After writing 'standard' phong & blinn shaders for a while, I recently started to dabble in physically based shading. A resource that helped me a lot are these course notes, especially this paper ...
-1
votes
0answers
59 views

How can I generate passive 3D using a consumer level graphics card?

I would like to how to generate packed frames and sent them by HDMI to a 3DTV for passive stereo visualization, using any consumer-grade graphics card. I am working on Linux, and programming in C++. ...
0
votes
0answers
16 views

LibGdx Exception

Here is the exception: Exception in thread "LWJGL Application" java.lang.NullPointerException at com.mygdx.test.excav.game.WorldRender.renderTest(WorldRender.java:34) at ...
-1
votes
2answers
57 views

OpenGL Depth Test Errors

I've been working on this problem for a while now. My problem is that the sphere in the top image, is under-lapping the plane which should have a lower Z value. Although, when depth testing is ...
0
votes
1answer
42 views

Can diffuse and specular component of Phong model shine thru object?

I have been implementing simple 3D engine in OpenGL, mostly based on tutorials by Tom Dalling. I have implemented the Phong lightening model as described in his tutorial, but I see light artifacts on ...
0
votes
2answers
40 views

Overload how an object instance of a class is treated when used

So I've made this struct that encapsulates a glm::vec4. This is because vec3s are treated as 16-byte in GLSL, but I don't want to assign a vec4 if I only really need 3 components. Anyway, my question ...
0
votes
0answers
40 views

Generating Mesh From Voxel Data [on hold]

I need help converting a 3D array of voxels (The array indexes are the voxel positions) to an actual voxel terrain mesh (float array for vertices, And a int array for indices) So i can render a chunk ...
0
votes
1answer
53 views

Player being covered by glClearColor?

Here is a video of the problem: https://www.youtube.com/watch?v=6vnDOB1Vk4o (this is the game I've been making for fun/practice). You notice, in the beginning of the video, I walk off the map and ...
0
votes
0answers
36 views

Artifacts rendering high-poly procedural meshes with OpenGL

I am having some issues when rendering some procedural generated meshes. There are some really wierd artifacts when rendering high-poly count meshes (not that much actualy). I have been able to ...
1
vote
1answer
26 views

Opengl Quad Tessellation Control Shader

I have the generic tessellation evaluation shader for triangles but I need to make it work for quads. Is there any chance someone could explain what is happening here and point me in the right ...
1
vote
1answer
34 views

How to improve Batch Rendering to work with 3D skeletal animation data

I've implemented a batch rendering technique that is described in detail here: http://www.gamedev.net/page/resources/_/technical/opengl/opengl-batch-rendering-r3900 I'd like to extend it now to ...
-1
votes
0answers
34 views

C# OpenTK - How to get a Bitmap from a loaded Texture [closed]

After some searching around, I put this code together: public static Bitmap BMPfromTextureID(int id) { int w, h; GL.BindTexture(TextureTarget.ProxyTexture2D, id); ...
0
votes
0answers
42 views

Black screen using frame buffer

I'm trying to use frame buffer to add post effects on my game and I've got a problem: My screen is black every time I'm trying to drawn something in. My scene is simple: A static red box on a black ...
3
votes
1answer
295 views

I want to render some surfaces in GLSL with normal maps, and some without

I have normal mapping working in my game, but I want to only use normal mapping for some surfaces, and not others. Right now, as far as I can tell, my shader is applying an incorrect normal of (0, 0, ...
1
vote
1answer
77 views

How can I implement a camera like the one in RotMG?

RotMG, an MMO top-down shooter, takes on a unique 2d-3d style, and has an intriguing camera; The game is obviously 3d, not simply isometric, and if you play the game and turn on camera rotation you ...
1
vote
1answer
51 views

Triangles go missing as Z changes

I'm rendering a height map using shader-based OpenGL (3.3 to be precise). The height map data is from a grayscale bitmap (2D array of bytes). The dimension of the bitmap is 256 x 256. With this data, ...
0
votes
0answers
26 views

Dynamic VBO update possibly corrupting data?

I want to draw a line between two vertices. On a mouseclick the vertex data will change and I want to update the line to use the new values. I am using a VBO for this and it looks like the update ...
0
votes
1answer
35 views

Is there a builtin way to convert rect to spherical coordinates

This seems like a fairly basic and common problem. Is there a builtin way to achieve it or do i have to write the algorithm on my own?
0
votes
0answers
24 views

glBlendFunc() makes primitively drawn quads disappear

i have experienced some issues with glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);. Having this invocation in OpenGL init code makes stuff drawn with the following methods ...
1
vote
1answer
40 views

Alpha blending, transparence and z-ordering

I'm making some tests with alpha blending in a projet and I don't understand something. In my tests I've done something like that and everything look good: Draw blue box first (depth test: true, ...
4
votes
4answers
297 views
+50

OpenGL lighting appears to be clamping

I'm experiencing an odd problem where everything placed in front of my light appears black in my scene. This happens on multiple axes. I've searched the depths of the internet to find a solution, but ...
0
votes
0answers
19 views

How to properly transform vertices for a model loaded using Assimp?

When I try to load a DAE model then vertices are not placed correctly. Here's the code snippet I use to load 3D models using Assimp : aiNode* CGameObject::findNode(aiNode* rootNode, const char ...
0
votes
0answers
30 views

When camera moves the textures move and rotate

I recently followed the tutorial at PaulsProjects on shadow mapping. After finishing the tutorial all of my textures seemed to have vanished, then I moved my camera and the texture reappeared. But the ...
0
votes
2answers
39 views

How can I change the value of a matrix uniform in an OpenGL vertex shader?

I'm new at OpenGL. I have a uniform transform matrix in a vertex shader file. I want to modify the matrix by individually assigning each values in the matrix. How can I do that in C++? I learned that ...
0
votes
2answers
96 views

Combine flat and smooth shading with a single model geometry

I need to be able to switch between smooth and flat shading interactively. Is there a way to do this efficiently with a single geometry? For example, smooth shading does not require duplicate ...
0
votes
0answers
47 views

Tessellation shader pass-through : Nothing displayed

I am trying to set a pass-through tessellation shader and then build on top of that while learning. From what I found/read I need to do in the TE shader everything that was done in the vertex shader ...
0
votes
0answers
20 views

Sprite framework binding multiple textures

In an attempt to batch render as many quads (sprites) as possible, I'm instance rendering a single unit-sized quad and passing in a buffer of per-instance data that includes width/height, texture ...
1
vote
1answer
76 views

For Vertex Buffer Steaming, Multiple glBufferSubData VS Orphaning?

I was learning OpenGL recently. In games, we need to update the position of game objects frequently, and they will come in & out of screen constantly. So it means in rendering we need to update ...
0
votes
1answer
48 views

Backface culling without light leaking through

I want to be able to see through walls, so to do this I used planes for the walls, and enabled backface culling. However with shadow mapping I have a lot of light leaking through: I read that using ...
0
votes
0answers
14 views

Jmonkey Translucent Render Bucket fails to model object last

So I have a weapon model that moves wherever the camera moves and the rotation of the weapon is the same as the rotation of the camera. Additionally I added the weapon to the Translucency Queue Bucket ...
0
votes
1answer
72 views

OpenGL not rendering full scene, it is a mystery [closed]

I am trying to draw a scene in the sort of style of mock vector graphics. I've helped on a 2D game before with GLSL, but I tried to keep a simple approach to this project since I'm working by myself, ...
-1
votes
0answers
49 views

How to design drawing order?

I am using Opengl 4.3 in my game and I am curious to how popular implementations of drawing order is done. What I currently have is a texture atlas of bunch of images, some single images to display, ...
-1
votes
2answers
37 views

Loading texture in opengl without using shaders [closed]

Thanks in advance for answering this . I am using SOIL to load an image through opengl . Below is the description of my code and the image that it is loading is weird . typedef struct { ...
0
votes
1answer
60 views

Uniform Block solve padding/alignment for vec3 in CPU struct

I have a struct on the CPU which I'm sending to a uniform block in my shader. After a bit frustration I finally got it to work. The problem I had was that vec3s are actually treated as 16-bytes, or in ...
0
votes
0answers
47 views

How can I get the position of a cursor on world space on a 2D game

I am trying to make simple 2D top down shooter to train my skills on Graphics programming and I am having trouble getting the input. I am using glm as my math library, what I am trying to do on the ...
0
votes
2answers
103 views

How can I efficiently render lots of 2D quads?

I have lots of 2D quads. I write their local vertex position info to a buffer (accompanied with a world transform matrix) which gets sent to the render thread. I then pass the world transform matrix ...
0
votes
1answer
30 views

Android OpenGL and non premultiplied textures

As I understand it; by default all bitmaps will will get the alpha channel premultiplied in Android if loaded using BitmapFactory. My setup: I have a 32bit bitmap(.bmp) where the alpha channel has a ...
0
votes
1answer
21 views

wglCreateContextAttribsARB is undefined

I've just downloaded the latest headers from the OpenGL registry and included them in my project. I am attempting to create an OpenGL 3+ context. Every tutorial/resource has used ...
1
vote
1answer
55 views

Errors when loading Assimp meshes

I am experiencing some oddities when loading meshes in Assimp. Some models render perfectly, while others are complete jumbles of triangles. Some Example Images: Teapot Correct - Teapot Actual ...
1
vote
0answers
42 views

Mouse click coordinates not mapping to Box2d world

I'm using Box2d in Java with OpenGL, trying to detect if a mouse has clicked on a Body. But having trouble mapping mouse coordinates to Box2d world. I have a Body positioned at 20.0f, 30.0f in the ...
0
votes
3answers
106 views

OpenGL Texture Mapping distorts image

So, I'm just trying to draw a texture to two triangles that are the same size as the viewport, but it breaks up the image and distorts it. I have tried resizing the image file and everything, but ...
0
votes
1answer
182 views

OpenGL generate hills looking vertices

I want to generate a terrain which looks like hills. Some sort of sine waves. Should be as simple as possible. But I can not figure out how. I get very scary results, which are nothing worth. I need ...
1
vote
1answer
49 views

How to fix model matrices colliding in vertex shader?

I am new to OpenGL programming and I'm writing some basic code to display a few objects onto a screen. I have a pyramid shape that I'm displaying, as well as a box shape that I am displaying. The ...
0
votes
1answer
129 views

OpenGL: I only see one square instead of a cube / giving information to vertex shader

I am new to OpenGL and tried to follow this tutorial. I use C# and OpenTK. So I translate the C++ Code from the Tutorial: My C#-Code: /* Hintergrundfarbe */ ...
0
votes
1answer
21 views

Invalid coordinates returned by glutmusefunc()

I am using GLUT's glutMouseFunc() function to retrieve the coordinates of mouse clicks. I want to move the object on that coordinate to another coordinate. But when I click on the object the ...
5
votes
1answer
105 views

Why bother with a separate normal matrix, if there is never non-uniform scaling on the view matrix?

I am updating one of my shaders to a version of OpenGL/GLSL that doesn't automatically provide gl_NormalMatrix (for educational purposes; I'm not ripping out working code for the sake of it). ...
0
votes
0answers
16 views

Artefact in VSM as if GL_DEPTH_TEST disabled

I am trying to implement VSM and I incurred in a strange issue. I render them as follow: glUseProgram(shadowMapProgramID); glEnableVertexAttribArray(0); glBindFramebuffer(GL_FRAMEBUFFER, ...
0
votes
0answers
8 views

Transform screenquad around object's view space boundaries (GLSL)

Im not sure how to ask this, but essentially I am looking for a way to optimize rendering screen quad lights per object. I have a deferred renderer that draws directional lights onto a screen quad. ...