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 ...
4
votes
3answers
336 views
How do I find out which functions are deprecated for specific OpenGL profiles?
I would like to get the list of functions that are part of a certain OpenGL profile and the list of the ones that are deprecated so that I can avoid those.
4
votes
3answers
3k views
Where to look for good 2d c++ opengl game engine architecture?
I'm writing own game engine and want to look how other peoples implement game engine architecture. So any advices about well architected engines (even paid ones) are welcome.
4
votes
2answers
4k views
View matrix in opengl
Sorry for my clumsy question.
But I don't know where I am wrong at creating view matrix.
I have the following code:
createMatrix(vec4f(xAxis.x, xAxis.y, xAxis.z, dot(xAxis,eye)),
vec4f( ...
4
votes
2answers
2k views
In OpenGL Can I Discover the Depth Range of a Depth Buffer?
I am doing a GL multi-pass rendering app for iOS. The first pass renders to a depthbuffer texture. The second pass uses the values in the depth buffer to control the application of a fragment shader. ...
4
votes
1answer
4k views
How to render a texture partly transparent?
Good Morning StackOverflow, I'm having a bit of a problem right now as I can't seem to find a way to render part of a texture transparently with openGL.
Here is my setting : I have a quad, ...
4
votes
2answers
211 views
How can I determine a budget for RAM used (LRU involving VRAM, in particular)
After some profiling, I've determined that one of my most expensive functions involves drawing text. As a solution, I'd like to implement a LRU type of cache that will "remember" the vertices, tex ...
4
votes
3answers
2k views
Trapping mouse inside window in OpenGL with GLUT?
I perfectly understand that GLUT is limited and the following problem can't probably be solved with OpenGL/GLUT, but since I don't know exactly if it can or not, I better just ask. Maybe I'm doing ...
4
votes
3answers
938 views
OpenGL Vertex Attributes - Normalisation
Alas, I have searched, and have found no definitive answer.
When would you normalize the vertex data in OpenGL using the following command:
glVertexAttribPointer(index, size, type, normalize, ...
4
votes
2answers
176 views
3D models on 2D tilemap perspective when scrolling
I am creating a small top-down game, where the player traverses a 2D tilemap, with an illusion of depth provided by 3D models for things like buildings or trees.
Having gotten to the point where I ...
4
votes
2answers
192 views
Defining an OpenGL unit
I have read that you can define your OpenGL unit by using glViewport.
As far as I understood if you use something like glViewport(0,0,600,600) then 1 OpenGL unit = 600 pixels. Now my problem is what ...
4
votes
3answers
414 views
Anti-Aliasing for a game
Having read about anti-aliasing I came to realise that I could render my scene 8X times the original size of the screen and then shrink it to render it on my original screen to improve the effect that ...
4
votes
2answers
1k views
Integrate LibRocket With SDL And OpenGL
I been currently involved in a game project and we reach the point we're want to added the GUI for menus and other stuff but the time that we maybe spent developing our own system could cost us a bit ...
4
votes
4answers
856 views
C++ Game engine time scale
i have begun creating a very simple game engine and i am trying to work out how to create a time scale for the game.by time scale i mean some way of increasing and decreasing the speed of the game(not ...
4
votes
1answer
653 views
Middleware to Bring 3D Meshes into OpenGL ES 2.0
Say I develop a game for mobile platform running OpenGL ES 2.0. I have done 2D part, and now I wish to import some 3D objects.
The imported 3D objects must contain the following:
Vertices positions
...
4
votes
3answers
424 views
What resources are available to read and share pyglet code?
I am a Python programmer (I know the ins and outs decently well), and I have dabbled with Pygame. I want to make 3D applications and games, and so naturally I've been looking at OpenGL.
pyglet uses ...
4
votes
1answer
67 views
How to skip the sky in lighting shaders?
I recently implemented a sky in my deferred rendered game. It is a procedurally calculated sphere with a texture applied to it. Unfortunately all lighting shaders (light sources, ambient occlusion) ...
4
votes
1answer
187 views
deferred rendering and point light radius
I use a common attenuation equation for point lights:
attenuation = 1 / kc + kl * d + kq * d^2.
I use deferred rendering so I need to know a light radius. An example light has following intensity: ...
4
votes
2answers
170 views
Game has noticeable frame drops but when through a profiler it always runs smooth
I'm trying to optimize my PC game but I can find the bottleneck since every time I run it through a profiler (gDEBugger) it runs smooths. When running outside gDEBugger I get these annoying hiccups. ...
4
votes
3answers
6k views
glTranslate, how exactly does it work?
I have some trouble understanding how does glTranslate work.
At first I thought it would just simply add values to axis to do the transformation.
However then I have created two objects that would ...
4
votes
1answer
758 views
How do engines like Unreal relate to OpenGL or D3D?
Well I'm completely completely new to computer graphics and even more to game development. I am searching info and all that stuff to have the basics quickly. But there's a big question mark in my ...
4
votes
2answers
625 views
Ara matrices calculated on the GPU or on the CPU? Would built-in matrix functions be faster than my custom ones?
If I add a math library (for example containing a Matrix class) and use it in my program drawing with OpenGL, will my be work slower than if I used standard OpenGL functions for matrix calculations? ...
4
votes
1answer
134 views
Cheap ways to do scaling ops in shader?
I've got an extensive world terrain that uses vec3 for the vertex position attribute. That's good, because the terrain has endless gradations due to the use of floating point. But I'm thinking about ...
4
votes
1answer
865 views
Why the clip space in OpenGL has 4 dimensions?
I will use this as a generic reference, but the more i browser online docs and books, the less i understand about this.
const float vertexPositions[] = {
0.75f, 0.75f, 0.0f, 1.0f,
0.75f, ...
4
votes
1answer
998 views
Access vertex data stored in VBO in the shader
If I wanted to store extra data in a VBO for skinning (indices for indexing into an array of matrices of bones and floats for applying weights to those bones) How would I go about accessing that data ...
4
votes
1answer
508 views
Multiplication for MVP matrices: Any benefits to doing so within the vertex shader?
I'd like to understand under what circumstances (if any) it is worth doing MVP matrix multiplication inside a vertex shader.
The vertex shader is run once per vertex, and a single mesh typically ...
4
votes
2answers
821 views
Should the modelview and projection matrices be calculated in the shader or on the CPU?
At minimum I would have a camera with rotation and world position; projections parameters such as angle of view and perspective vs. orthographic; and meshes with scale, angle, and world position.
...
4
votes
1answer
982 views
How to invert background pixel's color
I'm writing a game and map editor using Java and jMonkeyEngine. In the map editor, I've got a brush done by wireframed sphere. My problem is: I want to make it visible everywhere, so I want to invert ...
4
votes
3answers
585 views
Why would GLCapabilities.setHardwareAccelerated(true/false) have no effect on performance?
I've got a JOGL application in which I am rendering 1 million textures (all the same texture) and 1 million lines between those textures. Basically it's a ball-and-stick graph.
I am storing the ...
4
votes
2answers
3k views
Does Unity for PC use Direct3D or OpenGL?
I am a mac developer using Unity and I hardly use a PC. When you build a Unity game for Windows, does it use Direct3D or OpenGL?
P.S. I'm not sure if it's called Direct3D or DirectX
4
votes
2answers
330 views
Is there an efficient, available online, algorithm for converting a matrix of squares into a triangle strip?
Imagine having a 4x4 square, with 16 smaller squares inside of it, with associated data on what the squares should look like (ie., opacity, colour, etc...).
Is there an existing, efficient, ...
4
votes
2answers
169 views
generating animations in runtime
i am creating my 3d game engine using Opengl.
this question might sound stupid to you but i am still in the process of learning, i have a 3d animated girl that slaps guys of different talls on the ...
4
votes
1answer
137 views
OpenGL, fetching the names of all uniform blocks in your program
I want to auto-bind uniform blocks with certain named values to certain binding points when I compile a shader. For example, I have some basic, default fixed binding points that are always used for ...
4
votes
2answers
257 views
How to create a scope for a sniper
I am developing a first-person shooter/strategy game using the Lightweight Java Game Library, which has support for OpenGL. I would like to create a sniper which I need to magnify the screen and ...
4
votes
1answer
300 views
Octree implementation for fustrum culling
I'm learning modern (>=3.1) OpenGL by coding a 3D turn based strategy game, using C++.
The maps are composed of 100x90 3D hexagon tiles that range from 50 to 600 tris (20 different types) + any ...
4
votes
1answer
913 views
Interleaving Arrays in OpenGL
In my pursuit to write code that matches todays OpenGL standards I have found that I am completely clueless about interleaving arrays. I've tried and debugged just about everywhere I can think of but ...
4
votes
2answers
1k views
Resources for 2D rendering using OpenGL?
I noticed that there is quite some difference between 3D and 2D rendering using OpenGL, the techniques are different - pixel-perfect placing is a lot more desirable, among other things.
Are there any ...
4
votes
1answer
1k views
Why does my GLSL 1.20 shader not work with an OpenGL 4.0 driver?
I'm just starting out with OpenGL on Linux. In order to write future-proof code, I explicitly wrote code for OpenGL 4.0 Core Profile in the first place, thus the shaders are GLSL 4.0.
That worked ...
4
votes
3answers
2k views
How can I draw the depth value in GLSL?
I want to draw the depth buffer in the fragment shader, I do this:
Vertex shader:
varying vec4 position_;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
position_ = ...
4
votes
1answer
438 views
Managing Game Entity coordinates
In my Game I'm currently have "Scene Coordinates" which are the X,Y coordinates relative to a Game Scene.
In that Scene there are Game Entities, let's say there's a GameEntity A in x=100.0, y=100.0 ( ...
4
votes
1answer
674 views
GLSL shader without a vertex array
Ok so I have a idea for a neat GPU driven curve renderer, and I realised that the vertex shader can be hardwired to generate points of the curve segment (to be rendered as a line strip) without ...
4
votes
2answers
292 views
C++/OpenGL Game - How to Make it Compatible with Screen Recorders?
I'm developing a 3D tower defense-like game in C++/OpenGL on Windows.
The problem I'm having isn't about the game itself (the game runs fine), but it's about using screen recording software to record ...
4
votes
1answer
380 views
Can I use the default depth buffer when drawing to FBO?
How to attach default depth buffer to FBO?
How to use depth renderbuffer buffer attached to FBO (after drawing to it) as a default depth buffer?
Basically I want to use the same depth buffer for both ...
4
votes
1answer
464 views
Selectively applying overlay shadows in a 2D tile based game
I'm currently building a top down 2D tile based game using OpenGL. There are three tile layers, the background layer, player/sprite layer & foreground layer. The foreground layer is pretty much ...
4
votes
1answer
634 views
How does one get adjacency information in a geometry shader?
If you use triangle_adjacency as the input type of a geometry shader, do you need to do something on the client side besides make the primitive mode triangle_adjacency?
Basically what I'm asking do ...
4
votes
1answer
215 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 ...
4
votes
1answer
912 views
opengl lighting with textures
I'm using OpenTK and working in C#, if that matters. I'm trying to get lighting effects on a textured object. I'm using obj and mtl files to define them. No matter what I try my object is either ...
4
votes
2answers
238 views
Level of detail algorithm not functioning correctly
I have been working on this problem for months; I have been creating Planet Generator of sorts, after more than 6 months of work I am no closer to finishing it then I was 4 months ago. My problem; The ...
4
votes
1answer
857 views
GLSL default shaders
I've been arming my engine with error checking code. I'll try to describe this situation to my best abilities. Whenever i load a shader and there's an error (file doesn't exist, compilation error, ...
4
votes
1answer
222 views
Translation from one coordinate system to another having Z-offset issues
I'm using ARToolkit to do an augmented reality application, but my problem is really with the 3D coordinates.
In this application, I use my webcam to generate the scene. I have two markers (printed ...
4
votes
1answer
192 views
What is the proper way to maintain the angle of a gun mounted on a car?
So I am making a simple game. I want to put a gun on top of a car. I want to be able to control the angle of the gun. Basically it can go forward all the way so that it is parallel to the ground ...
