0
votes
0answers
31 views

Mouse input that 'sucks in' particles

I'm having trouble figuring out the equations behind the title, I did exactly this using OpenGL's fixed function pipeline, but while transferring this over to the programmable pipeline i'm running ...
0
votes
2answers
118 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
votes
1answer
67 views

C++ SDL2 OpenGL Rendering Problems [on hold]

I just started with SDL2 and OpenGL in C++ and I am having some trouble rendering a triangle. The triangle I want to draw renders on the screen, but it is black. I tried added some shaders, but they ...
0
votes
0answers
4 views

Code::Blocks undefined reference to “*” [migrated]

Like the title says, I'm getting multiple build errors using C::B, all are saying undefined reference to '*'. I'm trying to build a program using OpenGL, GLFW, and GLEW. The top three things that it ...
1
vote
2answers
64 views

Loaded OBJ Model Will Not Display in OpenGL / C++ Project

I have been experimenting with new effects in game development. The programs I have written have been using generic shapes for the visuals. I wanted to test the effects on something a bit more ...
1
vote
1answer
32 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
45 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
112 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
80 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 ...
0
votes
0answers
34 views

Easier way to clip a spritesheet

I have been learning OpenGL slowly for the past few weeks through LazyFoo's tutorials, and I've come to the texture clipping section. I think his explanation is fine, but not quite enough for me to ...
7
votes
3answers
193 views

Terrain & Multi-Texturing

I'm using OpenGL (Version 4.4) (and C++ if that matters). I've created a terrain renderer, the terrain is stored as a 3D scalar field (isosurface/voxels). It uses a slightly modified version of ...
2
votes
1answer
174 views

How can I forward GLFW's keyboard input to another object?

I'm having trouble trying to execute keyboard events in a another class with GLFW3. The problem I'm having is that GLFW3 uses a static function for input as shown: static UI u; ... ... static void ...
1
vote
1answer
80 views

How do I flip upside down fonts in FTGL [closed]

I just use FTGL to use it in my app. I want to use the version FTBufferFont to render font but it renders in the wrong way. The font(texture?buffer?) is flipped in the wrong axis. I want to use ...
0
votes
0answers
39 views

Why is glMapBufer returning NULL?

I'm not trying to stream or anything, I just want to speed up my file loading code by loading vertex and index data directly into OpenGL's buffer instead of having to put it in an intermediate buffer ...
1
vote
1answer
104 views

How Extract Frustum Planes from Clip Coordinates?

I'm having some problems with my Frustum Culling and I want to debug it, so I'm trying to render it's planes, to see exatly the Frustum. But I'm using the Clip Coordinates to do the culling (like ...
0
votes
0answers
70 views

Why does Assimp appear to be loading vertices in the incorrect order in this code?

I'm getting a weird bug in my code that is reading in the vertices from an .obj file. The .obj file is just a cube, hence there are eight vertices. When I print out the vector it seems to work ...
3
votes
1answer
160 views

First encounter with dynamic lighting [closed]

I have a game idea with lots of pretty lights (literally) in mind that I would really love to implement, but I have essentially zero experience with shadow mapping, deferred rendering, the lot of it. ...
3
votes
2answers
223 views

When would you use an octree in a voxel Engine?

I've been reading about Octrees, and I understand how they work (or at least I think I do). However, I can't figure out why you would use octrees instead of a simple multidimensional array. In my ...
2
votes
1answer
94 views

Why is GL_TEXTURE_MAX_ANISOTROPY_EXT undefined?

So I'm writing my texture class in my opengl game, I get to the part where I would normally set GL_TEXTURE_MAX_ANISOTROPY_EXT, and I'm shocked to discover that it's undefined! This exact same ...
2
votes
1answer
88 views

How to work with smaller intermediate textures in OpenGL and GLSL?

I'm working on a project rendering water simulated through smoothed-particle hydrodynamics (SPH) with a non-photorealistic look to use in games. In the actual stage of the project everything about ...
2
votes
1answer
93 views

C++ FPS game collision detection with partitioning system or physics engine?

I'm working on a small FPS game (as a hobby and for learning purposes, nothing else) built with C++ in OpenGL (from scratch). Documenting online on the kind of strategy someone would approach with ...
1
vote
1answer
63 views

How to draw a plane equivalent to a given btStaticPlaneShape using OpenGL

With all other shapes in bullet, you can easily get the transform from the MotionState which holds the origin, the scale, and the rotation. There seems to be no way to get the same information about a ...
0
votes
1answer
60 views

Jittery Rotational Movement with Arcball implementation

I have an assignment where I need to implement arcball using Opengl (~2.0). I have it more or less implemented but I have a some problems/issues/bugs and I'm not sure whats either causing them or how ...
1
vote
2answers
136 views

How can I compute the orbit of one body around another?

I'm attempting to have a planet (with a known mass and radius) orbit it's sun (also with a known mass and radius). It doesn't have to be 100% realistic, but it should be possible that the sun have ...
0
votes
2answers
140 views

Z-order with Alpha blending in a 3D world

I'm working on a game in a 3D world with 2D sprites only (like Don't Starve game). (OpenGL ES2 with C++) Currently, I'm ordering elements back to front before drawing them without batch (so 1 element ...
-1
votes
1answer
38 views

Combine textures with coordinates [closed]

Is it possible to add one texture to another texture, at specific coordinates? Like if I want to add a small texture(16x16) to big texture (1368 x 768) with coordinates ( 100, 100) so the small ...
0
votes
1answer
61 views

Textures not displaying. Problem with fragment and vertex shaders

