cgl
opengl-skydome
cgl | opengl-skydome | |
---|---|---|
42 | 2 | |
394 | 47 | |
- | - | |
6.7 | 10.0 | |
4 months ago | almost 5 years ago | |
C | GLSL | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cgl
- cgl-rs: Rust OpenGL base library + creative coding + gamedev utilities
- CGL (C Game/Creative Coding Library) v0.6 : a major release that includes a number of new features and improvements. Along with a Python Port
- CGL (C Game/Creative Coding Library) v0.6 : a major release that includes a number of new features and improvements. (with over 60+ examples total)
-
First attempt to build UI in OpenGL & C
my base code is https://github.com/Jaysmito101/cgl the code for this specifically is extremely dirty (was just experimenting) so i didnt post it publicly
- A collection of about 50+ open source creative coding examples, games, algorithm visualizers, ai projects, purely in C99
- A collection of 50+ creative coding examples, games, algorithm visualizers, ai projects, purely in C99 + creative coding library
- A collection of about 50 creative coding examples, games, algorithm visualizers, ai projects, purely in C99
opengl-skydome
-
CGL v2.0 (C Game Library) is a multipurpose library mainly for recreational coding / demo scenes / prototyping / small games / experimentation
you used this project as a base for the procedural sky, didn't you ? Ha, ha, I used the same one. The problem with this shader is that it is quite expensive for the GPU: complicated formula for the sky color and sun (somewhat approximating the Reyleigh/Mie scattering), and the fractal brownian motion (FBM) used for clouds isn't cheap either. I ended using this project for the sky color (since it is entirely texture based, it is super cheap) and a slightly cheaper FBM for the clouds (found on shadertoy, sorry can't find the link).
-
A few months ago, I decided to start learning C and I finally got around to completing a project - Here's my noob attempt at a Minecraft clone
Having written my own voxel engine back in the days (circa 2015), some advices if you want to push this further : * Yep, your hashmap to store block information per chunk is not going to scale up at all. Since there is fixed amount of blocks in a chunk, ... simply use some big tables. This is what Minecraft does: 4096 bytes for the block Ids, 2048 bytes for data values, 2048bytes for skylight, 2048 for blocklight, ... accessing those values will be very quick, since everything will be close in memory. Block updates will also need (very) quick access to nearby voxels: everything in Minecraft depends on this: meshing, skylight, blocklight, redstone, water, lava, ... * You used the same sub-chunk size as Minecraft: 16x16x16, but used one draw call per sub-chunk: again, this is not going to scale up: Minecraft terrain is the textbook example for instanced rendering. OpenGL 4 has a draw call for this: glMultiDrawArraysIndirect, PITA to use, but performances you get from this call are fantastic. It is possible to emulate this draw call with OpenGL 3, but it is pretty hardcore (not recommended for beginners). * You didn't do any frustum culling: I remember struggling a lot implementing this one. Never ending parade of edge cases. Also pretty costly to run: on the CPU I had back then (core i7 from 2013), it took 2 to 4ms per frame (with a 16 chunks render distance): 20% of the time budget at 60FPS, yikes! Given all the optimization I tried, I was quite disappointed by this. But, if you want a decent rendering distance, with a decent amount of blocks below the sea level, it is pretty much required. I also remember implementing the cave culling algorithm; it was actually surprisingly easy to do, with a decent amount of chunk being culled. * Your lighting is obviously way too simplistic (well, there is none): Skylight is extremely important, this is what will allow you to do day/night cycle, especially if you also have BlockLight information. Updating Skylight values is a major PITA, I struggle way more than I care to admit to get this right (and so did Mojang: those black patches in the world were due to bad SkyLight values). * Dynamic skydome (ie: sky color with day/night cycle) was also not that trivial to implement. I tried various PBR rendering techniques back then (Rayleigh/Mie scattering), but the results were kind of meh (and took way too much GPU power back then). I remember using the techniques from this project: very cheap and not bad looking (with better textures though). * User interface: you'll be for one hell of ride with this one. So many bad memories... * Careful with your floating point usage: I did the same mistake and uses floats everywhere: they do not have a lot of precision. This is particularly bad when you start playing with huge coordinates (>10000): on the GPU, you will be multiplying those coordinates by the MVP matrix, which will give even bigger intermediate numbers: the loss of precision will quickly stack up. Especially when doing collision detection/correction: this is particularly sensitive, if you use an algorithm like the swept AABB. So many times I fell into the void of gone through blocks because of this. Extremely annoying to debug. * The biggest PITA was handling entities: I massively under-estimated the complexity of these, and this is what killed the project back then. Not much pixels on screen, but massive amount of tedious, boring and unrewarding code behind the scenes.
What are some alternatives?
Fluid-Simulation-Rendering - Implementation of IISPH and Screen Space Fluid Rendering. Currently in progress.
opengl_sky - Pure-shader sky and cloud rendering in OpenGL
GameSystemsInC - Game systems for games in C. Examples using Raylib.
minecraft-c - Minecraft clone made with C and OpenGL
RayTracer - Ray tracer with phong lighting, reflections, refractions, normal mapping, procedural textures, super sampling, and depth of field.
welcube
spotify-GL - just a OpenGL spotify ripoff
TJE_Framework - Basic C++ Framework for games, it wraps the basic GPU interface (Meshes, Textures, Shaders, Application).
stb - stb single-file public domain libraries for C/C++
tinyrenderer - A brief computer graphics / rendering course
p5.js - p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —