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

Combine framebuffer-textures to default framebuffer

I know frame-buffers are not textures themselves, but they do contain a texture, given they are set up correctly, which I believe mine are, as: (status == GL_FRAMEBUFFER_COMPLETE) returns true. ...
0
votes
1answer
150 views

Directional shadow mapping view/projection matrices

I've got shadow mapping with directional lights working, but I believe I am constructing the view/projection matrices wrong. Here's how I build them: Mat4 viewMatrix = ...
1
vote
1answer
130 views

How to achieve anisotropic filtering

I am loading a texture and using glGenerateMipmap() on it to achieve some level of mipmaping. I get different result on nVidia gt 555m, and on Intel HD 3000. The texture rendered by nVidia is not ...
0
votes
1answer
133 views

Texturing a PyOpenGL 3D Cube with PySDL2

So, I've just started learning OpenGL with PySDL2, and I've created a class that will create a cube to the window that I've created with PySDL2. What I'd like to do now, is to figure out a way to ...
4
votes
3answers
412 views

How long does it take for OpenGL to actually update the screen?

I have a simple OpenGL test app in C which draws different things in response to key input. (Mesa 8.0.4, tried with Mesa-EGL and with GLFW, Ubuntu 12.04LTS on a PC with NVIDIA GTX650). The draws are ...
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?
8
votes
3answers
510 views

How can I create a glitter effect?

I am trying to create a glittering effect for my realtime shader but I don't know how. Here is one example, and another example. What technique can I use to implement this?
0
votes
1answer
88 views

How to use FrameBuffer objects (OpenGL)

I want to draw a 2D scene and after the scene i want to draw some light effects. When i draw some light, i create a FBO, draw in it and when finished with drawing, i want to create a texture where i ...
1
vote
1answer
82 views

Run OpenGL shader on part of a texture

How do I run an OpenGL shader on just a portion of an off screen texture and leave the rest of the texture unmodified? Are there any calls that restrict the sampled pixels to just a rectangle or do I ...
0
votes
0answers
36 views

LWJGL Importing .obj faces properly

I've created a simple OBJ reader. I am able to draw and render the object I created without using the texture or normal coordinates just fine. However, I'm trying to use all of the face portion in ...
2
votes
3answers
100 views

Order of render with transparency opengl

I tried to render using different render configurations (GL_BLEND_FUNC()) but I couldn't get the back object to render in certain angles. The first screenshot here shows one angle where the back ...
1
vote
0answers
55 views

FreeGLUT keyboard IO timing and synchronization

Using FreeGLut's keyboard callbacks, glutKeyboardFunc(); glutKeyboardUpFunc(); glutSpecialFunc(); glutSpecialUpFunc(); When in the glutMainLoop pipeline do these functions get called? In other ...
0
votes
0answers
28 views

PolygonRegion creating anr

I'm try create mask for cut texture. User moving finger on the screen and when he will up finger mask will created. My problem in, after user has long time moved on screen and up finger, mask start ...
0
votes
1answer
115 views

LWJGL Adding Textures with VBOs

I'm currently trying to texture a cube, but I am having no luck determining what the next step should be. I can load an .obj model from Blender into my LWJGL program just fine, and I can even make a ...
5
votes
3answers
302 views

What is the purpose of indices in 3D rendering?

