Newest 'opengl' Questions - Stack Overflow

Questions tagged [opengl]

OpenGL (Open Graphics Library) is a graphics standard and API which is platform independent and available for desktop, workstation and mobile devices. It is designed to provide hardware-accelerated rendering, and hence gives greatly improved performance over traditional software rendering. OpenGL is used for applications like CAD software and computer games. The OpenGL standard, as well as OpenGL ES, is controlled by the Khronos group.

1
vote
0answers
20 views

How to make OpenGL viewport in Qt have the same coordinate system as Qt coordinate system?

I'm trying to render a 640x360 red square inside a 1280x720 window. The problem is that OpenGL's viewport won't automatically be inside the area occupied by the square into the Qt window system. That ...
0
votes
1answer
20 views

Unable to use GLFWcursor struct defined in glfw3

The problem is essentially I'm unable to use the GLFWcursor struct which is included in glfw3, it isn't recognised and is underlined with this error: identifier "GLFWcursor" is undefined. I am using ...
1
vote
0answers
26 views

How to load model with materials instead of textures OpenGl?

I used the learnopengl model loading tutorial and their code to load their model. When I tried to load a different model it did not work. After reading online I learned that my model might not have ...
0
votes
1answer
33 views

OpenGL + Visual Sudio 2017 : rendering window not displayed (was OK with Visual 2010)

I have a small sample of OpenGl code under windows that works fine with windows 7 + visual studio 2010. But on my new PC with windows 10 + visual studio 2017, the rendering window is not displayed. ...
0
votes
1answer
22 views

Am I bungling glVertexAttribPointer(), or is my HD6480G driver likely to blame and what recourse do I have?

I'm trying to utilize VAO (vertex array object) functionality in an opengl context. My non vao buffer objects draw fine, but when I bind my VAO and draw, no object is drawn. I am basically using some ...
-5
votes
0answers
13 views

Manual Sphere Creation in OpenGL (on Java) [on hold]

I am currently need to create the sphere through the shaders and I need in manual vertices (36 vertices) for that purpose. Could anyone look at my code and say where I need to change the vertices here?...
0
votes
0answers
13 views

OpenGL (ANGLE) + XAML (UWP)

I'm trying to get OpenGL code running on UWP XAML application. I found some information regarding this, but seems there's nothing like complete walkthrough. I'm completele beginner in UPW, XAML and ...
0
votes
0answers
16 views

Show half portion of image side by side on two separate glcontrols - openTK

I have a single texture and two glControls. I need to show the first half portion of texture on glControl2 and second half portion of texture on glControl1. And also I have put two numericupdown ...
1
vote
1answer
55 views

Is it possible to write into specific mipmap level in fragment shader?

I have created a classic 2D a texture, and rendered into some values, in my case depth. In the c++ code I use the glGenerateMipmap() function to auto generate mipmaps. In fragment shader I can access ...
-1
votes
1answer
48 views

Opengl in python and glut rendering incorrect results, any suggestions why?

Referring to the reading of OpenGL Superbible's SMB format file where the source code is, I created a program with some help. Now I am comparing the results to what I'm actually getting. What I'm ...
0
votes
0answers
27 views

How to create OpenGL + GLFW desktop wallpaper window?

I want to create GLFW window in wallpaper layer, but attributes (like _NET_WM_WINDOW_TYPE_DESKTOP) not work and I have a normal window above another. I use native (glfw3native.h) functions to take ...
0
votes
1answer
41 views

OpenGL Rubik's Cube colors not displaying correctly when turning

I have been trying to code a 3d rubiks cube with opengl but have had trouble understanding the concept of each piece having its own matrix and using glMultMatrixf(), like many other examples do. ...
-1
votes
0answers
45 views

Only first OBJ model renders correctly? [on hold]

I have to create a project of visualization of an aquarium in OpenGL. Currently, Ive wrote some code, that is parsing an .obj file with model of fish and then, using vector with model's vertices, ...
0
votes
0answers
28 views

Depth Of Field artifacts

During the DOF testing, artifacts were revealed as shown in the picture: fragment shader code: #version 330 #define KERNEL_RADIUS 4 in vec2 texCoord; layout (location = 0) out vec3 fragColor; ...
1
vote
1answer
50 views

Unable to mouse pick a quad rendered in a framebuffer

Struggling to mouse pick a point/quad. I believe I am either using coordinates in the wrong space or perhaps not accounting for the framebuffer's position/size (it's a sub window of the main window). ...
0
votes
0answers
20 views

OpenCL/OpenGL interop wasting CPU

I generate frames in OpenCL 60 times per second using one OpenCL kernel call each time and write them to an OpenGL texture so that I can display them on the screen. There's no performance problem, the ...
0
votes
1answer
40 views

