I was using QOpenGLWidget to render textured triangle, the code was looking good but the triangle was always rendering black i had problem with it for two days until i accidentally found out what the title says. This is the code, the texture gets loa
I'm attempting to use 3 textures on a model. I'm loading the images using SOIL and binding them to texture units 1, 2, and 3. But for some reason when I bind samplers 1, 2, and 3 to my shader, 1 produces the image bound to GL_TEXTURE2 while 2 and 3 p
I have something like this: class GLSLShader { public: GLSLShader(GLenum); ~GLSLShader(); }; class GLSLProgram { public: GLSLProgram(GLSLShader *, GLSLShader *); ~GLSLProgram(); private: GLSLShader *m_VertexShader; GLSLShader *m_FragmentShader; }; GL
I am creating an small animation film using OpenGL 3 and implementing it in visual studio community 2015. I am trying to make an animation of a dinosaur moving to the right at least in the first but I cannot make it animate somehow. Here is my main:
Is it possible to go from ArrayFire to OpenGL and back using an AMD graphics card? There is an article on how to do it using CUDA. Any hints on using a similar method for OpenCL, so it can be used cross-platform? Update What I would like to do in the
Before I start my question, a little bit of background. I started learning OpenGL not so long ago, and I have learned most of what I know about it here. I have only really gotten past 2 tutorials, and yes, I know I will eventually have to learn about
I have a base class in an OpenGL project which represents 3DModel in general. Now I want to create a more specialized class that will inherits from 3DModel. My problem is the mandatory base class constructor call in the initialization list. Is there
I have Swing frame and some sprites drawn on it. I need to save this 2D scene as an image using JOGL but every tutorial I managed to find seems to be obsolete. I'm using JOGL 2.1.5.using Screenshot: BufferedImage image = Screenshot.readToBufferedImag
if my vertex data was layed out example: struct Vertex { float position[4]; float normal[3]; float texCoord[2]; } i know we use glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_uiVertBufferHandle ); //get the pointer position where we can add verts void* pPos
I'm using c++, opengl 4.0 and glsh shader language. I'm wondering how to correctly blend diffuse texture with lightmap texture. Let's assume that we have a room. Every object has diffuse texture and lightmap. In every forum like gamedev.net or stacko
I have tried several ways to get GLEW working with my VS2010 project. No success. At first I tried using the pre-built libs and dlls from the website. I downloaded these pre-built files from http://glew.sourceforge.net/index.html and did something li
Should I prefer to calculate matrices on the CPU or GPU? Let's say I have the following matrices P * V * M , should I calculate them on the CPU so that I can send the final matrix to the GPU (GLSL) or should I send those three matrices separately to
I store OpenGL identifier in variables of the type GLuint. But I do not know to what value I should initialize these variables. I would like to initialize them to zero, but unfortunately that is a valid identifier for OpenGL. The variables must be in
It seems that in Xcode 4 there is no longer a way to create an application that is not limited to the command line using C or C++. I would like to do so, however Glut seems to be one of the only frameworks available for mac that works with C++ and Op
I have a rectangle on my window and I am trying to make this rectangle click-able by defining the area of the rectangle. If the mouse click is inside this area, then it's a click else not. For eg: On the window, let's assume the vertex of the rectang
While learning OpenGL, I am looking for an image reader which can evaluate various image types like ".png", ".bmp", ".tga", ".dds", .... My plan is to extract the params like height, width, type of the image file an
I've been going back and forth between my OpenCV and OpenGL components and I'm not sure which of the two should correct for this. Using OpenCV camera calibration yields fx, fy with an aspect ratio of approximately 1, which would correspond to images
I need to compare 2 pictures and find pixels that are different with specified threshold. Now I'm doing it just programmatically in for loop, it take about 3 seconds for small 600x400 picture. I'm wondering if there a way to do it faster using OpenGL
The fragment shader draws to the framebuffer. But how can I efficiently obtain just the pixels/fragments generated as a result of execution of the fragment shader?Setup a stencil mask so each time you draw a fragment, it will set that mask to 1. Retr
An image says a thousand words, so what about two? I have this map art: In order to actually use this as a map I scale this texture 6 times. This however didn't go as expected: All the OpenGL code is in my homebrew 2D OpenGL rendering library, and si
I'm making a program using openGL with transparent objects in it, so obviously I have to paint those last. Unfortunately I was unaware of this requirement when beginning this project and now it would be a real pain to reorder it painting those at las
I'm working on the editor for Bitfighter, where we use the default OpenGL stroked font. We generally render the text with a linewidth of 2, but this makes smaller fonts less readable. What I'd like to do is detect when the fontsize will fall below so
I'm trying to render frames grabbed and converted from a video using ffmpeg to an OpenGL texture to be put on a quad. I've pretty much exhausted google and not found an answer, well I've found answers but none of them seem to have worked. Basically,
I used opengl 2 years ago. In one afternoon I read a tuto, I drew a cube (and then learned how to load any 3d model) and learned home to move the camera around with the mouse. It was easy, less than 100 lines of codes. I didnt get the pipeline comple
im creating a game, my character shoots a bullet, and is going to collide with an enemy, which is drawn like this in display(); glPushMatrix(); glTranslatef(260, -180, 0.0); e[0] = new Platform(0, 0, 0, 40, 40, 40, 40, 0, textures[17], 260, -180); gl
I'm actually doing a little browser which should be able to parse some code, display a GUI (mainly based on svg elements) and let the user interact with it. Which renderer should I use to paint the GUI? Probably in the future this browser will need 3
I'm using OpenGL with C#, using CSGL12 interface for our project. I'm attempting to draw a number of 4-point free-transformed images onto a bitmap in memory. Is there a way to either: Directly render to a bitmap on memory, or, Render to an off-screen
Think of your basic GLUT programs. They simply run from a main method and contain callbacks like `glutMouseFunc(MouseButton) where MouseButton is the name of a method. What I have done is I have encapsulated the main file into a class, so that MouseB
I've recently been tinkering with a little gameproject using VC++ 2008. I'm using SDL, OpenGL, Boost and Box2D as included libraries. It works fine on my windows 7 machine, aswell as a friend's w7 machine. How ever it wont work on my second friend's
I want to display some custom graphics on top of a 3rd party fullscreen Windows application. Have you played any Steam games? It has an executable, GameOverlayUI.exe that lets you access Steam windows from within a game. (The GUI elements look custom