Suppose you were creating a 3D cube in OpenGL. You implement the necessary vertex data for the object (cube). What would be the point of using indices? void CreateCube() { ...
1
vote
1answer
106 views

I can't seem to figure out what's causing this bug with the “layout” keyword in GLSL

I have a GL shader file whose first few lines currently look like this: #version 120 layout (location = 0) in vec3 position; layout (location = 1) in vec2 vertexUV; When I try to compile this ...
1
vote
1answer
208 views

How can I calculate a terrain's normals?

Im trying to implement basic lighting in Opengl 3+ (a sun) with this tutorial : http://www.mbsoftworks.sk/index.php?page=tutorials&series=1&tutorial=11 Im building a basic terrain and its ...
0
votes
2answers
148 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 ...
0
votes
0answers
44 views

How can I set the attribute index location?

I am trying to set up a shader which takes three input parameters. I have the following code: GLuint vert = glCreateShader(GL_VERTEX_SHADER); GLuint frag = glCreateShader(GL_FRAGMENT_SHADER); const ...
1
vote
2answers
176 views

How can I use ARB_debug_output with SDL on Windows?

I'm trying to port a small GL program that I've been working on from Linux to Windows. I have the following: window_ = SDL_CreateWindow(...); SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, ...
3
votes
2answers
149 views

Efficient per-frame constants in shaders

I have some variables that stay the same during the entire frame and will be used by a large number of the various shaders I use (several dozens). These include things such as the various transforms ...
14
votes
4answers
1k views

What does a matrix represent?

I began learning OpenGL recently and am having problems visualizing what matrices are and their role in computer graphics. Given the template of a 4x4 matrix like this: I would assume that each ...
-3
votes
1answer
84 views

GLSL does weird things to my view matrix [closed]

uniform mat4 model; uniform mat4 view; varying vec4 vColor; void main(){ gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = view * model * gl_Vertex; vColor = gl_Color; if(view * ...
1
vote
1answer
147 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 ...
2
votes
1answer
116 views

Is it bad-practice using left-handed coordinate system in OpenGL eye-space?

In the engine I am currently programming I want to use a left-handed coordinate system for eye-space instead of the glFrustum standard right-handed one. Is that in anyway considered bad practice?
0
votes
0answers
389 views

Shadow mapping shader sanity check

I'm making spotlight shadow mapping for OpenGL 4.3 deferred renderer and I do not get the desired results. Here's my fragment shader used to calculate spotlight and shadows for one spotlight: ...
2
votes
1answer
114 views

Assimp renders a partial amount of vertices

I'm building a 3D game, and i'm trying to load some assets with the nice Assimp library. The model should look like the one in the first picture, but instead, it takes the form of some kind of ...
1
vote
1answer
57 views

Indirect indexing (uv coords read from texture)

In the vertex shader, I need to make a texture fetch, where the texture coordinate itself is read from some other texture. vec2 uv = texture(someTexture,coords).xy; vec4 val = ...
0
votes
1answer
170 views

FBO blit depth buffer to screen?

I have an FBO in a deferred 4.3 OpenGL renderer, in which I setup the depth buffer of that FBO like this: GLCALL(glGenRenderbuffers(1, &mDepthbuffer)); GLCALL(glBindRenderbuffer(GL_RENDERBUFFER, ...
0
votes
1answer
72 views

glGenBuffers fails with 0x0, win7, glew [closed]

I try to run a simple renderer on my win7 machine but it dies at the first glGenBuffers call. The computer has an Intel HD3000 card, with the latest driver (OpenGL 3.0 support). I use glew 1.10 (self ...
0
votes
1answer
229 views

Import Blender files to SharpGL (openGL for c#) [closed]

please i have problem with import 3D models to SharpGL (openGL in c#). Have you got pls any project where is this problem solved? I need create any models in for example blender, and then import to ...
0
votes
1answer
107 views

Keep rasterized pixel amount constant

I have a scene that is rendered from the point of view of the light using an orthographic projection matrix. For an arbitrarily shaped and oriented object that doesn't change its shape or size in ...
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 ...
2
votes
1answer
151 views

Linear filter problem with diagonal lines on adjecent tiles

I am quite new at using OpenGL/GLSL. Basically, the project I am working on is my first 'real' experience with it. I do not know whether this is relevant, but I use libgdx for my project. Currently, ...
2
votes
1answer
76 views

Do glColorMask and glDrawBuffer accomplish the same thing?

I'm doing a shadowmap pass (only storing depth values) so I set glDrawBuffer(GL_NONE) to disable color writing for the moment. Yet, I see some tutorials also do glColorMask(GL_FALSE, GL_FALSE, ...
1
vote
1answer
112 views

Telling my shader when to use which Texture

So I've just managed to get Texturing via GLSL shaders to work and i can pass a sampler2d textureHandler + my uv coordinates into my shader to specify the texture to be displayed on my Tiles. Now im ...
2
votes
2answers
183 views

Shadow mapping with directional light?

I'm doing shadow mapping in my OpenGL 4.3 deferred renderer, and I'm starting with directional lights believing it to be the easiest. What I do not understand is how the view projection matrix is to ...
1
vote
1answer
119 views

How to enable geometry shader in OpenGL 4.2?

I'm porting my Direct3D-based engine to OpenGL and I'm using geometry shaders for rendering text characters (basically, textured billboards). D3D version works fine, but in OpenGL mode it gives only ...
0
votes
1answer
114 views

Spritefont in OpenGL

I develop in OpenGL using C# as programming language. I want to draw some text on the screen. For this i created a texture that contains all the characters. Now i am not sure how to continue. I can ...
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. ...
8
votes
4answers
284 views

Why nearby triangles tend to disappear?

I've just enabled back face culling and I'm noticing a weird behavior: when all vertices of my triangle is outside the view and 2 of them is behind me (I think) the triangle disappears. So to see it, ...
1
vote
1answer
92 views

opengl offscreen rendering in linux is slow [duplicate]

My opengl application runs at about 110 fps. The moment I add off-screen rendering, it slows down to 15 fps. I am using frame buffer objects and glReadPixels to render off-screen. I have searched on ...
0
votes
1answer
86 views

Indexed UV mapping problem [closed]

I am trying to map UV coordinates to indexed vertices with this code. I am using a vertex buffer, texture buffer, and index buffer (note the vertex and texture buffers are indexed in the same order) ...
0
votes
0answers
153 views

2D Sidescroller camera

I'm using OpenGL. For my tiles, I'm using a display list and I'm just using immediate more for my player (for now). When I move the player, I want to center him in the center of the window, but allow ...
13
votes
2answers
730 views

How can I simulate a limited (256) color palette in OpenGL?

On Twitter, I found this screenshot of a game in development: The image on top seems to be without any color limitation. But the two other pictures at the bottom have a 256 color palette. I want ...
1
vote
0answers
36 views

Sampler object not changing texture filter

I am currently binding a sampler object to a texture (GL_TEXTURE12 to be specific) with glBindSampler(12, sampler); and the initial settings are very visible compared to the textures own settings. ...
0
votes
1answer
105 views

Why are some of my normals facing away from the camera?

I'm trying to use WebGL to render some simple models, and I'm running into issues where pixels near the edge of my model are passing normals to my fragment shader that point away from the camera. This ...
1
vote
1answer
317 views

Skeletal animation with Assimp and glm

I'm trying to implement skeletal animation using assimp and glm. Everything seems to work, except for rotations. This is the code I use when packing assimp data into my own engine's format. I THINK ...
0
votes
2answers
146 views

Models are not rendered correctly. OpenGL

I'm working on my university OpenGL project and as a base of it I'm trying to combine several OpenGL tutorials, mainly tutorials from http://ogldev.atspace.co.uk/. The problem I have is that models ...