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

2
votes
2answers
105 views

Lasers in 3D space game

I am creating this little 3d space shooter and am somewhat unsure on how to implement the laser beams. I'm thinking about something along Star Wars and the like where mostly you shoot rather short ...
0
votes
1answer
23 views

useful way for coloring 3ds object in opengl

I have been working in making plane in blender and it has many materials over than 90 , and now I need it in an opengl project with c++ , but as you know if I but the 3ds file the plane color is ...
0
votes
0answers
13 views

Adding a 2D transformation matrix to GLSL

I'm having trouble understanding the matrices I need to render an object in OpenGL. I've been using a matrix to make up for the translation and scaling from the camera in my game but I didn't have a ...
7
votes
3answers
147 views

Using full resolution of depth buffer for 2D rendering

I'm working on a front-to-back renderer for a 2D engine using an orthographic projection. I want to use the depth buffer to avoid overdraw. I have a 16-bit depth buffer, a camera at Z=100 looking at ...
1
vote
0answers
26 views

Find camera coordinate of vanishing point

Given a vector and a camera (position, angle, up vector, field of view, etc), how would I find the vanishing point of the vector in camera space?
0
votes
1answer
36 views

Free camera rotation in 3D space

I'm using a view matrix to do camera movement and rotation. viewMatrix = new Matrix4f(); viewMatrix.setIdentity(); Matrix4f.rotate((float) Math.toRadians(rx), new Vector3f(1,0,0), viewMatrix, ...
1
vote
2answers
74 views

GLFW / OpenGL location and size in pixels

I'm using GLFW to create a little game. (and by little, I mean: small, nonprofit) After a while of puzzling, I found out that this draws a texture (from an image, for instance) to the screen: (the ...
2
votes
0answers
28 views

Cannot convert bitmap to texture

