A little C++ project with OpenGL and GLFW3 to render some procedural planets made from scratch
A little C++ project with OpenGL and GLFW3 to render some procedural planets made from scratch
This update was mostly fixes and stuff but there are some interenting things added
Log in to leave a comment
The model shown here is called the Utah teapot. It is commonly known as the “hello world” of graphical programming
It is the first proper model ever made. It was sketched on paper and vertices calculated by hand but the version here is a bit more modern with normals and CCW vertices winding
The first image is of the velocity buffer used for TAA and the second image is a representation of a quaternion
Log in to leave a comment
During this update I mainly fixed up stuff I broke switching to deferred rendering
Also worked on anti-aliasing and the current solutions arent perfect but when I add TAA it should make everything 1000x better
with the new rendering pipeline I broke the following:
Deferred shading is a different rendering pipeline which renders a scene into several buffers and then computes shading for them as another step. It can be somewhat more efficient and versitile but rn its really WIP and holding with ducktape but it works!
#var preprocessor directive which allows me to specify a variable that can change on the CPU and it will get automatically updated on the GPU
Framebuffers are a type of buffer used for rendering where all draw calls render to that specific framebuffer (specifically its textures/renderbuffers). Making my own allows me to make my own post-processing effects etc.
The image is using a really basic shader I slapped together in like 5 minutes to have something to showcase. It just inverts the colors on half of the screen and then puts the other half in grayscale. Its just the tip of the iceberg of what I can do and make now
Log in to leave a comment
Log in to leave a comment
Log in to leave a comment
When thinking of a cube some people may think about an Ico sphere or UV sphere but these all have their own downsides. A spherified cube is a cube with many subdivisions thats forced to have all the points the same lenght away from the center. This makes it a lot easier to later implement more subdivisions the closer it is to the player and its easier to map a noise map to it as it wont have artifacts
Log in to leave a comment
The mesh generator can generate vertices and then calculate their normal maps, indices and UV maps. This will be later used to generate planets and their meshes
A component now has a list of dependencies that it needs to have access to or else it throws an error. For example you cannot have a camera without a transform component as the transport components tell the camera component where it is and which direction its facing
It basically means that the more away a light is, the less it shines based on three values which signify a constant, linear and quadratic dropoff
Log in to leave a comment
It took me a while to fix the rotation. The normal vectors were getting rotated wierdly but it turned out that the problem was me rotating it using a 4x4 matrix instead of 3x3
Log in to leave a comment
Quaternions are a 4D vector which is a special way to interpret rotation. Its more smooth and easier to work with in relation to OpenGL than normal euler angles (yaw, pitch, roll)
Log in to leave a comment
Entity Component System allows me to make an object and then add components to it kinda similar to Unity. I can for example make an object with a transform component so that it has position, rotation etc, then add a rendering component and a mesh component and I will have an object that renders. Then I can later give it another component that for example makes it move with my inputs