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
0answers
7 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 ...
0
votes
0answers
11 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
25 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
64 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
17 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
93 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
13 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
48 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
32 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
39 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
21 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
38 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
27 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
0answers
33 views

Should I use a game engine, physics engine or physics library? [on hold]

I am currently undertaking a project where I use an Xbox Kinect to track a users hands and then identify the pose the hands are making using machine learning. I will then incorporate this into an ...
0
votes
1answer
30 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
33 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
39 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
37 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
30 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
86 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
26 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
23 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
34 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
42 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
26 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
48 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
27 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
37 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, ...
0
votes
0answers
21 views

Stretchable Mesh Generation Techniques in 2D and 3D (Unity)

I wanna to generate such mesh (or smth like) that can be "Stretchable". Yellow objects in the picture are nodes and red ones are edges of my graph. I want to generate "edges mesh" can be stretchable ...
1
vote
2answers
44 views

What does glBlendFunc do when given an incorrect enumeration value?

In cocos2d-x, I am using particle system from plist with blend values: dst = 1, and src = 100 which is wrong enum for gl_blend. Although app logged "OpenGL error 0x0500" but it still run and showed a ...
0
votes
1answer
21 views

Streaming to VAO VertexBuffer using OpenGL Direct State Access for Instancing

How do i stream to a vertex buffer using Direct State Access? I want to update my vertex buffer of matrices every frame so i can use it in my Shader. This is how i specify my buffer. I do this once ...
0
votes
1answer
66 views

3.3x OpenGL Camera - how to do 3d rotation?

I'm trying my hardest to understand what this code is doing so far I think the sin(theta) and cos(theta) of the code is representing a point with an angle. This point with an angle sin(theta) and ...
0
votes
1answer
76 views

Deferred shadow mapping

Question: What am i doing wrong in the CalcShadowFactor method? It looks like the depth check is not working correctly. Body: I'm using deferred rendering in my engine and i have generated the ...
-5
votes
1answer
47 views

Why isn't this glsl program working? [closed]

Why isn't this glsl program working ? #shader vertex #version 430 layout (location = 0) in vec4 position; layout (location = 1) in vec3 normal; layout (location = 2) in vec2 texture_coordinate; ...
1
vote
1answer
69 views

Access Violation on Application Exit

Currently I'm writing an Engine. How I have it right now is that, the engine is written in a project and exports a dll. On another project in the same solution as the engine, there is a sandbox ...
0
votes
1answer
25 views

Formula for range based attenuation

I am trying to implement a simple shader for point lights, but I am struggling with the attenuation function. I know that normally you would use three coefficients (constant, linear, and quadratic), ...
0
votes
0answers
10 views

Reading from SSBO causes black screen and lag

I tried porting my OpenCL raycaster to GLSL compute shaders. Only I'm having trouble with shader storage buffers. How I initiaize the buffer (constructor of class BufferGL): GLBuffer::GLBuffer(GLint ...
0
votes
1answer
49 views

OpenGL VAO Index Not Drawing Correctly

I'm going insane trying to work out why I unable to draw a triangle using VAO and indexing. I have a bunch of redundant vertexes so that i can switch my index array up to test the drawing. std::...
0
votes
1answer
31 views

segmentation fault in glCreateBuffers

I am trying to run an example from the redbook 8th edition and I am receiving a segmentation fault in line: glCreateBuffers( NumBuffers, Buffers ); file.cpp ////////////////////////////////////////...
-1
votes
0answers
25 views

Default color for 3D scene

I have webgl 3D scene with background image and few shapes with textures. I want to add some lines and other shapes and apply on them default color which not affect the shapes with textures. How can I ...
4
votes
2answers
151 views

OpenGL threaded loading

I'd like to introduce seamless level loading which means I need multiple threads. The main thread is for rendering the current scene (or for non-seamless level loading a progress bar) while the other ...
0
votes
0answers
31 views

3D skeletal animation collada with lwjgl works bad

I am trying to make my java program display a 3D animation it reads from a Collada file. I have read many tutorials, but yet something isn't working right. The way I do it is: I parse the collada ...
0
votes
2answers
122 views

Is it a good idea to perform all matrix operations on the GPU?

I was wondering if it is a improvement to use OpenGL for matrix calculations instead of using the CPU. And if it is a improvement, is it worth it to change the math class to use OpenGL?
1
vote
0answers
66 views

OpenGL textures look poor

I'm having some issues loading in textures in OpenGL, as my textures keep rendering incorrectly or coming out looking muddy. For instance, here I tried to load a 256x256 color spectrum image. On the ...
0
votes
2answers
43 views

My C++/OpenGL “Hello Triangle” Code Does Not Draw A Triangle When Using SDL As A Window Library

I have been using the website Learn OpenGL but I am using SDL as a window Library. My code seems to builds the window correctly but no triangle appears. I am compiling my code using Visual Studio ...
0
votes
1answer
33 views

Axis of affine transformation matrix

Lets say I have a right handed column major 4x4 transformation matrix. Can I safely assume (even tough there exist non uniform scale) that first column is X axis vector, second cloumn is Y axis vector ...