Hi i have newbe question. I am sending to gpu textures unit and they dont display. This is simple version of my fragment and vertexshader. (More complicated version also dont work with other textures ...
-1
votes
1answer
65 views

Opengl Obj with multiple textures. Jpg texture don't display

Hi i have problem with jpg textures. DDS is working good but jpg is not. This is my function to load JPG texture. In debuger i see that this works but i dont see anything. char * a =(char *) ...
0
votes
1answer
86 views

why is my OpenGL texture transparent?

I have a terrain in OpenGL, and two textures which I am combining using GLSL mix() function. Here are the textures I am using. Now I am able to combine and mix these two textures, but for some ...
0
votes
0answers
30 views

Rotating an object towards a point in OpenGL C++ [duplicate]

I calculate the matrix like this: modelMatrix = glm::translate<float>(position) * glm::rotate<float>(orientation.x, glm::vec3(1, 0, 0)) * glm::rotate<float>(orientation.y, ...
0
votes
1answer
144 views

When should rendering be performed during a frame?

When working with OpenGL or DirectX, should draw calls be done all at once, at the end of the update loop, or is it better to have draw calls occur during the update loop rather than just at the end?
0
votes
2answers
153 views

How can I regulate update and event frequency?

I'm trying to create a small 2D RPG-type engine using C++, SDL/OpenGL and Tiled. My little demo looks very similar to a Pokemon or Zelda game. I was curious how to go about regulating FPS and how ...
1
vote
1answer
151 views

glGetUniformLocation Returns -1

I've been trying to develop shaders that would allow me to easily display text on screen using a font texture. I've previously written shaders that simply drew the text on screen and I passed the ...
0
votes
1answer
108 views

Is it acceptable to buffer no data OpenGL?

Correct me if I am wrong, but if you call "glBufferData(...)" upon an existing buffer, it will resize the buffer to whatever data you upload. Does that mean if I call something like ...
0
votes
2answers
160 views

Pixel perfect clickable picture in OpenGL/C++

So I have a picture(for easier understanding of problem like this: http://www.lib.utexas.edu/maps/europe/europe_95.jpg). My goal is to click on any of the countries and get what country I clicked. ...
1
vote
1answer
91 views

Anisotropic filtering on gbuffer textures for shading pass?

I have a OpenGL 3.3 deferred shader. For my geometry pass I have diffuse textures and/or normal map textures from my models and here I use max anisotropic filtering. But in my shading pass, where the ...
0
votes
1answer
258 views

problem using glm::lookAt and glm::perspective

I'm trying to change the code from the 22th tutorial at http://ogldev.atspace.co.uk/, using the GLM library, but the result seems wrong. The problem is shown in the below picture: While it should be: ...
1
vote
1answer
66 views

glIsBuffer unexpected result

static void BindBuffer(BufferTarget target, GLuint buffer) { if(!glIsBuffer(buffer)) throw runtime_error("This is not a buffer. WTF?"); glBindBuffer((GLenum)target,buffer); ...
-1
votes
2answers
105 views

Using Geometric Slerp to move Camera

I'm writing a program in C++ using OpenGL and GLM; I'm trying to get my camera to follow my car. So far it successfully follows it around the screen, but I'm having trouble adjusting the Camera's ...
1
vote
1answer
154 views

lighting for landscape

I've got a landscape(created in Photoshop .raw file) and a .tga texture for it. I read .raw file and read .tga file like this LoadRawFile("landscape.Raw", MapSize * MapSize, &HeightMap[0][0]); ...
2
votes
0answers
181 views

Help with 2D sprite instancing [closed]

Alright, so I'm pretty new to OpenGL programming. I've been writing my own engine, initially using the fixed function pipeline. I then did a 1:1 replacement of the fixed-function methods with shaders ...
3
votes
1answer
204 views

Solving banding with additive blended particles

I needed to implement particles for my 2D game, written in C++ with OpenGL for graphics, so I went ahead and created a nice geometry container to batch particles together and then implemented the ...
0
votes
1answer
111 views

Material properties and deferred renderering

I'm using assimp to import 3d models, and each model defines a set of material properties as well, such as material diffuseColor, ambientColor, specularColor and emissiveColor. Where would I store ...
1
vote
1answer
205 views

glGenerateMipmap confusion

I'm trying to get a grip on mipmaps with OpenGL. I believe I understand the concept, but when trying to have OpenGL generate them I wonder how it determines how many mipmaps to generate? Here's what ...
1
vote
1answer
653 views

Basic Car Movement, Converting 2D Vectors to 3D problems

I'm trying to follow this guys method for steering a basic car. Link. It's the first example I can sort of get my head around and I'm trying to convert it to a working 3D version. To get some scope, ...
2
votes
1answer
219 views

glDrawArrays (layered rendering using geometry shader) only draws one point

I have been debugging this for a while but I can't seem to find the issue. I created a framebuffer for layered rendering like this GLuint buffer; glGenFramebuffers(1,&buffer); ...
12
votes
2answers
861 views

What are the common rendering optimization techniques for the geometry pass in a deferred shading renderer? [closed]

I have been developing a game engine using OpenGL 3 and C++ (and glfw for window management). I have advanced so far, got most of the things done except sound entities and optimizations. The engine ...
1
vote
1answer
96 views

SFML image extension for best performance

I am using SFML library in my 2D game. The Texture Class has a method to load an image from file: Texture.loadFromFile("image.*") Which file extension should I use to achieve best performance? ...
0
votes
1answer
113 views

Where to store OpenGL object id:s

When working with OpenGL, you often recieve integer id:s to keep track of OpenGL objects. For example, representing a simple mesh, you may have a number of references to objects like so: GLuint ...
1
vote
1answer
151 views

OpenGL Texture loaded but wont draw on Bind

I wrote my entire Texture loader by hand. I'm not using any Libraries. From what I gather the loading part is done correctly and stored in the texture class: Texture* TGATextureLoader::create(const ...