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 ...
1
vote
2answers
29 views
Why is OpenGL point (0,0) in bottom-left?
Most of computer graphics systems use screen's top-left corner as staring point, but OpenGL uses bottom-right, why?
0
votes
2answers
18 views
LibGDX: Max number of textures?
I've been developing a game targeted at android. I know not to think about program optimization until the project is finished, but I have to wonder how many textures most phones can handle safely ...
0
votes
0answers
19 views
Hidden surface removal using z buffer algorithm
I am doing a work on clipping and hidden surface removal on a list of triangles in 3D. Say, I have got a list of triangles after clipping and projection transformation applied on them. Now I want to ...
0
votes
1answer
43 views
Trying to abstract OpenGL model loading but can't draw triangle… (C++)
Recently, I have been trying to learn modern OpenGL and I think I've grasped it (or the basics, at the very least.) but I have been having issues trying to make a triangle display on the screen but it ...
0
votes
0answers
17 views
Can see triangles in translucent/transparent object OpenGL
I added a sphere to my scene in OpenGL and tried modifying the alpha values of its vertices in the fragment shader. However, the result is that I can now see through half the triangles on the object ...
-1
votes
1answer
54 views
Why bind only first attribute?
I'm create OpenGL renderer, but when I bind vertex attributes I can attribute only first attributes. Where I got error?
My code:
Mesh::Mesh(Shader &shader, int size, GLuint *indices) {
...
5
votes
1answer
61 views
Difference in glDrawArrays and glDrawElements
While refreshing my mind on OpenGL ES, I came across glDrawArrays and glDrawElements.
I understand how they are used and sort of understand why they are different.
What I do not seem to understand ...
0
votes
1answer
34 views
Issue with tangents/bitangents generation for normal maps
I'm generating tangents and bitangents for a normal mapping effect and while using the same method as several tutorials, I get tangents that are not very continuous.
Here, we can see on the sphere ...
1
vote
1answer
102 views
Simplest way of skeletal animation in openGL
I am not interested in using easy libraries like assimp which will import collada files with ease to get skeleton animation done.
I wanna know what is the minimal requirement to get the animation ...
0
votes
1answer
28 views
Modifying UV's origin on shader (OpenGL)
Is there a way to change the UV's origin (bottom-left) on shader?
0
votes
1answer
48 views
OpenGL Draw calls and optimisation and future reference
How much costly is a draw call?
What are the ways to reduce the number of draw calls?
I have seen people using glMapBufferRange but I can't figure out how it improves the performance.
What book ...
1
vote
2answers
26 views
Gldraw call asynchronous or not
When i call gldrawarrays with a large set of data will the function return only after drawing all the vertices or will it happen asynchronously b/w cpu and gpu?
Also how does vsync work. Aren't they ...
1
vote
1answer
46 views
OpenGL tesselation doesn't change geometry shape
I implemented tessellation control and evaluation shaders in OpenGL, but the effect it has on my terrain was not what I expected.
I expected that the low poly-count curves and shapes on the terrain ...
0
votes
1answer
41 views
Multithreading problem in openGL?
Let's say that I have two threads.
Both of them generates and binds to a vbo separately.
If I join and run these threads the behavior will be undefined obviously.
Because one may generate the vbo ...
1
vote
1answer
21 views
alpha test shader 'discard' operation not working - GLES2
I wrote this shader to illustare alpha test action in GLES2 (Galaxy S6).
I think is not working at all cause I don't see any change with or without it.
Is there anything Im missing?
Any syntax error?
...
0
votes
1answer
27 views
How to draw textured tile map in opengl
I am trying to create a textured hexagonal tile map in opengl. I have the VBO and respective index buffer. Additionally I have a texture atlas for texturing individual tiles. I'm attempting to create ...
0
votes
0answers
14 views
Game Dev in Xcode, How do I make a bundle
So I'm making a 2d game as a school project using c++, openGL and GLFW.
My team only has MacBooks, so we're using Xcode which none of us have used before.
Later on down the road we'd like to be ...
0
votes
2answers
23 views
GL how to look at the center of the viewport
I'm using GLFW3 and OpenGL to visualize measurements from an IMU that I have. I've gotten the simple cube example working and I can rotate it successfully with quaternions that I've input.
However ...
0
votes
1answer
42 views
glUniformBlockBinding doesn't work
I try use uniform blocks in OpenGL, but doesn't work. First, see my vertex shader:
#version 400
uniform Buffer0
{
mat4 worldMatrix;
mat4 viewMatrix;
mat4 projectionMatrix;
};
in vec3 ...
0
votes
0answers
22 views
FFP Alpha Test shader - function decleration
I'm trying to use FFP_Alpha_Test RTSS from ogre on GLES2 platform.
I added the relevant files and built everything but got an error:
No matching function for call to 'FFP_Alpha_Test'
Fragment Program ...
1
vote
1answer
33 views
OpenGL Cubemap skybox edge issue
I implemented a skybox into my program using a tutorial, and using the provided 6 textures from that tutorial to make a cube map texture, my skybox looked fine. However, ever since then every other ...
0
votes
0answers
50 views
glTexImage2D not making texture
i'm loading an email into openGL with soil. I can print out the height I get from the soil function and the char array, but the texture just shows up as a beige colour.
GLuint texture;
glGenTextures(...
1
vote
1answer
75 views
how to make a fast fragment shader that converts intensity to saturation?
I have a simple fragment shader that looks like this:
#ifdef GL_ES
precision lowp float;
#endif
varying vec4 v_fragmentColor;
varying vec2 v_texCoord;
uniform vec4 u_desiredColor;
uniform sampler2D ...
0
votes
0answers
18 views
OpenGL/Frustum Culling - Drawing part of a buffer in 1 call
Im learning OpenGL. I tested frustum culling for terrain (cells consisting of 2 triangles, 6 verts, xyz/normal/uv), worked fine, but every frame im recreating VBO / VAO to draw visible part of terrain ...
3
votes
1answer
117 views
Procedural Hatching
I know that it is possible to make a shader that uses procedural hatching instead of pre-designed tonal art maps. But is it possible to make that procedural hatching in the fragment shader? I would ...
0
votes
1answer
15 views
Aggregation of value in GLSL loop results in 0
I'm banging my head against a wall trying to understand why this code is giving me some reasonable results with some visible colors on parts of the screen...
#version 130
in vec2 vTex; // must match ...
1
vote
1answer
55 views
OpenGL diffuse texture mapping
I am working on a small game engine and having some troubles when figuring out how to properly map more complex textures to their meshes. I am loading models using the .OBJ format and as far as I can ...
0
votes
1answer
38 views
Deferred Shading and material ID
I am implementing a deferred rendering framework, and I wanted to allow programmers to write custom materials.
However, I did not find yet how to handle different materials.
For now, a material is ...
0
votes
1answer
31 views
OpenGL typedefs
How far up do I have to push openGLs typedefs?
If I have GLfloat everywhere in my code, I have to include openGL libraries pretty much everywhere. Should I use glm:tmat4x4 or will regular glm::mat4x4 ...
0
votes
1answer
46 views
SDL2 and OpenGL: flickering with double buffering, what am I doing wrong?
I'm currently fiddling with SDL2 and OpenGL to get an understanding on how they work and, moreover, how shaders are done and work.
Right now, I'm following this tutorial, using SDL instead of glfw; ...
0
votes
0answers
25 views
swapbuffer is slow, and even i don't use any render code
Even i delete all the main loop code, only use swapbuffer function the FPS didn't change any more。 there is my render code
for (int i = 0; i < 6; ++i)
{
glBindFramebuffer(GL_FRAMEBUFFER, ...
0
votes
1answer
47 views
Drawing the same object multiple times in OpenGL
I am writing little game on C++ using OpenGL. I have various number of enemies (say, from two to twenty) - they are identical objects, each one uses the same mesh which is animated (skinning is ...
0
votes
0answers
30 views
Implementing Phong Shader whith 8 lighting
Reference: Phong Shader
I want to use 8 lights (4 red, and 4 green) but my object always has no color . I want to get this result:
but my result is like this:
For frag code, I have:
#version 120
...
0
votes
1answer
31 views
Wierd behaviour upon limiting rotation on Y-axis
Okay, this is the code that works for a FPS camera, except it allows the player to flip it over by going under/over -/+90° rotation on Y-axis:
transformation->rotateObjectFromRight(glm::radians(...
0
votes
2answers
34 views
Difference in Shading Using Eye Space or Model Space Coordinates
While reading on shading, I came across a section in which the artist provides 2 different kinds of fragment shading:
Coloring using model space and eye space.
The result is as illustrated in the ...
-1
votes
1answer
46 views
Detect camera collision in OpenGL without using bounding box
Is there any way to detect collisions in OpenGL without using any kind of bounding box?
I have created a maze/labyrinth and I want to move the camera/player inside the maze, such that the movement of ...
0
votes
0answers
39 views
World-space position from logarithmic depth
After changing my current deferred renderer to use a logarithmic depth buffer I can not work out, for the life of me, how to reconstruct world-space depth from the depth buffer values.
When I had the ...
0
votes
0answers
31 views
Merging multiple vertices into one (OpenGL)
I have a class where it crates a cube, load a shader, and render it, but i would like to know, how do I create two cubes, with two different vertices, two different matrices, and then merge these ...
0
votes
0answers
31 views
OpenGL raycasting and Intersection with triangles issues
This is my previous question which has bothered me for a while and I still haven't figured out (also no-one answered), so I am posting again on a related-issue which I have been working on hoping to ...
0
votes
1answer
97 views
3D sphere generation
I have found a 3D sphere in a closed-source game engine that I really like the look of and would like to have something similar in my own 3D engine.
This is how the sphere looks like when it is ...
1
vote
1answer
66 views
Texture coordinates projection
I have some classic texture coordinates and as a normal behaviour they follow the mesh's transformations.
I am trying to use the same texture coordinates behaviour but without being affected by the ...
0
votes
1answer
40 views
How to remove fragment from VAO?
I have the OpenGL VAO object (~40K) to draw the 3D scene
glBindVertexArray(VAO);
glDrawElements(GL_TRIANGLES, 4, GL_UNSIGNED_BYTE, nullptr);
glBindVertexArray(0);
To add some data I can use ...
0
votes
2answers
28 views
How to use texelFetch
I'm trying to switch from using the GLSL texture() function in my shader to using texelFetch() because I want very little processing of the texture pixels (no smoothing), and I want to use pixel ...
0
votes
0answers
24 views
Quaternion precision problems
Each entity and camera have a Transformation object that holds position info as vec3, rotation info as quat and scale info as vec3.
When I need a matrix (that being either model or view matrix), I ...
0
votes
0answers
35 views
Pick a line on a mesh
I am trying to gather all the indices hit by my mouse pointer while I am pressing the left mouse button and display it on the mesh as a line.
So we have this plane: https://puu.sh/rYOIG/c55077d713....
0
votes
1answer
43 views
BRDF Incorrect specular highlights
I'm currently attempting to implement BRDF lighting, and am hitting a bit of a snag with my specular term - the specular highlights aren't rendering correctly.
To make things simple, I'm using a ...
0
votes
1answer
27 views
How to get a safe index for glVertexAttribPointer without shader?
I'm learning to use VBOs and trying to keep it simple before building up. Trying to do it without writing a shader right now. It looks like this is possible, but I cannot seem to find a way to get the ...
0
votes
1answer
49 views
Hemisphere Projection
I came across the following segment of code that is supposed to project an image on a hemisphere:
void main(void)
{
vColor = aColor;
vec4 pos = uModelViewMatrix * vertex;
float lenxy = ...
0
votes
1answer
29 views
Reset Camera view - webgl
I have camera rotating by dragging mouse.
Im trying to add reset button that restart the scene to initial view.
The rotating camera works as expected but I can't figure out how to reset it.
The ...
0
votes
0answers
40 views
How to efficiently update AABB on scaling/translating?
AABB says to recalculate the box if rotation change on the base model. So if I scale, or translate the model, I don't need to recalculate.
I've calculated the min/max values from local space so far, ...