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 ...
1
vote
0answers
41 views
Understanding normal mapping
I am trying to understand the basics of normal mapping using this tutorial : http://ogldev.atspace.co.uk/www/tutorial26/tutorial26.html
What I don't get there is the following equation :
E1 = ( U1 - ...
0
votes
1answer
29 views
Get fragment from mouse position
I have a painting app for texture artists that I am working on. I am able to paint to a flat canvas that updates the texture of a 3d object in an object viewer. Now I want to be able to paint directly ...
0
votes
1answer
18 views
Passing array to uniform in glsl error
Here is my attemps to pass array to uniform array:
struct Vector{ float x,y,z; }
float threshold[2] = { 0.5, 0.25 };
Vector *kernel = new Vector[_kernel_size]; // _kernel_size==16
// fill kernel
...
0
votes
0answers
5 views
Problems with import project wrote in VS13 to Xcode - OpenGL [on hold]
ok so i started to wrote me project (c++) for school at windows with Visual Studio 2013,
because of some reasons Ive moved to mac and Xcode.
I used glut and openGL In my project so i included their ...
1
vote
0answers
54 views
OpenGL memory optimization and batching technique pitfalls
I'm studying OpenGL optimization techniques. What I'd like to achieve is to emulate as closely as possible Mantle/DirectX12 programming patterns (aggressive batching, flexible memory handling, complex ...
0
votes
1answer
23 views
Rotate heading relative to agent's local space
I'm having a little trouble translating a point in my game's world space to an object's local space.
I have a cannon in my game with a normalized heading vector that's always supposed to point in the ...
1
vote
1answer
41 views
OpenGL Post Processing Introducing Artifacts on Certain Systems
Playing around with God-Rays in my framework, I was greeted with the following artifacts on my laptop:
The artifacts themselves act almost like noise, flickering around the image rapidly. They also ...
0
votes
0answers
46 views
Disney Principled Shader in actual shader GLSL [on hold]
I am trying to learn python and the new OpenGL. I wrote few simpler shaders to implement basic lightning. After reading more I decided to see how the Disney Principled shader would look like.
I ...
3
votes
0answers
44 views
Texture loading: Everything at once OR un-/loading the needed assets?
Good evening. We've been developing quite a huge game for android on the basis of AndEngine. So we have a lot of assets to load, especially textures.
At the moment everything (sound, textures etc) ...
0
votes
2answers
34 views
How do I change a shape without affecting the rest of the screen?
I have drawn a shape like this in OpenGL:
glColor4f(red,green,blue);
glBegin(GL_QUADS);
glVertex2f(x1,y1);
glVertex2f(x2,y2);
glVertex2f(x3,y3);
...
-1
votes
2answers
73 views
How can I optimize these GLSL bitwise operations?
I need the following part of my vertex shader simplified.
Sb=Sb|((gl_VertexID&(128+1))<<9);
Sb=Sb|((gl_VertexID&(512+4))<<6);
Sb=Sb|((gl_VertexID&(2048+16))<<3);
...
0
votes
1answer
53 views
How can this kind of entity/component organization improve cache efficiency?
I've been reading up about entity component systems as a design pattern for an OpenGL engine. The style I'm trying to implement has entities only being integers, and components being long contiguous ...
0
votes
0answers
4 views
Setting up Freeglut on CodeBlocks [on hold]
I followed these instructions : http://wiki.codeblocks.org/index.php?title=Using_FreeGlut_with_Code::Blocks but when i compile the program the console print these errors :
||=== Build: Debug in ...
0
votes
2answers
38 views
Rotating an object with quaternion
I have a question in regards to using quaternions for the rotation of my graphics object.
I have a Transform class which has the following constructor with default parameters:
Transform(const ...
0
votes
1answer
33 views
First Person Camera Target
I have a camera at position P, and a normalized direction vector D (where the camera is facing). I want the target of the camera to be 5 units forward from the position. Here's my attempt:
F = (0, 0, ...
0
votes
1answer
48 views
SFML - How do I create an OpenGL context before showing the window?
I want to create an OpenGL context to initialize some assets before actually showing the window with SFML. How can I do this?
-2
votes
1answer
50 views
What does render in SDL2?
Good afternoon!
What does render in SDL2?
Is it possible to display text with a SDL2_ttf library without using a render, but only the standard OpenGL context?
-1
votes
2answers
33 views
An all-in-one place list of OpenGL context default values [on hold]
A complete list of OpenGL context default state?
Things like:
initially bound framebuffer (0)
initial color mask
initial blend function
default VAO
default fragment program ( no program)
It ...
0
votes
2answers
70 views
OpenGl indices array
I have a class terrain which create a grid of Quads. I do it like this
for(int z=0; z<_length;z++){
for(int x=0; x<_width;x++){
...
2
votes
2answers
48 views
What is buffer “target” in OpenGL?
What is a target in OpenGL, actually? For example, in the function
void glBindBuffer(enum target, uint bufferName)
I know what the function does (more or less), but the target was only a ...
2
votes
1answer
63 views
What are the implications of using multiple OpenGL Contexts on a single thread?
I'm trying to integrate two third-party OpenGL rendering pipelines into the same application, namely Cinder's OpenGL API for 3D drawing and backbuffer rendering, and Google Skia's API for 2D drawing. ...
1
vote
0answers
52 views
OpenGL Positional 2D Texture Masking
I have a simple 2D java game engine running using LWJGL. I have my own vertex and fragment shaders, and I'm able to render quads with textures.
I want to be able to mask one quad using the texture ...
0
votes
0answers
61 views
OpenGL for 2D game - Performance Optimization and Flexibility [closed]
I'm working on a 2D RTS game engine, the expected result is much like Red Alert 2, Starcraft 1 and Tiberian Sun (certainly, combined with modern technologies). Currently I'm using SFML for rendering.
...
1
vote
3answers
69 views
Rendering many similar objects [closed]
I am writing an city builder. The graphics should look pretty simple, there are no fancy models or textures. Something like Synekism. Thus I have only simple models for buildings and splines for ...
0
votes
0answers
14 views
Using glfont to display text [closed]
I am using glfont to display text on the screen. According to the website the I have written the the code which is displayed below . All I get is a square and the textures are not displayed . I am ...
0
votes
1answer
105 views
Is there a way to start with OpenGL 3.0+ without need to write my own shaders?
I'm starting with OpenGL and found out that after OpenGL 3.x you must write your own shaders (think it's obligatory). Am I right here?
I have made some research but I can't seem to find the answer.
...
-1
votes
0answers
64 views
OBJ Loader Incorrectly loads textures
I have this OBJ loader function that I have created within my Object class that loads in an *.obj file and when the object is rendered onto the screen the textures seem to be loaded incorrectly I ...
2
votes
2answers
48 views
Translating an object in the rotation direction
I am creating a graphical scene with OpenGL and SDL, and I'm running into a problem in regards to translating an object in its rotation direction.
Each of the graphical objects in the scene has a ...
1
vote
1answer
61 views
What is the fastest way of reading an atomic counter?
I have an atomic counter in my fragment shader that my application reads after each drawcall. I am currently using glMapBufferRange with GL_MAP_READ_BIT set. This absolutely destroys my applications ...
0
votes
1answer
35 views
Can drawing to an FBO be done purely with a depth input texture, or do I also need a color attachment?
I am trying to implement Exponential Shadow Maps and I've got it almost working. The part I am stuck on is the "optional" separable Gaussian blur of the depth map to give soft-looking shadows.
I am ...
1
vote
0answers
24 views
OpenGL: Avoid geometry shader for cubemap framebuffer
I want to render an environment map into a cubemap framebuffer but I dislike the fact, that I have to use the geometry shader to set gl_Layer because the geometry shader would be a basic passthrough ...
3
votes
1answer
118 views
glBufferData consuming system memory
I am memory profiling my game in Visual Studio and about 60% of memory usage is happening from calls to glBufferData(). I may be missing something but should this consume GPU memory instead of system ...
2
votes
1answer
54 views
OBJ file, face materials and drawing them with OpenGL
I'm implementing a model class which loads OBJ and MTL files, and ran into an issue or question with face materials.
Consider the following example: It's a cube with 5 sides Gray and 1 side Green.
...
-1
votes
0answers
41 views
Java LWJGL Rotating pistol with camera axis
I was writing a simply height-map based game and I wanted to add some range weapons like pistol. But I am stuck on the rotating part. My rotating on x axis was good. But problem starts when I want to ...
-4
votes
0answers
44 views
What is the state of opengl quad-buffer 3D support on nvidia GeForce GTX cards?
Recent posts on forums suggest that nvidia has added quad buffered stereo 3D support to drivers for their GTX cards. Despite nearly identical hardware, in the past only Quadro cards were able to do ...
0
votes
1answer
51 views
Do I necessarily need to write a vertex shader to use geometry instancing?
I've quickly read the GPU gem about geometry instancing, there are many wordings and I'm not sure I understand it well.
If I understand it well, when you use instancing, if you want to apply ...
0
votes
0answers
36 views
Trying to get the fragment shader to output a list
I am trying to figure out a way to get the Fragment Shader to output a list of gl_VertexID-s.
I want to use the GPU to get a list of vertices in the viewing frustum.
Is there any way I can get a ...
1
vote
1answer
68 views
Averaging normals, or tangents
I am using a library to load an obj but it doest compute the tangets for each vertex, which I need for normal mapping and pom. I computed my tangets, and bitangents, everything appears to be fine, but ...
0
votes
1answer
71 views
OpenGL light calculation
I want to add somebasic point lights to my OpenGL application. I read here that I have to caluclate the light in a pre-projection space:
Lighting can be done in any pre-projection space (e.g., ...
7
votes
2answers
530 views
What is the advantage of OpenGL's direct state access mechanism?
I've been reading about OpenGL 4.5 Direct State Access (DSA) at opengl.org and not sure if I'm getting it right.
It seems to imply, that the old way is less efficient:
glBind(something)
glSetA(..)
...
0
votes
0answers
10 views
How to setup States in NIftyGUI and LWJGL
I think this is a simple question but I just cannot figure it out. I have a main menu that is using nifty gui and then my game which is rendered using OpenGL Code (LWJGL) I cannot figure out how to ...
-1
votes
1answer
79 views
How can I get “Good enough” collision for entities? [closed]
I am developing a Pirate ship fighting game.
It's a great concept: Ships firing cannonballs, sinking each other, having to work as a team to complete the mission... But.. I've tested it with about ...
1
vote
0answers
64 views
glGetUniformLocation returns 23724032
as the title says, I have a problem using glGetUniformLocation call that returns, for the following code, the value 23724032. I'm writing a little engine and the draw function of my models is:
void ...
0
votes
0answers
32 views
Matrix, vector multiplications in OpenTK
I developed a 3d model viewer in c++ with OpenGL, and in c# in OpenTK. Both are using the same shader, but the output from OpenTK is not correct. I read that OpenTK is row major order, and OpenGL is ...
0
votes
0answers
18 views
Lwjgl Textures Overriding true type font
I am making a game in java but I recently came across a problem when I bound my textures, my true type fonts would start copying the texture and i would just see a wall of color where my words had ...
0
votes
0answers
49 views
What limits the number of vertices the GPU can process per clock cycle?
I am currently experimenting with OpenGL to make my own game. I wrote some test code to see what are the limits of my GPU. I own a Geforce 840m. This essentially consists of a draw command
...
0
votes
1answer
35 views
glPush/PopMatrix on projection Matrix?
I am trying to simulate a camera which is always at same distance behind my player, my plan is, to transform the projection matrix correctly with glPush/PopMatrix, as i do it with the modelview ...
0
votes
0answers
16 views
How to create freeglut/openGL template in codeblocks?
After the installation of gcc, codeblocks and freeglut-dev on my Kubuntu 14.04, i was trying to create a project based on openGL and freeglut, but i don't know where is located the freeglut ...
0
votes
2answers
51 views
Z-Value of clip-space position is always 1.0
I render a lot of quads on the screen into z direction (20 x 2000). I want to get the depth value in a final render target. But it looks like z is always 1.0f. I checked the result with the OpenGL ...
0
votes
0answers
26 views
Transformation order for augmented reality game using OpenCV and OpenGL
I'm trying to create a simple AR application where I'm augmenting the camera image of a Kinect with virtual objects that are tracked using an optical tracking system.
The following picture ...