Why glm does not translate vertex

I'm trying to translate vertex with matrix transformation using glm. But it looks, that i'm doing something wrong. I tried to change side of vm and mv but I have same result. Res has same values as ...
1
vote
1answer
22 views

Is glm::perspective's fov parameter defined as half the angle of the field of view?

I'm at the optimization phase of a renderer I've been writing in OpenGL, and my next step is to cull everything I can't see. When reading this and other resources, I see the visual depiction of the ...
-1
votes
0answers
57 views

glBufferData() outside of rendering loop does not work

I have a float vertex array associated with a vertex buffer object for drawing a cube. Interlaced in the vertex array are colors associated with each vertex. In the rendering loop within main() I ...
1
vote
0answers
28 views

How do I render a scene to a cubemaptexture and then use the cubemaptexture in another shader as cubesampler?

I am writing a 3D engine that uses Phong shaders and point lights in C# using the OpenTK library (OpenGL). I am now trying to create a shadowmap (cubemap) of the scene for each light I have, but I don'...
0
votes
0answers
30 views

Draw Matrix with glMultMatrixf

I am trying to create a rubik's cube by following Coding Train's rubik's cube challenge. In his part 2 episode, he implements a P3DMatrix and uses it to draw a 3D cube: void show() { fill(255); ...
-1
votes
0answers
39 views

Drawing multiple lines with different colors

