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
0answers
6 views

Binding and unbinding, what would you do?

Let's assume the following example creation: glBindVertexArray(vao) glBindBuffer(GL_ARRAY_BUFFER, vbo) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indices) // Filling up buffers ...
4
votes
2answers
2k views

FBX Importer - Texture Name

I have a problem with the FBX SDK. I read in the data for the vertex position and the uv coordinates. It works fine, but now I want to read for each polygon to which texture it belongs, so that I can ...
0
votes
1answer
191 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
0answers
19 views

GLFW - Selecting an OpenGL Context before showing the window

I want to know how i can select an opengl context before displaying the window I have two different machines. One is opengl 3.1 and the other is opengl 3.3. I want to be able to select the context ...
0
votes
0answers
222 views

How to toggle fullscreen with lwjgl

I'm using glfw in lwjgl-3 to try to create a toggleFullscreen method. However it always gives me errors. I saw this question Toggle Fullscreen at Runtime but it didn't help because glfwOpenWindow() ...
4
votes
1answer
287 views

Projecting onto different size screens by cropping

I am building a phone application which will display a shape on screen. The shape should look the same on different screen sizes. I Decided the best way to do this is to show more of the background on ...
0
votes
1answer
101 views

Encoding Float to RG/RGBA and Blending

Encoding a float value inside a RG or RGBA texture is very interesting and useful but it is also become quite useless when you use blending as the result and the values might be altered because of ...
0
votes
1answer
31 views

Shadertoy getting help moving to glsl

I spent some time writing a shader on shadertoy but now, when I try to translate my code to opengl I don't know how to calculate the uv that they describe as like this: vec2 uv = fragCoord.xy / ...
6
votes
2answers
1k views

Atmospheric scattering and sky geometry

I'm trying to implement an atmospheric scattering in my graphics (game) engine based on the GPU Gems article: link. An example implementation from that article uses a skydome. My scene is different - ...
0
votes
1answer
471 views

GLSL: Strange light reflections

According to this tutorial I'm trying to make a normal mapping using GLSL, but something is wrong and I can't find the solution. The output render is in this image: in this image is a plane with ...
6
votes
1answer
2k views

Atmospheric Scattering

I'm trying to implement atmospheric scattering based on Sean O`Neil algorithm that was published in GPU Gems 2. But I have some trouble getting the shader to work. I've downloaded sample code of ...
2
votes
1answer
360 views

Ogre 3D Visibility Advice

I would like an advice about some real-time rendering optimization. I'm rendering a BSP level, by only using the mesh, textures, entities, and lightmaps, not using VIS at all. I'm trying to make my ...
2
votes
1answer
234 views

Rotation going wrong

I'm calculating matrices by hand. Translations are fine: void Translate (float x, float y, float z, float[4][4] m) { Identity (m); m[3][0] = x; m[3][1] = y; m[3][2] = z; } If ...
-1
votes
1answer
280 views

OpenGl / C++ and some strange light problem on half board [closed]

I have some problem with lights in my opengl "game". I have board with is square (-50,50), (50, 50), (50, -50), (-50,-50) x and z since y doesn't matter at all. I tried to make something like ...
-2
votes
2answers
1k views

Tilemap rendering with openGL (why the rendering is extremely messed up)

I'm using SDL & openGL to render a tile-map. The issue is that the tile-map rendering is extremely messed up, and I'm just a bit unsure what I'm doing wrong exactly. It should just be the first ...
0
votes
0answers
58 views

C++/OpenGl/SDL/Cmake Beginner curiosity [on hold]

and this is my first time in this forum. I just want to ask for an advise in here, I just dont know where to start. hopefully you can understand and help me. I want to start with a small game project ...
3
votes
1answer
230 views

Pyglet: text.Label().draw to FBO?

I just started OpenGL (PyopenGl) & Pyglet 3 weeks ago, and decided to read the Red Book. So sorry if my question shows my lack of comprehension... My question is: Is it possible to display/write ...
0
votes
1answer
103 views

How to make TMXTiledMap responsive?

I've been struggling with Cocos2d-x (C++) and finally I got to the point I feel more or less comfortable with that. My game is a 2D car-based one, with a straight infinite map where I've finally been ...
0
votes
2answers
128 views

Z-Value of clip-space position is always 1.0

I render a lot of quads on the screen into z direction (20 x 2000). I want to get the depth value in a final render target. But it looks like z is always 1.0f. I checked the result with the OpenGL ...
3
votes
1answer
59 views

Dual paraboloid shadows on GLSL

I'm trying to port an XNA example to OpenTK + OpenGL, I found it here http://graphicsrunner.blogspot.com.es/2008/07/dual-paraboloid-shadow-maps.html But I'm having a really hard time, I think my maps ...
0
votes
1answer
130 views

Invalid coordinates returned by glutMouseFunc()

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 ...
1
vote
0answers
23 views

Create texture atlas from loaded textures - OpenGL LWJGL Java [duplicate]

In my program I have objects with different textures, that are in the same vbo. I cant have an array of samplers in my shaderprogram, so i have to use a texture atlas. I have seen some ways to make a ...
3
votes
1answer
148 views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
3
votes
3answers
359 views

Passing array to uniform in glsl error

Here is my attemps to pass array to uniform array: struct Vector{ float x,y,z; } float threshold[2] = { 0.5, 0.25 }; Vector *kernel = new Vector[_kernel_size]; // _kernel_size==16 // fill kernel ...
1
vote
1answer
88 views

OpenGL poor performace with instanced drawing

I'm just started learning OpenGL and this is my first project besides tutorials. I'm trying to load a huge enginering model: The data is structured in a way that I thought I could use instancing ...
0
votes
1answer
50 views

OpenGL Shaders Ignored

