Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [opengl]

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 applications like CAD software and computer games. It is also cross-platform. The OpenGL standard is controlled by the Khronos group, which also controls OpenGL ES.

1
vote
1answer
154 views

Simple mouseray picking in openGL

Ive been looking at tutorials and trying to figure out how to do basic ray-picking. But I'm stuck at figuring out what space to do the distance calculations in. What space does ...
0
votes
1answer
71 views

Render to cubemap wrong Y values

I'm currently trying to render to a cubemap in order to blur it. However the top and bottom faces appear much closer than they should be in the blurred version. I thought the problem came from my ...
0
votes
0answers
45 views

FreeGLUT - Making Planets Orbit at their own Speed

I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link ...
0
votes
0answers
60 views

Unwrap 2D texture to polar coordinates

I'm trying to create a lighting engine for a 2D game. What I'm planning to do is something similar to this tutorial, specifically the concept of unwrapping the Cartesian coordinates to a 2D polar ...
0
votes
1answer
31 views

GLFW- Help implementing glBufferedData

Good Morning, I've been trying to learn some OpenGL by following the tutorials on learnopengl.com and I've hit a bit of a snag. I'm trying to implement the same functionality as the "Hello Triangle" ...
1
vote
0answers
180 views

How to change mac opengl version back to mesa

A while ago I wanted to use the functionality of opengl 4.5+ on my mac, so I installed mesa with macports, and it worked. Recently, however, I tried to use my code again and it said that these ...
0
votes
3answers
555 views

What's the difference between Raytracing and Physically-based-rendering?

I know raytracing is a technique based on the route calculation done by the light, following the rays through the interaction with the surfaces, and that Pbr is a collection of render techniques that ...
0
votes
0answers
235 views

Render an infinite plane

I wish to be able to render any Plane (Defined by a Normal and a distance from the origin). The closest answer state to use 'Direction' (4D vectors with w = 0) with the Lengyel infinite matrix, but ...
-3
votes
2answers
249 views

Random points spread like old TV static in a polygon OpenGL

OpenGL version 3.1 Have to draw around 10000 randomly placed and colored points inside a rectangle to appear like old TV static but colored as shown in the image below. Right now the code draws a ...
1
vote
1answer
217 views

Render to texture and gaussian blur texture problem

im using a lightmap to achieve a 2d lighting effect in OpenGL with dynamic shadows and to make them soft I use the gaussian blur. However I noticed one problem : When I use big blur ratio, it has some ...
0
votes
1answer
105 views

opengl bump mapping (normal mapping) problem with VBO and GLSL

hi i am beginner i am trying to implement bump mapping with vbo and glsl. My question is: did i make bump mapping ? if i did why these edges didnt disappear ? high and low meshes (i used low meshes ...
1
vote
1answer
153 views

VAO and VBO connection and granularity with multiple objects

How general should vertex array objects be? I'd like to plan ahead and avoid a major revision down the road. I'm having a hard time wrapping my head around a few (possibly conflicting) pieces of ...
0
votes
1answer
78 views

My sweep and prune is giving false positives

My code is just giving false positives. Every frame it reports an imaginary collision. Here is my code Sweep And Prune: ...
0
votes
0answers
55 views

3D Rotation Motion

I am trying to move a small sphere around a larger sphere or box in OpenGL. The first rotation I want is motion A in the picture below. Motion A acts as a satellite around a planet or box. Also The ...
1
vote
0answers
27 views

How to update FBO's depth texture?

I have an FBO with only 16-bit depth attachment: glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, nullptr); I ...
1
vote
1answer
539 views

How To Resize Existing Texture In OpenGL 4.3

I would like to know how to resize an existing OpenGL 4.3 texture while keeping the current contents. i'm using glTexImage2D(). Do I simply re-call ...
0
votes
0answers
47 views

Rotating a camera around an object with PhysX

I'm working on a PhysX project with GLUT and I'm attempting to have a camera rotate around an object, steered by the mouse. My first step was to port over the C# code found here: http://wiki.unity3d....
0
votes
1answer
108 views

How to handle hitboxes/hurtboxes in animations?

I'm curious how I should go about structuring hitboxes and hurtboxes for my actors. For context, I'm developing a game engine in OpenGL, using C# and OpenTK. I have developed a working skeletal ...
1
vote
1answer
87 views

Project 2D texture onto a cubemap

I'm looking to take a 2D texture (previously rendered from the user's perspective), and overlay it overtop of a cubemap. Since a cubemap has 6 textures, I need to run a shader over top of all 6, and ...
4
votes
0answers
110 views

Determine user mouse selection of 3D Object for multiple viewports

I am currently working on setting up some world objects for my level editor and am running into a bit of a snag. When I get the hit location from the mouse raycast, I would like to determine what part ...
-1
votes
3answers
243 views

How do I get min/max on a mesh

I am trying to create an AABB but I need to know how to store min/max from a mesh. Here is my code(I got it from thin matrix) : ...
0
votes
0answers
70 views

OpenGL: Freetype font does not appear

I am learning OpenGL for 2d by following this tutorial here. I followed the tutorial for rendering font to the screen as it is given but still the font does not appear. Whenever I run the program i ...
0
votes
1answer
161 views

OBJ Loader not working correctly

I'm currently trying to implement my own OBJ Loader for use with FreeGLUT with C++. This is my current OBJ Loader: #include "OBJLoader.h" #include #include #include #include ...
1
vote
1answer
145 views

How can I add 3D animation to my Pygame window?

I've developed a quiz game using Pygame but now I'm being asked to implement a 3D animation element (a game show host) to the game. I used Pygame as I was told it would be an easy enough language to ...
0
votes
1answer
47 views

What causes the difference between these boxes?