I'm doing a little C# / OpenGL project and I can't manage to load textures properly. So here is my texture class : public class Texture { public String Filepath; private int TextureID; ...
0
votes
2answers
36 views

How to set black borders in rubik cube using opengl GLSurfaceView android java

I am new in android game development.I have a problems to set the cube face color with black border. public void setupSides() { int i, j, k; // Paint back blue i=0; for(j=0; j<dim; j+=1) { ...
-1
votes
1answer
34 views

Java libgdx get clicked square without iter

I would like to detect which square is clicked without iterating over all elements! i don't want to do this anymore for all elements. if( x >= this.getAnchorX()-HalfWidth && x <= ...
3
votes
0answers
122 views

Skeletal animation in OpenGL

I'm using Assimp to do skeletal animation in my OpenGL application. I used Blender to export this one-boned model to a COLLADA file: The model has only one bone, called arm bone, that controls the ...
1
vote
0answers
39 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 ...
0
votes
0answers
36 views

Transparency in GLSurfaceView

I am new in game development .I have a class which extends GLSurfaceview and we add this class in xml file and that xml file pass in main activity i want to make transparent that class. we already use ...
1
vote
1answer
57 views

How to only render fragments with Z from 0 to 1 in OpenGL?

I have been using OpenGL for a year now, but I just recently found out that OpenGL only clips vertices when the absolute value of the x,y or z coordinate is less than the absolute value of w ...
0
votes
1answer
26 views

wrongly scaled on cocos2dx 3.2 when render to multiple fbo (more > 1 deep)?

i have bug that only happen when retina flag disabled. i try draw multiple render texture to achive some multi post effect: so i have 3 render texture, fbo 1 for final pos effect fbo 2 for back ...
1
vote
1answer
64 views

Rotating a swinging sword in LWJGL gives wierd results

I'm making a 2d top down game in Java using LWJGL(OpenGL, essentially). I recently tried adding a swinging sword mechanism. My coordinate system is set to the bottom left FOR ALL objects. The rotation ...
0
votes
0answers
24 views

In OpenGL on Android, how do I give quads a border color?

I am new to game development and I'm working on a Rubiks cube game in Android using OpenGL. I want to create a cube with black borders, but I can only manage to set the fill color: GLColor[] colors ...
0
votes
1answer
35 views

How to draw 2d above 3d scene?

I have an OpenGL(3.3)+GLEW application. I want to draw a black vertical rectangle at the left side of the window for writing some information on it, like fps (I use GLEW function for drawing text). ...
0
votes
0answers
39 views

Shader - Simple SSS lighting issue

I am trying to create a simple subsurface scattering effect using a shader but I am facing a small issue. Look at those screenshots. The three images represents three lighting states (above surface, ...
0
votes
1answer
61 views

loading a texture in Opengl

I am working on a graphics project I want to make a city using opengl with c++ anyway in the last few days I have been trying to load a texture but it didn't work with me in any way I have tried many ...
1
vote
2answers
34 views

glutPostRedisplay() is not redrawing after updating model view matrix

I am trying to change the rotation of my object with keyboards, when I move the object in the direction of x, y or z it is okay, it is responding correctly. But when I try to change rotation, it does ...
0
votes
3answers
95 views

Editing the pixels of a rendered image

I want to render a simple OpenGL scene as usual, but then I want to superimpose a small image of my own (such as from a bitmap file) on top of the render, such that this image always shows. For ...
1
vote
0answers
18 views

ThreadAffinity being changed by OpenGL / ChoosePixelFormat

If I change thread affinity and then create the window used in my OpenGL game it changes the thread affinity to something else. I tracked down the exact API call (ChoosePixelFormat) which changes it ...
3
votes
2answers
155 views

What state is stored in an OpenGL Vertex Array Object (VAO) and how do I use the VAO correctly?

I was wondering what state is stored in an OpenGL VAO. I've understood that a VAO contains state related to the vertex specifications of buffered vertices (what attributes are in the buffers, and what ...
0
votes
0answers
32 views

Coordinates estimation

Hi im using artoolkit to extract the coordinates of the marker im detecting with the camera. I need to know the values returned when arGetTransMat is the coordinates (x,y,z) which is returned ...
0
votes
0answers
33 views

How to calculate multiple collision of sphere and triangles?

I have a sphere and a mesh(triangles). When the sphere intersects the triangle, I reflects the vector of speed and everything works fine. But I can't write a good implementation for multiple ...
-4
votes
0answers
50 views

OpenGL Designer Wall [duplicate]

I created a 3D room using a cube. Now I want to have something like this (only the wall, ignore the frame and bulbs) Right now I am getting something like this :
0
votes
0answers
42 views

Creating Lighting effect in openGL [duplicate]

I am trying to make my wall have the same color and shade as the walls shown in the picture (Please ignore the frame and the bulbs). I can create a a cube and view it from inside but how can we give ...
0
votes
1answer
33 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
89 views

Shader - Color blending

I would like to know how to blend colors in a specific way. Let's imagine that I have a color (A) and an other color (B). I would like to blend them in such a way that if I choose white for the (B) ...
0
votes
0answers
18 views

LWJGL Using .setIntialBackground and Drawing Textures?

I have been trying to create a game with LWJGL, however I have recently discovered that changing the background color using Display.setInitialBackground() with glClear and trying to draw a texture at ...
0
votes
1answer
44 views

How to Load a Level for use with the Bullet Physics Library

I am trying to use a level in .obj format loaded with Assimp to generate a btBvhTriangleMeshShape to use with the Bullet physics library. I can successfully load btConvexHullShapes as well ...
2
votes
3answers
214 views

What's the best way to organize small textures in OpenGL?

What's the best way to organize small textures in OpenGL—having them all in a big texture and selecting them with texture coordinates, or using individual OpenGL textures? Until recently, I used to ...
0
votes
1answer
49 views

OpenGL Blending Format

In OpenGL, is there a format for a texture in glTexImage2D that prevents blending, or do you have to disable it using glDisable(GL_BLEND). Reason for use is that I would like to store additional data ...
-3
votes
0answers
49 views

3D Fractal terrain generation

I have a problem with my terrain, each time I get a strange terrain. I don't know where is exactely the problem. Here is my MidPoint dispacement function: bool terrain::MPD(int x1,int y1,int x2,int ...
0
votes
0answers
51 views

OpenGL MD5 Model Animation. Performance issues

A time has come when i had to implement an Animation to my Engine. I started with standart MD5 mesh/anim format since i find it easy to understand. I managed to implement a simple MD5 loader and i can ...
0
votes
0answers
29 views

OpenGL - Cubemap “Rotating” Proportional To Camera Movement

I'm doing a simple planet rendering project and am running into an issue with accessing cubemap textures correctly. The planet terrain is generated using the diamond square algorithm done 6 times and ...
1
vote
1answer
37 views

Modern OpenGL Texture Displaying Incorrectly [closed]

I've been working with this code and have simplified it to the most basic form possible, and even then I cannot get a texture to display properly at all. Here is the code: ...
0
votes
1answer
51 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 ...
1
vote
0answers
64 views

Transformed Vertices have wrong Z Axis

For quite some time I've been working on my open 3D game engine, to learn how this stuff works. You can see the full codebase relating to my problem here on GitHub. I'm using an OpenGL 3.3 Core ...
0
votes
0answers
56 views

OpenGL Diffuse Lighting Issue

I seem to have a problem in my OpenGL scene where if I (the camera) am looking at an plane it's brightness changes depending on what angle I am to the plane. It seems as though the camera is a source ...
0
votes
1answer
50 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
1answer
52 views

Shader - Convert vector into scalar

I am trying to convert a half3 as a simple half but I am facing an issue. As for an example half3(1, 0, 0) give me white but half3(0, 1, 0) gives me black. How can I convert properly a half3 to a ...
0
votes
3answers
56 views

Problems Animating Texture in OpenGL

I'm trying to animate a texture to scroll a static screen for a television, however I'm having some issues. Just translating within the texture matrix animates all textures in the scene which is ...
0
votes
1answer
54 views

Depth Stencil Buffer

In OpenGL, what is the difference between GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL? I have looked around and have been unable to find a clear explanation. Information on their usage with GLSL would ...
0
votes
0answers
28 views

Is it reasonable to generate mipmaps on the color attachment of my framebuffer in realtime?

I'm looking into hdr tonemapping and so far all the equations I've found result in really, dulled results. One i haven't tried uses an average luminance of the image. The pdf I've been reading ...
2
votes
1answer
57 views

Proper normal vector transformations in normal mapping

Hello! This question is about transforming normal vectors from normal maps properly. I have tried methods from over five sources, still can't get it to work, and I'm really desperate. Included are ...
0
votes
1answer
59 views

OpenGL ES 2.0 2D-Image displaying

I have followed the official OpenGL ES tutorial to create a working OpenGL-environment. I have been able to do anything I wanted to except for displaying 2D-images. To do so I worked through this ...
0
votes
1answer
118 views

DirectX11 Equivalent of OpenGL code

I am currently porting parts of my engine over to D3D11 from OpenGL and was trying to figure out how I would accomplish the following blending functions in D3D11. glEnable(GL_BLEND); ...
0
votes
1answer
58 views

Texture rotation inside a quad

How can I rotate a texture inside a quad without rotating the quad? Here's the code but I'm rotating the whole quad here. glBindTexture(GL_TEXTURE_2D, texName5); glMatrixMode(GL_TEXTURE); ...