I have been following this tutorial to try and start learning OpenGL. However, upon compiling my code, my triangle turns out to be black. At first I thought that there was something wrong with the ...
3
votes
2answers
96 views

Which consoles may I target with OpenGL?

I'm thinking on technical design for a game/game engine using OpenGL, and I wonder if there is any recent consoles (Xbox360, PS3, Wii U, Xbox one and PS4) that I could work with if I do so. I found ...
0
votes
4answers
863 views

OpenGL 2D Depth Perception

I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth perception is. So , for example, if the player goes in ...
0
votes
1answer
16 views

Using gl3w and Win32 api, without glut

I'm still a beginner, the example on skaslev's site require us to use glut as an interface to create a window. For some reason, I'm required to create a window purely with Win32 api, but I am not ...
0
votes
1answer
27 views

Rotating the view around the origin of the world coordinate system

In OpenGL (using shaders), I want to implement a system that will take the user's mouse as input, and then rotate the view about the origin of the rendered scene. So, I need to compute the view matrix ...
1
vote
2answers
670 views

How do I build Assimp with MinGW?

How can I build Assimp with cMake and MinGW? I tried, but I don't get a functioning library... Details of my attempt: I am trying to build the Open Asset Import Library (Assimp) but I have been ...
1
vote
1answer
1k views

Creating a 3D text mesh from a 2D glyph

I have thought of three steps for doing this: Acquire the vertex coordinates which will represent the glyph's form Extrude them Render Can you suggest a better method? Can you give me an insight ...
7
votes
6answers
2k views

Correct level of abstraction for a 3d rendering component?

I've seen lots of questions around this area but not this exact question so apologies if this is a duplicate. I'm making a small 3d game. Well to be honest, it's just a little hobby project and ...
1
vote
1answer
653 views

Geometry shader and triangle adjacency

I'm currently trying to change my project to use GL_TRIANGLE_ADJACENCY instead of GL_TRIANGLES. Following this question, I have managed to construct my index buffer fine, but when it comes to the ...
2
votes
1answer
43 views

Underwater Shader Animation Help

I found an underwater (distort) effect and I got it to work but somehow I cannot make it animate given the offset here: Fragment Shader code: uniform sampler2D fbo_texture; uniform float offset; ...
0
votes
1answer
312 views

How to compute matrix transform local/world on OpenGL

I'm developing an OpenGL program where each object / entity contains m_WorldPosition, m_WorldOrientation, m_WorldScale and m_WorldTransform (Vector3, Quaternion, Vector3 and Matrix4f). The problem is ...
0
votes
1answer
16 views

Passing data into a vertex shader for perspective divide

In OpenGL and GLSL, I am just learning about perspective projection and the vertex shader. However, I am a little confused about what data actually needs to be passed to the vertex shader, and what ...
4
votes
1answer
161 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 ...
6
votes
1answer
423 views

Multithreaded Game Loop

I'm trying to implement a multithreaded game loop. I already did that but had to use a few locks for that, which ruined the performance. After researching a bit I came up with this idea: Instead of ...
0
votes
1answer
103 views

Collision between a sphere and a mesh(height-map)

I am trying to implement a method that detects the collision between a sphere and a mesh and reflects the vector of speed. I have a method, that detects a collision between a sphere and a triangle and ...
1
vote
2answers
265 views

Tiled Rendering - Projection matrix

I'm trying to figure out how to perform tiled rendering of my 3d scene (OpenGL). The motivation is to cut the scene up into several textures, combining them into a single image for saving at a very ...
0
votes
2answers
39 views

Render specific part of a texture in OpenGL (2D Sprite Sheet)

I've looked at this answer to find out how to render just a part of a texture: http://stackoverflow.com/questions/6884285/c-opengl-render-part-of-an-image I tried that, but the problem is, this is how ...
0
votes
0answers
54 views

Octree Frustrum Culling

times came when i had to implement some culling into my engine. I started by reading some stuff and so far so good. I managed to create an octree which can effectivly divide my geometry's vertices ...
0
votes
1answer
205 views

Trying to implement Camera

I'm trying to implement a Camera class in order to walk and look on the world as follow: #ifndef _CAMERA_H_ #define _CAMERA_H_ #include <glm\glm.hpp> class Camera { public: Camera(); ...
0
votes
1answer
101 views

Small text is very light / faint with FreeType and OpenGL

I'm able to render large text with FreeType just fine: But when I want to render small text (and the only parameter that changes is the font size), the quality is much poorer: As you can see, ...
0
votes
1answer
479 views

OpenGL Tessellation makes point

A little problem with my tessellation shader. I try to implement a simple tessellation shader but it only makes points. Here's my vertex shader : out vec4 ecPosition; out vec3 ecNormal; void ...
0
votes
1answer
95 views

Java OpenGL Perspective matrix not working

I'm trying to render a simple triangle with OpenGL in Java using LWJGL3. Everything is working great, but the projection matrix (perspective) is not working. In C++ I just used to apply the ...
1
vote
0answers
24 views

Vbo 3d triangle opengl w/ LWJGL

So i am using lwjgl, took me about 4 hours of hard work to achieve triangle rendering and vbos, now i want to render a triangle in 3d space. I know you have to use projection matrices. But when i have ...
5
votes
4answers
4k views

Can't understand these UV texture coordinates (range is NOT 0.0 to 1.0)

I am trying to draw a simple 3D object generated by Google SketchUp 8 Pro onto my WebGL app, the model is a simple cylinder. I opened the exported file and copied the vertices positions, indices, ...
0
votes
1answer
16 views

Using glm to rotate the modelview matrix based on the cursor position

I am rendering a 3D model of an object, and I want the user to be able to rotate around that object by dragging the mouse. To do this, I want to use the cursor position to continually update the ...