Tagged Questions

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
40 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
32 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
21 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
29 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
29 views

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

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
39 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
273 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
0answers
42 views

Interpolating colors to greenify or blueify a screen fade

I am attempting to duplicate something from a game where the screen basically fades to a color by 'green-ifying' or 'blue-ifiying' the screen. My guess is that it does a linear color interpolation ...
1
vote
1answer
75 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
25 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
33 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
23 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
39 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, ...
2
votes
3answers
128 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 ...
-3
votes
0answers
39 views

Animating a 2D sprite from several images or from a single image? [closed]

How do I animate my 2D sprites in Opengl , I am making a game in 2D and want to animate the sprites . Any tutorial or help will be highly appreciated .
0
votes
0answers
18 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
27 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
36 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
93 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
44 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
62 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
46 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
12 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
71 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
48 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
56 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
44 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
102 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
28 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
19 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
54 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
41 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
103 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
180 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
48 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
126 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
18 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. ...
0
votes
0answers
74 views

How to get rid of half pixel artifacts?

I've been having a bit of trouble using OpenGL to make 2D games. I am using a traditional ortho perspective with just some sprites being rendered and moved around. It all works perfectly but there is ...
0
votes
1answer
83 views

OpenGL Question about scaling 3D Object

I got some scaled cubes (1, 2.5, 1) in a 3D Space with a grounded floor with position (0, 0, 0) and scale (100, 0, 100) like in the picture. But why are the cubes scaled out from the center. I want to ...
1
vote
2answers
108 views

How can I pass a std::vector<Vector3f> to my shader?

I have a Vector3f type which has x, y, and z properties. I have a std::vector of these vertices which describe my terrain. I would like to pass these values to a vertex shader through a uniform ...
2
votes
1answer
103 views

Shader - Transmittance or Absorption

I am trying to create a transmittance or absorption shader (glsl, hlsl, cg, etc...) in realtime but I don't find any good tutorial or white paper about this subject. I only find offline rendering ...
0
votes
1answer
105 views

How do I set a background image in OpenGL/GLFW?

I'm writing a simple 2D game with C++ and OpenGL/GLFW, and my current step is to create a menu. I finished with buttons, but I think it looks a little bit boring (with only 4 buttons and a black ...
0
votes
1answer
73 views

OpenGL - Asteroids clone - shooting bullets from spaceship [duplicate]

I am having a bit of difficulty figuring out how to shoot bullets from the front of the spaceship. I can draw it to screen, but I can't properly figure out how to create bullets each time I press the ...
1
vote
0answers
97 views

OpenGL Bump Map — Texture artifacts ?

I am learning OpenGL (and learning the math behind it) and I'm making a simple OBJ viewer, nothing fancy. I have diffuse, specular and ambient light/texture working fine and now I am implementing the ...