For a project about 4-dimensional geometry, I am working on, I need to draw multiple lines with different colors, where the color stands for the W-coordinates (since we cant correctly show them off ...
-1
votes
1answer
24 views

Getting errors when using ImGui with OpenGL

I have some code working in OpenGL and now I would like to use ImGui to make a GUI for my application. When I tried to copy a one line code of ImGui to my project ImGui::CreateContext(); by including ...
1
vote
1answer
37 views

How to do knock-backs in PyOpenGL with object facing?

I am making a game in PyOpenGL and I want to apply knock-back on camera when an object is close enough. A knock-back is simply putting the camera backward according to the enemy facing direction. I'...
0
votes
0answers
32 views

What is the difference between opengl and opengles?

Although I have been writen some code of OpenGL and OpenGL ES and I know that OpenGL ES is a subset of OpenGL and it is designed for Embedded system. Now there's a fact that rk3399 supports OpenGL ES ...
3
votes
2answers
54 views

How do I render a matrix as a cube in OpenGL?

I am trying to create a rubiks cube using openGL. Within the code for each individual piece, I want to draw a cube around x, y, z using a matrix. I am wondering how do I draw my cube once I have ...
1
vote
2answers
141 views
+50

how to read, parse the SBM file format from Superbible Opengl

Calling on experts, gurus, and anybody to help read and parse a file in python. On page 751 of 6th ed. or page 800 of 7th ed. of Superbible OpenGL there is Appendix B. The SBM File Format that seems ...
0
votes
2answers
62 views

How to correctly translate mouse coords to opengl coords?

I need to make a game for a project on college. Everything works fine, the only problem is translating mouse coords (0,0 in top left corner) to openGL coords (0,0 in center of the screen). In class ...
1
vote
0answers
37 views

How many times vertex shader is called, if I use 4 vertices and 6 indices to create a quad? [duplicate]

I am trying to assign unique id for each vertex being processed by the vertex shader in webgl1 as a color. Lets say I have 4 vertices and 6 indices representing the connectivity for two triangles that ...
1
vote
1answer
66 views

Python: How to get cube to spin and move in OpenGL Superbible example

For some reason, the cube does not move around the screen, though it spins. This is with the use of the functions m3dTranslateMatrix44 and m3dRotationMatrix44 though there seems a better way. ...
0
votes
0answers
29 views

glew and glfw complains about the lack of gl.h and glu.h

When trying to compile mine ogl program I receive /media/34GB/demos/Ogl/glew.h|1206|error: "glu.h": No such file or directory| /media/34GB/demos/Ogl/glfw.h|176|error: GL/gl.h: No such file or ...
-1
votes
0answers
35 views

Shapes not rendering properly, GLSL confusing, 'uni not found?'

I'm trying to pass an array of vertices and their corresponding color for GL tessellation blending. My code is very ugly and probably has lots of errors, but the main problem is I am unable to pass an ...
0
votes
0answers
60 views

Difference between glColor3f and glColor3d

The code I'm working on, in a nutshell, uses OpenGL to represent data (stored as double) as the colour of some geometry. Using the default colour shading between vertices it then samples back the ...
0
votes
0answers
18 views

How to add a greyscale backgrounf to a 2-D line plot using Pyopengl and GLSL? [on hold]

I have made a 2-D line in Opengl using shaders. Now I want the background of the line to change in accordance to the slope of the line. I tried passing the normalized 2-D array of range [0, 1] for ...
1
vote
1answer
58 views

OpenGL GLSL atomic counter in Vulkan

When I tried to migrate my OpenGL implementation to Vulkan, I found that 'uniform atomic_uint' is not supported in Vulkan. My use case is simple: incrementing an integer across all fragments. I tried ...
1
vote
1answer
34 views

Why can VAO use VBO data whthout bind it?

Why VAO can use VBO data without binding it? https://learnopengl.com/Advanced-OpenGL/Instancing i find it from this webpage. the code page: https://learnopengl.com/code_viewer_gh.php?code=src/4....
0
votes
1answer
76 views

OpenGL is present in the minGW folder, but CLion can't reach/see it [on hold]

I'm trying to get OpenGL to work in CLion, downloaded the bin/include/library files from freeglut and copied them to minGW. They are there, and CLion is using that minGW folder when compiling, however ...
1
vote
1answer
104 views

How to test if a 2d point in pygame screen is part of a 3d object in PyOpenGL?

I am making a game (RPG) in PyOpenGL which I have a crosshair. I want to check if a 3d object is in the crosshair (or detect if it is at a point), which is a 2d overlay. How can I do that? I tried to ...
1
vote
1answer
47 views

Why is cube not appearing from the python code from spinningcube example of OpenGL Superbible 6th, 7th ed

I ported over the .cpp version of spinningcube found there to python for a better understanding of opengl and to create something new. While I get the same result as the compiled version from the ...
0
votes
0answers
21 views

How do I draw a polygon with a 1,2 … or n-pixel inset outline in OpenGL 4.1?

How do I create a polygon in OpenGL 4.1 that has an inset border of n-pixels? Presumably, since I have said the magic word "pixel", this means that I need to invoke a fragment shader of some form. (...
2
votes
1answer
43 views

Cubemap in OpenTK

Warning: Total OpenGL/TK newb, so be kind. I may have bitten off more than I can chew. Specs: Visual studio Community 2017 C# .Net 4.6.1 (using WPF, WindowsFormsHost control) OpenTK 3.0.1 OpenTK....
0
votes
0answers
24 views

Segmentation Fault 11 Error When Changing Vertex Struct Attributes [on hold]

My model has a bunch of meshes which have a bunch of faces which have a bunch of indices. For each index in a face, the following for loop runs: XARTriangle tri; Vertex vertex;...
0
votes
1answer
32 views

Shaders don't work properly in OpenGL in Java

The problem is that i am trying to create a 3D Cube via using the shaders, but the problem is that, it doesn't read the file correctly. Here are the shaders that I have created, the problem is that ...
0
votes
0answers
22 views

Transforming lights in glsl vertex shader with additional uniform mat4?

I'm using a scene graph for my scene. It contains lights and meshes. Meshes have local transforms, and if a node is the child of a mesh node, its own local transform gets composed with the transform ...
1
vote
1answer
54 views

Incomplete FBO when attaching RBO

I'm trying to attach a RenderBuffer Object to a FrameBuffer object, and glCheckFramebufferStatus(GL_FRAMEBUFFER) keeps returning me the error code : GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT (I'm trying ...
0
votes
0answers
19 views

OpenGL texture unpack parameters with inconsistent sizes

Imagine source image with size 1024x1024 pixels and texture with size 512x512. Now I need to take part of the source picture and upload it to the texture. Do to so I use glPixelStorei like this: ...
0
votes
1answer
87 views

Assimp loads vertices, but model is not getting displayed

IDE: xcode System: MacOS What I'm trying to do My project [repo] is at the point where I successfully made a skybox [tutorial link] work, but I'm struggling with assimp's model loading [tutorial ...
-1
votes
0answers
29 views

VirtualGL only starts black window [on hold]

I am trying to forward a GUI client from my remote machine using VirtualGL. From my local machine, I connect to the remote machine with: $ vgl_connect [hostname] Here xlogo provides me the expected ...
2
votes
1answer
40 views

Resolution of multi-sampled frame-buffer with multiple color attachments

Trying to implement Anti-aliasing on top of deferred shading, I'm attempting to use multi-sampled render buffers and then resolve the samples with a buffer-blit pass. As is traditional in deferred ...
0
votes
0answers
37 views

No transparency when loading png in opengl using pnglib [closed]

I am trying to write a game using OpenGL, but when I try to load the png graphics, the alpha part of images become background colour but not transparent. glClearColor(0.5, 0.5, 0.5, 1.0); glClear(...