-1
votes
0answers
22 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 ...
3
votes
1answer
69 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
72 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 ...
3
votes
1answer
91 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, ...
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
57 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 ...
1
vote
2answers
170 views

How to detect graphics API at runtime with SDL2?

Using SDL2, is there a way to determine at runtime whether the application is using OpenGL, OpenGLES, or DirectX? EDIT: If there is a way to figure it out without using the SDL2 API, I'm willing to ...
1
vote
1answer
122 views

Game development for high-school with C++ and OpenGL [closed]

I've been teaching high-school students (12th grade) game programming in the last 2 years. The way I did this till now, was first to give them "half made" classes (for Point, Polygon, etc.) and ...
0
votes
1answer
75 views

C++ OpenGL / SDL2 VBO — Depth problem / Transparency

I got a problem with my VBO. When having textures. The far blocks overlay the near ones. I tried editing the alpha, depth buffer, the VBO byte allocation. Nothing works for me... The FAR plane is ...
1
vote
1answer
90 views

How to implement camera pan like in Maya?

I am trying to implement camera pan like the one in Maya. I've got it almost working. The problem is that the mouse cursor is moving faster than the 3d mesh (in fact I am moving the camera but I ...
1
vote
1answer
65 views

Geometry Shader only creates one primitive

I am currently trying to use the geometry shader. My input is a set of points, for which multiple triangle should be created This is the geometry shader #version 330 layout(points) in; ...
1
vote
0answers
84 views

implementing shadows into my 2D GLSL-based lighting system

I'm writing a lighting system in OPENGL using GLSL shaders, and I'm pretty happy with the light casting I have so far, but I'm totally stuck on casting shadows. Everything I've found online on this ...
0
votes
1answer
47 views

Mesa: Howto enable OpenGL 3.x functionality via extensions?

How can I enable OpenGL 3.x functionality via extensions? I'm new to OpenGL development under Linux. Currently I have #define GL_GLEXT_PROTOTYPES #include <GL/osmesa.h> #include ...
0
votes
1answer
125 views

3D picking for mouse move event

I implemented color picking recently and I would like to use it as kind of highlight when mouse is over an object but I am concerned about performance. Color picking requires whole frame to be drawn, ...
0
votes
2answers
113 views

c++ OpenGL framerate question

I am writing a simple 3D pacman using c++ and OpenGL. I'm new in OpenGL development, I wanted to make a small project before learning next concepts. For now I can't have more than 55fps when ...
1
vote
2answers
126 views

GLSL to Cg: why is the effect different?

With reference to this question, where I was trying to make the shader compile, I am now trying to make an effect appear. The effect can be shown here, through a GLSL shader: But when I use the ...
2
votes
1answer
158 views

Assimp skeletal animation matrices

I startded to make an assimp only opengl skeletal animation demo. For that I used this: http://sourceforge.net/p/assimp/discussion/817654/thread/5462cbf5 And something is not correct in bone matrices. ...
0
votes
0answers
120 views

Problem when using two different shaders

I have created a simple shader for drawing my scene in OpenGL. When another shader was introduced, a problem appeared. I use the first shader and draw few objects in the scene. Then I use the second ...
1
vote
1answer
51 views

glDeleteBuffers causing other objects not to draw

I have few objects in scene and they exist until I turn off the application. Their calls for glDeleteBuffers are in destructor. Since I don't delete anything in the middle of the game everything is ...
2
votes
0answers
33 views

SDL_AddTimer + SDL_GL_MakeCurrent not working on Windows [closed]

I'm messing around with C++, OpenGL and SDL doing a game that should be able to run in Windows and Mac OS X. I have a problem that only happens on Windows. Let me describe the scenario. First I ...
0
votes
0answers
65 views

Tile Collision - subtracting a minor value to the box size

I'm having a certain problem when doing collision checks on bounding boxes that have their edges aligned with upper or right tiles. It shouldn't count as an intersection but I don't know a good ...
1
vote
0answers
103 views

OpenGL Hello Triangle troubles [closed]

Just trying to get the simple OpenGL hello world program set up and for what ever reason I just cant see why I can't get it to work. I'm able to create a resizeable window and set the background ...
3
votes
1answer
103 views

MSAA deferred implementation issue

I recently implemented MSAA in my deferred renderer, it looks good but I just got a feeling I might have done it wrong. Here is what for example the directional light fragment shader looks like: ...
0
votes
1answer
57 views

Can you specify which VBO/EBO to use with glDrawElements?

I'm creating a voxel-like game. I'm not sure if I am using VBO/EBO's correctly. I am creating a new VBO & EBO for every chunk. This is done once, but chunks call a render function in every block ...
0
votes
0answers
19 views

Manual occlusion culling with glDrawElements [duplicate]

How should I go about doing occlusion culling with glDrawElements? I am dealing with voxel-like terrain. I want to avoid drawing the faces that are facing another block. I just don't know how to ...
0
votes
0answers
66 views

FBX SDK Colors problem

I've imported control points, normals, and indices successfully and now i'm trying to import vertex colors, but something is not right. Here's the code: FbxLayerElementMaterial* ...
1
vote
2answers
156 views

OpenGL flickerinng near the edges

I am trying to simulate particles moving around the scene with OpenCL for computation and OpenGL for rendering with GLUT. There is no OpenCL-OpenGL interop yet, so the drawing is done in the older ...
2
votes
0answers
32 views

FBX Importer - Vertex Color

I imported vertex positions, indices and normals successfully in OpenGL using fbx sdk, but I just can't figure out how to import vertex colors. I tried to fetch the pointer to array of colors trough ...
0
votes
0answers
70 views