I have recently started using Blender and I notice that the light (from my game) on default box is different from the one I downloaded. The below picture shows that. They have the same normal ...
1
vote
2answers
92 views

How can I position framebuffer objects on the screen in OpenGL?

I currently have two framebuffers which are drawn using glBlitFramebuffer(0, 0, 1920, 1080, 0, 0, 1920, 1080, GL_COLOR_BUFFER_BIT, GL_NEAREST); But the ...
2
votes
1answer
112 views

GLSL - multiplying fragment output color by normal after calling texture function displays wrong texture

So I'm quite new to OpenGL/GLSL. I'm trying to make multitexturing and simple normal lighting work. Here is a Vertex shader: ...
1
vote
0answers
108 views

How to figure out why a given shader compilation causes an invalid operation error?

I have 2 versions of a program. The only difference being that in one, a geometry shader is compiled and in the other it is not. In all other regards both programs are identical, character by ...
0
votes
1answer
403 views

How can I rotate models in their local space using OpenGL?

I have a base application where a model is loaded in, however I need to manipulate the models positions and rotations independently so that each model in the scene can have its own rotation and ...
2
votes
1answer
1k views
8
votes
4answers
3k views

In OpenGL, is it a bad idea to “combine” immediate mode and retained mode for the sake of GUIs?

Suppose I have a 3D scene being drawn with glDrawArrays(...) and I want to render something simple, like a 2D overlay. Would it be a bad idea to use immediate mode ...
1
vote
1answer
88 views

Multiple mains in vertex shader, GLSL

I have a renderer where you can define passes where you pick the shader, and a signal, each object can register a listener to that signal in order to draw himself, the problem comes when some objects ...
1
vote
0answers
53 views

Missing any kind of lights?

I am trying to make my first 3D game in OpenGL with Shaders (LWJGL3) I read and follow a lot of tutorials but can't figure it out what kind of light I am missing here? The wall doesn't get any effect ...
0
votes
1answer
95 views

Rotation along normal vector

I have a triangle in the 3D world. I have the: positions for the three points the normal vectors for the three points (all the same, because vertices are not shared) This triangle faces to a ...
0
votes
0answers
35 views

Motion blur in TP Camera?

How make motion blur in Third person camera in C++ with OpenGL, when camera move it gets nice blur as Rise of Tomb Raider, how to achieve like this ? If someone has a fragment to code it or a link of ...
-1
votes
1answer
61 views

asteriods ship movement

...
5
votes
2answers
2k views

OpenGL - How come drawing sprites takes so much performance

I'm wondering how drawing simple geometry with textures can eat up so much performance (below 60fps)? Even my good graphics card (GTX 960) can "only" draw up to 1000 sprites smoothly. The textures I'm ...
1
vote
0answers
51 views

removing triangle artifacts from overlapping height maps OpenGL

I have two 100x100 height maps that I am drawing using a triangle mesh. One represents the land height, and the other represents (water + land) height. I currently draw both meshes on top of each ...
4
votes
3answers
3k views

How do I implement flat shading in GLSL?

I'm working with GLSL and trying to implement flat shading on a 3D model (rather than smooth shading). To illustrate what I mean, here are two screenshots of cubes in Blender. Here's one with flat ...
0
votes
2answers
110 views

Simple openGL code paradox [closed]

I'm trying to create the most basic application that will draw a cube using indices and textures for starters, but nothing about it makes any sense whatsoever. I ran it on my machine with an nVidia ...
0
votes
1answer
325 views

OpenGL calculate circle rotation around a given point

I'm trying to rotate an object around a certain point. If this point is the center of my world space I use the following algorithm: glm::vec3 center is the center ...
0
votes
0answers
73 views

LWJGL - OpenGL BufferStorage no performance boost at all

I tried to implement a persistent mapped buffer instead of using glBufferData and glBufferSubData. Everything works and is ...
1
vote
1answer
120 views

Flipping a 3D text around its Y axis SharpGL

...
0
votes
1answer
126 views

how to make skills and their animations in opengl ? are skills 3d model or 2d?

1)slash effect 2)area skills like dota2 crystal maiden ulti and first skill 3)over an enemy skills example dota2 crystal maiden second skill how they make in opengl i know opengl billboards way and ...
0
votes
0answers
89 views

Newer version of OpenGL slower on older hardware (SDL + Mac)?

I have a test program that runs basically exactly the same code between a OpenGL 2.1 compatibility and 3.3 core context (from SDL 2) which I was using for testing migration of a code base (there's no ...
1
vote
1answer
32 views

How to adjust scaling with rotation?

I'm rendering a texture to a square. I have to scale the texture because it is 10 times wider than it is tall. In my fragment shader I divide both the X and Y texture coordinates (I'm using OpenGL), ...
1
vote
0answers
150 views

Shadow Map compression artifacts [closed]

I am having weird artifacts with a shadowmap. The shadows seem to missing inside the polygons. But it is not wireframe rendering, and it is certainly not shadow acne (frontface culling is on and the ...
0
votes
1answer
213 views

Directly pass from transform feedback buffer to fragment shader

I am building terrain using a lod algorithm and deferred cascaded shadowmaps. The tessellated terrain is about 6,000,000 triangles. I tried this using 2 methods. 1st method: Both the deferred shadow ...
0
votes
1answer
96 views

How can you pass a large amount of textures or equivalent to the fragment shader in OpenGL?

I am adding shadow mapping to a game engine I am working on. For this effect, each light source needs it's own associated shadow map cube texture. I am going to be exaggerated and say there can be ...
0
votes
1answer
101 views

Issue with OpenGL texture rendering

I am developing a game in Java using LWJGL2 and Slick, and I am encountering an issue when rendering a graphic. Instead of filling the quad with the texture, it appears to be partly repeating it. The ...