OpenGL is a graphics standard and API which targets the Desktop, workstation and mobile 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. OpenGL is used for ...
1
vote
2answers
54 views
Node-based rendering
Recently, I started wrapping Meshes and Transform classes into new ones, but by doing this I came upon a problem: I needed to ...
3
votes
1answer
21 views
Simple CubeMap opengl wrapper class
I recently added this CubeMap class to my engine to make handling skyboxes easier. I would like to ask if my OpenGL coding semantics are good, and if I could ...
3
votes
1answer
53 views
Graphic object class
I am trying to implement graphic objects that can be either Sprite, Base, Point or some ...
3
votes
1answer
116 views
Basic OpenGL Renderer
I recently added this ShaderBatch to my engine, which takes care of rendering objects which share the same render technique (shader), like billboards and lights. I ...
1
vote
0answers
23 views
Calculating OpenGL view matrices
I'd like a little help here calculating the view matrix for OpenGL based on the lookat type function:
...
3
votes
1answer
55 views
Drawing a colored rectangle on-screen
I have made my first program that draws a colored rectangle on-screen. I want to know the best practices of making OpenGL and GLSL programs.
...
3
votes
1answer
71 views
Implementation of a VertexBufferObject class
I have been working a simple 2D Game using C# language with OpenTK (OpenGL wrapper/binding for .NET). It uses a lot of sprites.
Since it uses lot of sprites, I think it's important to make everything ...
1
vote
1answer
51 views
4D matrix math library for use with OpenGL
I am trying to create a simple library for C to handle OpenGL matrix operations.
You can see the vec3fscalar here.
...
2
votes
1answer
60 views
OpenGL ES 2.0 Sprite rendering
Is this a good method to render sprites (textured quads) or is there a faster or better way?
Example use:
...
5
votes
2answers
55 views
Basic OpenGL Renderer class
I made this Renderer class recently, to simplify the user interface of my library's API. I would like to ask advice about the move semantics (copy constructor, ...
8
votes
2answers
181 views
Yet another OpenGL Shader: the Builder pattern and lifetime management
I've noticed that whenever a shader program class is implemented (from some questions on this site, as well as more reputable implementations), that:
The class tries to do too much. Binding to the ...
2
votes
1answer
70 views
RenderBatch for game engine
Recently, I implemented an RenderBatch class, which renders any objects, using a specific shader (with its configuration). I'd like to improve on the way my render ...
10
votes
2answers
144 views
OpenGL game engine
I'm making a C++ game engine for entertainment and am using OpenGL to render my stuff. I made a batch renderer that was able to render 50K sprites with 300 FPS (untextured). My old setup that was able ...
3
votes
1answer
89 views
OpenGL-based library
I've been working, for a month, on an OpenGL library called alpha++. Basically, it is a framework that allows the user to create 3D scenes easily.
I would like to ask your advice on how I could make ...
1
vote
1answer
88 views
Modern Opengl GLSL Shader Class
I've finally written my own Shader class. It's a basic implementation based on a tutorial, and it works perfectly. Any suggestions on how to improve, or correct my ...
3
votes
2answers
68 views
Load an OpenGL buffer from file
The function's job is to load a vertex attribute buffer or an element buffer from a specified path, and upload it to OpenGL. Also, optionally, return the number of vertices/indices loaded through an ...
0
votes
1answer
85 views
Managing shaders in OpenGL - A Shader class
I've create a basic Shader class in modern OpenGL (3.1) which works perfectly, though it is not feature complete yet. It still lacks the functionality to allow the ...
5
votes
2answers
92 views
2D OpenGL tile atlas fragment shader
I am currently using the following glsl code to retrieve separate textures from a tile atlas:
...
11
votes
3answers
241 views
WebGL shader program management
I'm writing a tiny WebGL/JS framework to improve my knowledge of JavaScript and WebGL. Following is a class that wraps a Shader Program and provides methods for setting the shader parameters (AKA ...
2
votes
1answer
136 views
YUYV OpenGL Fragment Shader
I made a shader to display a YUYV surface (data arranged as: Y0 U0 Y1 V0). It's working, but I don't know anything about shaders, or openGL, or anything graphic related as a matter of fact. I feel ...
6
votes
2answers
380 views
Makefile for C++ OpenGL with GLFW and glad
This is a makefile I wrote to compile a simple OpenGL test project which is going to use the libraries GLFW and the C library glad.c.
...
0
votes
1answer
285 views
TextRenderer class for rendering text with OpenGL [closed]
I'm writing a class called TextRenderer to render text with OpenGL.
Here's my TextRenderer.hpp file
...
6
votes
2answers
128 views
Quaternion rotations and preparing matrices for a shader
I am implementing an OpenGL ES 2.0 renderer in c. I want to use quaternions for rotations. Please take a look at the way I am implementing the rotation math. Everything looks as expected when the ...
15
votes
1answer
204 views
Virtual Texturing - Page Indirection Table
I'm working on a Virtual Texturing library for mobile devices based on OpenGL-ES.
This is the PageIndirectionTable, one of the library components I would like to ...
2
votes
0answers
109 views
Updating OpenGL version to 4.1 (LWJGL) [closed]
I have a 2D rendering system that's working (for the most part). I want start making use of shaders to implement transformation, rotation, scale, etc., and I want to do it using the latest version of ...
6
votes
2answers
120 views
Using a CRTP approach for loading OpenGL programs
I wanted to try using CRTP (also new for me) to try making the loading of shared resources implicit. (Specifically I'm using it for loading OpenGl shader programs)
This will also help separate some ...
8
votes
2answers
225 views
OpenGL text rendering library for Lua built on freetype-gl
FTGL wasn't making me happy, so I decided to try something else. This isn't completely finished; I plan to work more on layouts and alignment, and add a few other things. It should be far enough along ...
10
votes
1answer
122 views
Lua bindings for FTGL (FreeType font rendering in OpenGL)
I wrote some Lua bindings for FTGL's C API. This works well enough, but I ended up with lots of macros, one for each Lua function signature. For example, LUD_NUMBER_NUMBER_TO_NUMBER creates a Lua ...
17
votes
1answer
389 views
Tiny Lua library to get char pointer from string
Background
I'm using Lua with luaglut to do some OpenGL stuff. The luaglut API is almost identical to the gl/glut C APIs. Sometimes, gl functions want a pointer to some data, for example:
...
7
votes
1answer
261 views
Sorting objects to be rendered by their state
I'm writing a renderer to learn my way around OpenGL and right now I'm trying to understand how to sort the objects to be rendered. As I understand there are a few rules to this:
Sort to minimize ...
7
votes
1answer
194 views
Perfect game loop
I've been working on development for an Android game, and this is the game loop I have so far:
...
12
votes
1answer
523 views
OpenGL Instanced Rendering
I have a very basic OpenGL instanced rendering setup, which is compiling and running, however it is super slow, and even though I spent days of asking and reading how to fix it, I still have no clue, ...
5
votes
2answers
547 views
User controlled rotation with arcBall
I am trying to visualize a pointcloud centered around the origin. I also want to have a user controlled rotation for which I found the arcball.
rMat is the model ...
10
votes
1answer
273 views
Sprite drawing class
I have written a very XNA spritebatch like interface for drawing sprites in OpenGL. When begin is called the vertex data buffer is mapped to a float*. The index buffer and vertex buffer are bound in ...
4
votes
1answer
481 views
OpenGL first person jumping code
I'm making a game in Java with LWJGL and I just implemented jumping. I don't really think the code is particularly well written or very efficient. Here is the code of my ...
6
votes
1answer
485 views
OpenGL object wrapped in a Qt Widget
I have this object wrapper class, which I will use to implement my Qt OpenGL scene. It is working, but I am looking for a way to:
Improve the API.
Remove extra OpenGL calls.
Optimize it.
I know ...
4
votes
1answer
456 views
Speedups for Conway's Game of Life
I wrote Conway's Game of Life in Python with Pyglet. It works pretty well but is very slow when the number of cells gets high. Any easier speedups I can attain with this code?
...
6
votes
2answers
264 views
Type safe program uniform manipulation in OpenGL
I've made an attempt at writing class wrappers around basic OpenGL objects to make managing them easier and more intuitive. Writing a generic one for program uniforms proved to require a little bit ...
5
votes
2answers
129 views
Optimizing garbage collection for local objects
I am trying to make a 3D application with OpenGL/LWJGL at the moment, but I am now already hitting some limits on the JVM, most likely due to a configuration that needs to be done.
I have the ...
3
votes
1answer
127 views
Vertex Buffer Object (VBO) multi-class implementation
I'm hoping someone could look through this code for my Chunk, Mesh and ChunkManager classes ...
5
votes
1answer
895 views
Making a voxel engine
I've decided a while ago to make my own voxel engine. To start, I coded my own basic 3D engine in Java using minimal OpenGL bindings for things such as SRGB ect. I set up my own VBA and VBOS and had ...
4
votes
1answer
234 views
WebGL (Three.js) simple application
I have done the source code for my lesson, which I shall publish later on my website:
...
4
votes
1answer
305 views
Shader class implementation
I'm trying to design a Shader class. For now, I'm just trying to get basic outline for handling uniforms. Some design goals I aimed for is to avoid passing a ...
1
vote
1answer
165 views
common lisp: nested loop beautification (checkboard texture generator)
I've written a small code snippet that generates checkboard texture using cl-opengl.
...
3
votes
2answers
187 views
WIP platformer game
Initial note: You do not need to have knowledge of LWJGL or OpenGL to review this code. The only parts of the code that require LWJGL knowledge are the Game class, ...
0
votes
1answer
79 views
Issue regarding game velocity
So, this is a thing. I've got a simple little 2D game where a character can run left and right and jump. My problem here is that I've got two velocities, xVel and yVel, that I need to increment as the ...
1
vote
1answer
428 views
Small particle engine
I wrote a small particle engine in Java for my Pong clone.
I read that changing a texture is very expensive in OpenGL, so I tried to change the texture as few times as possible. Therefore I change ...
2
votes
1answer
695 views
Java reflection and static classes
I try to intercept some OpenGL calls for testing my rendering classes. Reflection is used for replacing the OpenGL backend.
I feel this class is badly written and I need advices for refactoring it.
...
2
votes
1answer
136 views
OpenGL abstraction layer
I've tried to create a small OpenGL abstraction layer.
I've tried to favor composition over inheritance but somehow it added extra complexity to my code. I probably overused it.
shader.h
...
5
votes
1answer
119 views
Accelerate OpenGL 2D on Python3
I'm using OpenGL to draw about 20 circles. Each circle has 2 lines, ~10 segments, and all of them have different colors and lengths. Frames per Second are around 4.
How can I optimize this to run ...