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

-1
votes
0answers
21 views

C++ Game Development [on hold]

I want to make games.For now simple 2D games, but I don't know from where TO START. I "know" C++, but i havent worked with classes.I want to begin with GAME development and I searched in the internet ...
-1
votes
0answers
19 views

Vertex buffer acting strange? [on hold]

I'm having a strange problem, and I don't know what could be causing it. My current code is identical to how I've done this before. I'm trying to render a rectangle using VBO and orthographic ...
1
vote
1answer
30 views

Problems with texture orientation in space

I am currently drawing texture in 3D space and have some problems with it's orientation. I'd like me textures always to be oriented with front face to user. My desirable result looks like ...
0
votes
2answers
49 views

Best way to detect if vec3 is between vec3(x) and vec3(y) in glsl

As titled I am sampling from a texture and if the color is somehow gray [vec3(.8), vec3(.9)] and an uniform is 1 I need to substitute that color with another one I am not a glsl veteran but I am ...
0
votes
0answers
44 views

How to do Cross Platform in own Engine? [on hold]

At the Moment I finished the first game with my game engine(if I wanna call it like that) which is based in LWJGL. Now i'm worring if I could do crossplattforming in my engine. I build me a tool tool ...
0
votes
0answers
21 views

Should I use SDL_Surface or SDL_Window? [on hold]

I am making an OpenGL game basically. I have just started out on the territory. I have seen tutorials which use an SDL_Surface for rendering to while other tutorials use SDL_Window and obtain an ...
-1
votes
0answers
26 views

3D mobile game development [on hold]

I am not a developer or programmer and, I am planning an educative project that will involve having students to develop a cross-platform, 3D mobile game, similar to the SimCity concept. I need to ...
-1
votes
0answers
56 views

Render To Texture Using OpenGL is not working but normal rendering works just fine [on hold]

DISCLAIMER: THERE IS A BIT OF CODE BECAUSE I ALREADY KNEW THE DIFFERENT QUESTIONS PEOPLE WOULD ASK example: "how did you make your shader attachments" "what was your order of rendering to the ...
-2
votes
0answers
39 views

Drawing a line using openGL does not work [on hold]

I am a beginner in OpenGL and tried to write my first program to draw some points and a line. I can see that the window opens with white background but no line is drawn. I was expecting to see red ...
1
vote
0answers
41 views

OpenGL - Cascaded shadow mapping - Texture lookup

I'm trying to implement cascaded shadow mapping in my engine, but I'm somewhat stuck at the last step. For testing purposes I've made sure all cascades encompass my entire scene. The result is ...
0
votes
1answer
92 views

Orthographic Projection Issue

I have a problem with my Ortho Matrix. The engine uses the perspective projection fine but for some reason the Ortho matrix is messed up. (See screenshots below). Can anyone understand what is ...
3
votes
1answer
43 views

glDrawElements vs glDrawArrays for polygons that do not reuse vertices

Is it better to use glDrawElements or glDrawArrays when not reusing vertices? There must be some difference, otherwise people would always use glDrawElements? I suppose the question could be ...
0
votes
1answer
38 views

Doing a turntable camera animation on a world matrix rather than view matrix

I have a camera class that contains a 4x4 view matrix as a member variable. Most of my camera controls work fine when doing them directly on the view matrix. In an attempt to unify all of my scene ...
1
vote
2answers
147 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 ...
0
votes
2answers
145 views

How many normals are needed to have a smooth surface?

I'm trying to draw a smooth cloth surface and I have a per-pixel shader. I expect to have a smooth surface but it's not the case. I think the problem comes from my normals. The image show the surface ...
0
votes
1answer
34 views

How can I prevent the viewport from stretching/distorting?

Basically, I want to know how I can remove distortion or stretching of the rendered image when the viewport/window size changes. The following images exemplify the distortion/stretching I'm talking ...
0
votes
0answers
24 views

GLSL 150 (or upper) per pixel lighting base code

I'm looking for a working example of smooth per pixel shading for one directional light I've seen this example http://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/lighting.php but its old GLSL ...
-5
votes
1answer
66 views

Slot machine effect on c++ [closed]

Am making some slot machine game in c++ and sfml for fun. Wanna have an idea to make the REEL effect wheen spin button is pressed.
1
vote
1answer
110 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 ...
1
vote
1answer
66 views

Does scaling affect performance in OpenGL? [closed]

I've never been able to understand the best practice in this context. I usually want to ship my game with as minimum size as possible. So whereever possible, I try to use scaling of my graphics. Let's ...
0
votes
1answer
54 views

NiftyGUI - Text isn't rendering

I am trying to create a gui with nifty on top of lwjgl. I've already had some problems during the Nifty setup, however now Nifty is set up and running correctly but for text rendering. Here is my xml ...
5
votes
1answer
174 views

How can glass breaking effect from Smash Hit be achieved? [duplicate]

I saw Smash Hit the other day and was amazed by the physics of the game, specially the shattered glass effect: I've read other posts about this subject but I still feel that they don't share enough ...
0
votes
1answer
22 views

Rendering a mesh in image viewport

I have a mesh made of nearly half to a one million vertices. I also have some 6-DoF camera poses around this mesh. At these poses I'd like to find out which of the 3D points of this mesh get projected ...
2
votes
0answers
66 views

How to calculate directional light frustum from camera frustum

