Tagged Questions

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
101 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
288 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 ...
2
votes
1answer
43 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 ...
4
votes
1answer
160 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
178 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
20 views

Shader | Special Effect - Unit selection [duplicate]

I would like to know how the shaders used to show which unit is selected are made. Here is an image to illustrate. How the merge effect of the blue circles can be achieved ? I didn't found any ...
1
vote
1answer
71 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
107 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
65 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 ...
1
vote
1answer
157 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
75 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
140 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
279 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
127 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
135 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
95 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 ...
1
vote
0answers
94 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
49 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
96 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
114 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
33 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
2k 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 ...
1
vote
3answers
114 views

Technique suggestion to render corroded pipes in 3D

We currently have a lot of data relating to cracks/corrosion/deformations in metal pipes which at present, can be viewed in a crude flat/2D application which makes the metal anomalies hard to spot. ...
0
votes
1answer
124 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
90 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
68 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
93 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
36 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 ...
1
vote
0answers
57 views

OpenGL seems to be getting its colour from the wrong array on some machines

I have a OpenSceneGraph application which displays a 2D mesh and allows the user to make selections on triangles and vertices and colour them. If you aren't familiar with OpenSceneGraph, it's basiclly ...
1
vote
1answer
60 views

FBO result not drawing to screen

I recently added framebuffer rendering to my game and rendering to the FBO works (verified with glGetTexImage), but when I go to render a quad to show the result nothing is drawn to the screen. I'm ...
0
votes
1answer
162 views

3D picking for mouse move event

I implemented color picking recently and I would like to use it as kind of highlight when mouse is over an object but I am concerned about performance. Color picking requires whole frame to be drawn, ...
2
votes
1answer
62 views

Additive blending problems

I'm trying to get the blend of two images to work without luck. I have a render target on which I have an object, then I want to render again the same object in same position but with different ...
0
votes
0answers
41 views

Barycentric vertex coordinates in GLES 2.0

I have a certain set of polygons, which are stored in a vertex buffer and an index buffer. The polygons are textureless and normalless. The polygons are dynamic, their buffers get constantly emptied ...
0
votes
1answer
250 views

What is “ping pong” in the context of graphics rendering?

I have to render a scene, once per light, and blend the result of the various passes. I heard and read that one way to increase performances and render targets to use would be ping pong. I'm new to ...
0
votes
1answer
76 views

Planet terrain not connecting properly

I'm trying to generate some simple planets in OpenGL using libnoise (including noiseutils), but the terrain is not correctly connecting where the sphere "completes itself" and I was wondering if ...
2
votes
1answer
118 views

What types of matrices are needed for game and graphics programming?

I am writing a 3D math library for general game development and want to know what type of Matrix classes I should include. Is just a 4x4 matrix enough, or must I provide 3x4 and dedicated rotational ...
2
votes
1answer
159 views

Indexed Drawing in OpenGL not working

I am trying to render 2 types of primitives- - points ( a Point Cloud ) - triangles ( a Mesh ) I am rendering points simply without any index arrays and they are getting rendered fine. To render ...
4
votes
1answer
137 views

cost of texture change vs color change

How would I go about determining the difference in cost between changing the render color of an object every frame vice changing the texture (same sheet, just changing the source rectangle) every ...
0
votes
1answer
58 views

Can I directly pass a Boost ptr_vector list to glBufferData?

I have a data structure like this: typedef struct vertex_ { float x; float y; float z; float s; float t; }vertex; Then I add to a list called: boost::ptr_vector<vector> vertices; Is there a ...
1
vote
1answer
124 views

OpenGL render to texture causing edge artifacts

This is my first post here so any help would be massively appreciated :) I'm using C++ with SDL and OpenGL 3.3 When rendering directly to screen I get the following result And when I render to ...
3
votes
2answers
144 views

Render with multiple lights (one pass per light)

I have already a system that at the moment handle multiple lights just passing an array of light struct and loop through it. I had been told to switch to a multipass rendering approach. How should I ...
0
votes
2answers
70 views

Taking fixed direction on hemisphere and project to normal (openGL)

I am trying to perform sampling using hemisphere around a surface normal. I want to experiment with fixed directions (and maybe jitter slightly between frames). So I have those directions: vec3 ...
0
votes
2answers
123 views

c++ OpenGL framerate question

I am writing a simple 3D pacman using c++ and OpenGL. I'm new in OpenGL development, I wanted to make a small project before learning next concepts. For now I can't have more than 55fps when ...
0
votes
3answers
96 views

Is OpenGl still supported in C?

I'm reading the OpenGl superbible 3th edition (well I plan to) and it's all in C. Since this book was written in 2004 and all the other later versions are written in C++, i was wondering whether or ...
1
vote
2answers
138 views

GLSL to Cg: why is the effect different?

With reference to this question, where I was trying to make the shader compile, I am now trying to make an effect appear. The effect can be shown here, through a GLSL shader: But when I use the ...
0
votes
0answers
43 views

how decal projection works in opengl?

I want to draw a quad that fit on another mesh,how to setup projection matrix of this quad?I need an orthoprojection matrix right? At first I thought I only need to do some ray test of each vertex of ...
2
votes
2answers
87 views

Palette reduction to pre-defined palette

I'm writing a bunch of GLSL effects for fun, but I can't wrap my head around this. Basically, I want to reduce a texture's palette into a pre-defined set of colors. For example, a post-processing ...
0
votes
0answers
23 views

changing camera's reference point position by a keyboard event

I would like to change the camera's reference point position using gluLookAt. I would like that it changes when I press for exemle 'a'. I tried with: void VueOpenGL::Paint(wxPaintEvent&){ ...
0
votes
2answers
113 views

Passing variables down the pipeline glsl

I am sorry to post a question that may be easily tested, but I don't have an OGL4+ hardware at the moment and I have to make some design decision beforehand so I wanted a clear scenario. Looking at ...
2
votes
1answer
237 views

Assimp skeletal animation matrices

I startded to make an assimp only opengl skeletal animation demo. For that I used this: http://sourceforge.net/p/assimp/discussion/817654/thread/5462cbf5 And something is not correct in bone matrices. ...