OpenGL Drawing textured model (OBJ) black texture

I'm using OpenGL, Glew, GLFW and Glut to create a simple game. I've been following some tutorials and I have now a good model importer with textures (from ogldev.atspace.co.uk) but I'm having an ...
3
votes
1answer
129 views

Open GL perspective projection vs orthographic projection

I am trying to build an engine using OpenGL however I have a question about the kind of projection to use. For a 2D game should I use a perspective projection or an orthographic projection? If I ...
0
votes
2answers
51 views

What is the correct way to reset and load new data into GL_ARRAY_BUFFER?

I am using an array buffer for colors data. If I want to load different colors for the current mesh in real time what is the correct way to do it. At the moment I am doing: glBindVertexArray(vao); ...
1
vote
0answers
80 views

Different way to pass uniforms to seperate draws in glMultiDrawElementsIndirect

Given OpenGL version 4.3 and GLSL 430, what would be the best way to pass a matrix to each model in a draw call to glMultiDrawElementsIndirect? I am thinking of going the way of a TBO and indexing it ...
0
votes
1answer
100 views

Making particles accelerate toward a mouse point

I'm currently working on a particle simulation program that makes pixels move towards a mouse point continually accelerating, but i'm running into some math issues. Currently my particle will ...
1
vote
1answer
142 views

What should I do when a VBO becomes too large in OpenGL?

Currently I have one buffer for my vertex data and one buffer for normals data. I fill them and then pass them to OpenGL for rendering. The problem is when I load too large mesh file like "Lucy" from ...
4
votes
1answer
297 views

OpenGL glDisable(GL_TEXTURE_2D) vs glBindTexture(GL_TEXTURE_2D,0)

I would like to ask which one of the glDisable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,0) is better to use after I finished my texture rendering. Is there any difference performance-wise?
0
votes
1answer
103 views

why is glVertexAttribDivisor crashing?

I am trying to render some trees with instancing. This is rather weird, but before sleeping yesterday night, I checked the code, and it was in a running state, when I got up this morning, it is ...
1
vote
0answers
70 views

Text alignment in OpenGL with FreeType2

I'm trying to implement font rendering and have got into some trouble with glyph metrics. Here's the code where I get the metrics: Glyph gl; gl.width = face->glyph->metrics.width / 64; ...
3
votes
2answers
146 views

OpenGL - Index buffers problem

I have a custom file format that has all the needed information for a 3D mesh (exported from 3ds Max). I've extracted the data for vertices, vertex indices and normals. I pass to OpenGL the vertex ...
0
votes
1answer
84 views

Camera rotation around point, but without centering

Let's say i have the following: Point somewhere in space Camera with position and orientation (up, right, forward) I want to rotate camera around the point, but also keep this point in same place ...
0
votes
0answers
55 views

Bounding box center after transformation - want degree values for GUI

Similar to my previous question, I have a bounding box that I have transformed and scaled. Now, I want to get its center by doing this operation and store this value. bbCenter = glm::vec3(bbMin_x + ...
1
vote
2answers
274 views

glGenVertexArrays causes crash

My code keeps crashing at runtime, I have done some creative debugging and determined that it was the glGenVertexArrays that was causing the crash, I've looked around and come across some answers that ...
0
votes
0answers
51 views

Focus a turntable style camera on an object

I have a turntable style camera in the maya / blender / alembic / opensubdiv example. I want to be able to match the camera translation to any objects translation pivot point in the scene and then ...
0
votes
1answer
85 views

Loading Wavefront Data into VAO and Render It

I have successfully loaded a triangulated Wavefront (.obj) into 6 vectors, the first 3 vectors contain the locations for vertices, UV coords, and normals. The last three have the indices stored for ...
3
votes
1answer
117 views

Should my GLSL Shader object/wrapper encapsulate loading/setting a VertexArrayObject?

I am working on a 2D game in C++, with a simple rendering layer over OpenGL. I have a wrapper for GLSL shaders and shader programs, these wrappers encapsulate shader objects into C++ classes and ...
4
votes
3answers
262 views

Make openGL program only update every 1/60 seconds

I'm learning C++ and openGL and have this program as a result from tutorials and playing around. The problem is that the main loop is running at "full speed", making the program unnecessarily cpu ...
0
votes
2answers
244 views

OpenGL - How can I make the edges of this textured circle smoother?

I'm building a game and I've applied a certain texture (RAW file) to a circle (GL_POLYGON) in OpenGL. It loads correctly, with the right size and all, but the edges seem a bit jagged and I would ...
1
vote
1answer
74 views

Correcting Lighting in Stencil Reflections

I'm just playing around with OpenGL seeing how different methods of making shadows and reflections work. I've been following this tutorial which describes using GLUT_STENCIL's and MASK's to create a ...
1
vote
1answer
90 views

Is there a way to use other fonts, besides the default ones in OpenGLUT?

I'm using OpenGLUT functions like glutBitmapString to render sentences and words in a game. However, there is a limited set of fonts to use and I need some bigger size fonts. Is there a way to add new ...
1
vote
0answers
183 views

opengl volumetric billboard implementation: general idea + geometry shader

A while ago I decided to implement the volumetric billboards technique in my university project (C++ & OpenGL 4.3). I passed the subject but failed to implement the mentioned technique. I'd like ...
1
vote
1answer
93 views

In glsl, how do indices work?

I have made a vertex shader and fragment shader and kind of know how they work, and I know that you specify what index you want your vertices to be in inside the shader program. So if the vertex was ...