I'm playing around with OpenGL for a few weeks now. For the following screenshot I picked the glm::ortho values for my lightsource by trial and error. There are two directional light sources with ...
2
votes
2answers
105 views

Water silhouette shader using GLSL

I have this problem to solve using Cocos2d-x 3.x: In my game there is water represented by rectangle texture, modified by the code on the go. I also have a character moving around, rotating etc. I ...
0
votes
0answers
17 views

VBO Normal and UV dis-placement [closed]

I am having some problems with my Voxel-World. The Normals and UV coordinates are dis-placed. I use raycasting to make me able to modify the world. Each time I modify a block. It changes the texture ...
1
vote
1answer
44 views

Is texture 1D array a valid way to handle object coloring?

I would like to render game UI, and for that I need rectangles. However, since a button could be textured just as well as solid color or (multistop)gradient a problem arises. I would also like all ...
0
votes
1answer
62 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 ...
0
votes
0answers
62 views

Drawing pathmap [Solved]

I am developing an editor for my game and I like to implement something like this (screenshot from wc3 editor): (I need the pathmap) I have one implementation already, I just store in chunk renderer ...
0
votes
0answers
40 views

how to feed and draw vbo [closed]

I got an error when I try to draw my vbo content. the error occurs on the draw command. error 1282 means Invalid operation. I try to update a vbo via data texture filled with positions. The ...
1
vote
1answer
62 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
60 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
65 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 ...
7
votes
2answers
141 views

How do games handle rendering Asian unicode text?

I'm currently in the process of implementing text rendering in my game engine, and I decided to utilize AngelCode's BMfont to generate font textures, and then have OpenGL render textured quads for ...
0
votes
0answers
64 views

OpenGL shading doesn't work with different projection and view matrices?

I found an online (public-domain) code to do marching cubes, and I am trying to adapt this code to work in my own project. The code uses GLUT and "older-style" OpenGL, whereas I am using GLM and ...
0
votes
0answers
66 views

Proper way to load pixel art textures for 2D graphics

I am working on developing a game using LWJGL which is the java bindings for OpenGl. I have just finished the code for loading and animating sprite sheets using a png and xml file. When the texture ...
0
votes
0answers
89 views

Frustum culling - error evaluating a point in the plane of the frustum

I am trying to implement the following code: http://www.lighthouse3d.com/tutorials/view-frustum-culling/geometric-approach-implementation/ I need to use frustum culling in my graphics engine. my ...
0
votes
0answers
32 views

Render just light, apply post processing and apply texture

Hi I have to apply a postprocess just on the irradiance and not on the colour texture, what is the best way to do the following: Render Irradiance (i.e. no diffuse colour) Apply post-processing ...
1
vote
0answers
52 views

OpenGL ES 2.0 state management best practices [closed]

I use a game engine with dynamic sprite batching for 2D games on mobile platforms (MOAI SDK). It already handles redundant state changes pretty well - with the use of texture atlases it only flushes ...
0
votes
0answers
47 views

Small detail displacement

Hi I am new here so sorry if the question is wrong somehow. I've implemented displacement with tessellation. I tessellate my mesh in the Tessellation Control Shader and then in the Tessellation ...
2
votes
1answer
48 views

GLFW mouselook under OSX

I'm continuing to port an OpenGL app from Visual Studio 2012 to XCode 5. The only major issue I'm having is mouselook. It "doesn't work" under OSX (Mavericks). Here's the (pseudocode): ...
1
vote
1answer
91 views

GLSL Processed Image to OpenGL

I've tried wording and rewording this question in various forms of search and can't seem to find an answer to it. If I'm wording it wrong and/or just not finding the right information, feel free to ...
0
votes
1answer
31 views

transformation before the perspective divide but after projecting perspectively

My problem is that I would like to confine a scene render to a (possibly rotated) rectangle without using glViewport(). I don't want to use it to save, if possible, some cycles that would otherwise be ...
12
votes
4answers
1k views

How can I use the graphics pipeline to render volumetric data based on a density function?

Both graphics APIs (OpenGL and DirectX) devise a well defined pipeline in which several stages are programmable. These programmable stages require to take a fixed minimum amount of data and are ...
0
votes
2answers
68 views

Technique suggestion to render corroded pipes

I've been tasked with an interesting piece of work and I was looking for some suggestions from some more experienced developers on how I should proceed with this. We currently have a lot of data ...
0
votes
1answer
45 views

lwjgl and slick util text over textured quad

So, I load a TrueTypeFont like this: private TrueTypeFont trueTypeFont; try { InputStream inputStream = ResourceLoader.getResourceAsStream("assets/fonts/main.ttf"); Font ...
0
votes
1answer
27 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
39 views

Loading non-square textures, from a 256x256 spritesheet in lwjgl(JAVA)

so I'm doing lwjgl, so far I have the loading of 16x16 textures from a 256x256 spritesheet all working, using this code to get the location of the textures: public Vector2f[] calculateUVMapping(int ...
0
votes
0answers
65 views

Drawing splines in OpenGL 4.1 Core

I'm trying to draw "glowing lines" based off a vertex list which defines control points for a spline. The effect I'm looking for is similar to a light saber. Sort of like , but curved and in 3D. ...
0
votes
1answer
30 views

OpenGL strange rendering problem when buffers have different sizes

I have encountered a very odd error in my program, "odd" in the sense that everything the API says suggests that the error should not occur. I have a bunch of 2D un-indexed vertex data, and I want to ...