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 ...
0
votes
0answers
2 views
Reflection and shadows in OpenGL
I'd like to implement shadows and reflective surfaces in my OpenGL app.
I already have ideas which I will provide below. But I would like to ask someone more experienced than me before I put too much ...
0
votes
0answers
13 views
Geometry design and buffers
I'm making some tests with rendering stuff and I'm wondering how to design my Geometry class. For the moment, here is how I do:
Init: Stock array with positions, array with colors, array with ...
0
votes
0answers
16 views
Scaling along with Translation
I am transforming a rectangle from the screen's left-bottom to the screen's center by adding the translation and scaling. The whole animation is done in 100 frames.
The output i am expecting is:
...
2
votes
0answers
16 views
SDL_AddTimer + SDL_GL_MakeCurrent not working on Windows
I'm messing around with C++, OpenGL and SDL doing a game that should be able to run in Windows and Mac OS X.
I have a problem that only happens on Windows.
Let me describe the scenario.
First I ...
1
vote
0answers
60 views
How to shade hair (line segments) correctly in GLSL
I render my hair geometry in line segments. The problem I have is with the correct shading of the hair.
From what I've read I understood that I need the direction of the line segment and the ...
0
votes
0answers
31 views
Chroma Keying Shader
I want to apply chroma keying shader for my application. For this I used GPUImage plugin. In that I found GPUImageChromaKeyingBlendFilter class to satisfy my needs.
In plugin, ...
0
votes
0answers
19 views
Shadow bias selection with moving light
I've been looking at shadow mapping and although I managed to get them to work selecting an appropriate bias. The problem is when I start moving the light.
The shadows work fine for not extreme ...
0
votes
1answer
30 views
Does LibGDX abstract OpenGL ES away or can I still use my OpenGL ES knowledge?
I've been learning OpenGL ES, and am now turning my attention to using LibGDX.
My main concern with LibGDX is, if needed, will I be able to apply my OpenGL ES knowledge to something if needed and ...
7
votes
1answer
64 views
How can I profile the speed of my vertex and fragment shaders separately?
I'd like to know how I can check to see if either my vertex or my fragment shader is a bottleneck in my rendering pipeline.
I've read about using glQueryCounter with the GL_TIMESTAMP target to get ...
-1
votes
1answer
64 views
More than 8 lights without deferred shading / lighting [on hold]
I want to know if there is any technique (efficient) to use more than 8 lights in a scene made with OpenGL and GLSL. Without making use of deferred shading / lighting.
I have not implementadon ...
0
votes
0answers
54 views
Tile Collision - subtracting a minor value to the box size
I'm having a certain problem when doing collision checks on bounding boxes that have their edges aligned with upper or right tiles. It shouldn't count as an intersection but I don't know a good ...
1
vote
2answers
96 views
2D Outline shader in GLSL
I have a simple prototype with 2D worms-like destructible terrain.
I use a trivial shader to discard pixels based on a mask.
varying vec2 v_texCoords;
uniform sampler2D u_texture;
uniform sampler2D ...
0
votes
0answers
53 views
What languages should I learn for game development in the real world? [closed]
I know Java and C++ pretty well, but I'm just not sure which direction I should take my game development to make me a competitive candidate in the real world. Since I'm learning on my own, I was ...
1
vote
0answers
82 views
OpenGL Hello Triangle troubles [on hold]
Just trying to get the simple OpenGL hello world program set up and for what ever reason I just cant see why I can't get it to work.
I'm able to create a resizeable window and set the background ...
0
votes
0answers
30 views
Collision between player and heightmap
Im programming a small project, an opengl height map.
It is build of triangles, which points are fit to the right y position (read out of an image).
The player is represanted by a cuboid. (p1, p2, ...
3
votes
1answer
58 views
How do you create a game overlay that makes the underlying graphics inactive?
I've created a simple game, and I drew a large rectangle in photoshop with faded edges that I want to use to overlay the game until the user presses "Begin" (on the overlay). The problem I'm currently ...
0
votes
0answers
7 views
InvocationTargetException caused by IllegalArgumentException due to trying to create a new OpenAL instance
So, after creating this class, (in this LINK)
, I ran into a new problem, I recieved an InvocationTargetException, which is generally caused when a method is invoked and an exception is created when ...
1
vote
2answers
83 views
Bad pixels on shader when loading cached binary programs
I have been trying to cache binary shader programs in my game and load them accordingly using "glGetProgramBinaryOES" and "glProgramBinaryOES" respectively.
I was successfully able to cache and load ...
4
votes
0answers
56 views
Slow uniform array
I'm trying to use an uniform array of matrices in my compute shader. However, it's really slow. I've narrowed it down to this lines of code:
uniform mat4 someMatrixArray[64];
...
vec4 result = ...
1
vote
1answer
36 views
Handling multiple lights of different types in GLSL
I want to be able to support multiple lights of different types (point, spot & directional). Note that I also want to be able to render transparent/translucent objects, which rules out deferred ...
0
votes
0answers
32 views
Top-Left vs Bottom-Left origin [closed]
I have been working on a project trying to learn OpenGL through the LWJGL library that ports OpenGL to Java. I started this project with the code I had from some 2D game tutorials, but I never could ...
2
votes
3answers
249 views
GLSL Sphere from Vertex
I am working on a particle simulation where we have a lot of spheres which can have different radii. Using this tutorial http://mmmovania.blogspot.de/2011/01/point-sprites-as-spheres-in-opengl33.html ...
0
votes
0answers
30 views
CubeMap question (using openGL and SOIL) [closed]
I recently started to learn openGL from internet. I just can't figure out why my cubemap code fail. Could anyone give me some advice?
The background color is set to yellow. After compiling, it did ...
0
votes
0answers
39 views
Incorrect normals for OpenGL lighting [closed]
I have drawn a house with a slanted roof in opengl. I am having problem in defining the normals for the slanted roofs. It wont be parallel to the axes so this is what I have used:
...
2
votes
1answer
81 views
MSAA deferred implementation issue
I recently implemented MSAA in my deferred renderer, it looks good but I just got a feeling I might have done it wrong.
Here is what for example the directional light fragment shader looks like:
...
0
votes
0answers
36 views
gl_ClipDistance[] not working
I am unable to get gl_ClipDistance to work. The results I'm getting are the same as if I didn't enable clip distance.
I have called glEnable(GL_CLIP_DISTANCE0); and glEnable(GL_CLIP_DISTANCE1); in ...
0
votes
0answers
51 views
Sometimes my game runs fine, other times it's shaky, why?
I'm trying to learn how to make games. I just did this very simple 3D game where you control a cube that shoots at incoming cubes. Sometimes I start the game and it runs smoothly from start to end. ...
0
votes
1answer
26 views
Obtain linear depth values on FBO and deal with small differences
I've a render target on which I have both a color and a depth attachment. In a second pass I need to run a filter whose width depends on the derivative and values of the depth.
Now, if I try, in the ...
1
vote
1answer
104 views
Should all primitives be GL_TRIANGLES in order to create large, unified batches?
Optimizing modern OpenGL relies on aggressive batching, which is done by calls like glMultiDrawElementsIndirect. Although glMultiDrawElementsIndirect can render a large number of different meshes, it ...
0
votes
1answer
43 views
Can you specify which VBO/EBO to use with glDrawElements?
I'm creating a voxel-like game. I'm not sure if I am using VBO/EBO's correctly. I am creating a new VBO & EBO for every chunk. This is done once, but chunks call a render function in every block ...
0
votes
1answer
77 views
How to create a regular grid of triangles correctly?
I am trying to create an terrain using opentk/opengl.
I have a problem with the VBO/IBO.
I think a picture of the problem is the best way to show it:
I dont understand why the last triangle of a ...
1
vote
2answers
61 views
Accessing uniform variables from a Cg shader in OpenGL
I am trying to implement a simple PC program with OpenGL, using mandatorily Cg shaders (no Unity whatsoever).
I have found some tips on this page http://bobobobo.wordpress.com/2008/10/05/cg-1/ and ...
0
votes
2answers
65 views
Confusion over GLViewport
I'm hoping someone can help me understand the GLViewport and what happens when we resize it
This will illustrate my confusion....
So, here I have a quad stuck in the middle of the screen. If I ...
0
votes
0answers
17 views
Manual occlusion culling with glDrawElements [duplicate]
How should I go about doing occlusion culling with glDrawElements? I am dealing with voxel-like terrain. I want to avoid drawing the faces that are facing another block. I just don't know how to ...
1
vote
2answers
69 views
Keeping ratio the same across devices on fixed screen game
My game is an Android game using OpenGL ES 2.0 (But this question could apply to any platform).
I have read many questions on here regarding ratio management, and also read many tutorials outside of ...
1
vote
1answer
54 views
Normal Mapping space confusion
I've been reading today about normal mapping. Up to now, the only normal mapping I encountered was with maps already in world space so I just extracted the info from the texture and transformed them ...
0
votes
2answers
72 views
Was there any equivalent of glVertex3f in Direct3D?
I know that OpenGL's Vertex3f is a bit old but I can't find any information about suitable equivalent for that function that was used in DirectX. Was there any equivalent in DX?
0
votes
0answers
32 views
How to export blender coordinate to be used in Android OpenGLES
I'd like to create my personal light-weight Android 3D engine to show 3D animation
configured by Blender.
I have successfully loaded the Blender-created 3D models by OpenGL ES on Android. Now, I'd ...
0
votes
0answers
28 views
FBX SDK Colors problem
I've imported control points, normals, and indices successfully and now i'm trying to import vertex colors, but something is not right.
Here's the code:
FbxLayerElementMaterial* ...
0
votes
0answers
19 views
Having trouble with projection matrix, need help
I'm having trouble with what appears to be the projection matrix. Given a wide enough of a screen, when a cube is on the left and right most edge, the left or right wall will appear stretched to the ...
0
votes
0answers
14 views
How to switch a view off and on again while retaining key event input
I have a couple of views in my app - my main activity and a separate activity which is used for high scores.
What I need to know is how I can 'get rid' of one of the views temporarily, and then bring ...
-1
votes
1answer
62 views
Combine Two Shader Program [closed]
For my android application, I want to apply brightness and contrast shader on same image.
At present I am using gpuimage plugin. In that I found two separate program for brightness and contrast as ...
0
votes
1answer
35 views
Render on other render targets starting from one already rendered on
I have to perform a double pass convolution on a texture that is actually the color attachment of another render target, and store it in the color attachment of ANOTHER render target. This must be ...
10
votes
1answer
262 views
Rendering only a part of the screen in high detail
If graphics are rendered for a large viewing angle (e.g. a very large TV or a VR headset), the viewer can't actually focus on the entire image, just a part of it. (Actually, this is the case for ...
1
vote
2answers
133 views
OpenGL flickerinng near the edges
I am trying to simulate particles moving around the scene with OpenCL for computation and OpenGL for rendering with GLUT. There is no OpenCL-OpenGL interop yet, so the drawing is done in the older ...
1
vote
0answers
21 views
FBX Importer - Vertex Color
I imported vertex positions, indices and normals successfully in OpenGL using fbx sdk, but I just can't figure out how to import vertex colors. I tried to fetch the pointer to array of colors trough ...
0
votes
0answers
39 views
Creating a voxel chunk with a VBO - How to translate the coordinates of each block and add it to the VBO chunk?
I'm trying to make a voxel engine similar to minecraft as a little learning experience and a way to learn some opengl.
I have created a chunk class and I want to put all of the vertices for the whole ...
1
vote
1answer
121 views
OpenGL - have object follow mouse
I want to have an object follow around my mouse on the screen in OpenGL. (I am also using GLEW, GLFW, and GLM). The best idea I've come up with is:
Get the coordinates within the window with ...
0
votes
0answers
43 views
OpenGL Drawing textured model (OBJ) black texture
I'm using OpenGL, Glew, GLFW and Glut to create a simple game.
I've been following some tutorials and I have now a good model importer with textures (from ogldev.atspace.co.uk) but I'm having an ...
-1
votes
2answers
45 views
GLSL Normals not transforming propertly
I've been stuck on this problem for two days. I've read many articles about transforming normals, but I'm just totaly stuck.
I understand choping off W component for "turning off" translation, and ...