yo so i made this 3d graphics engine in a few days because i wanted to mess around with opengl and shaders and stuff. it's actually pretty decent ngl
basically a sandbox for testing 3d graphics stuff. not a game engine, just a place to spawn cubes and spheres and make them spin around with fancy lighting. think of it like a graphics playground
- mouse controls - left click drag to orbit, right click to pan, scroll to zoom. way better than keyboard controls
- spawn stuff - press 1-9 to spawn primitives (only 1 and 2 work rn lol)
- object manipulation - select stuff in the list and move it around with arrow keys or the sliders
- lighting - directional light + 3 colored point lights that you can move around
- materials - change colors, make stuff shiny, basic pbr properties
- graphics settings - wireframe mode, post processing effects (some work, some don't)
- camera modes - orbit mode (default) and fly mode (press C)
Mouse:
- Left drag = orbit camera
- Right drag = pan camera
- Scroll = zoom
Keyboard:
- 1/2 = spawn cube/sphere
- Arrow keys = move selected object
- Q/E = rotate selected object
- +/- = scale selected object
- C = toggle camera mode
- F1 = toggle UI
- F2 = wireframe
- F3 = grid
- F11 = fullscreen (might be janky)
- ESC = quit
you need:
- visual studio 2022
- cmake
- vcpkg (for dependencies)
then just:
setup-ninja.bat
launch-vs.bat
or if you already built it:
quick-run.bat
tried to keep it modular:
Camera
- handles all camera movementShader
- loads and manages shadersModel
- loads 3d models (or procedural meshes)Scene
- manages all objects in the worldRenderer
- global rendering stateTransform
- position/rotation/scale for objects
works:
- basic 3d rendering with phong shading
- multiple lights
- object spawning and manipulation
- smooth mouse controls
- imgui interface
kinda works:
- post processing (needs proper framebuffer implementation)
- shadows (shader is there but not hooked up)
- material system (basic version works)
doesn't work yet:
- model loading (assimp is there but haven't tested)
- skybox
- particle systems
- instanced rendering
- half the primitives
- memory leaks probably (haven't checked)
- no error handling really
- some ui options don't do anything
- performance could be way better
- code is kinda messy in places
if i keep working on this:
- proper shadow mapping
- pbr shading
- better post processing pipeline
- scene serialization
- more primitives
- texture loading
- normal mapping
- maybe compute shaders
- the cube.obj in assets is literally just a cube for testing
- shaders hot reload would be cool but haven't done it
- imgui docking would be nice but needs custom imgui build
- should probably use smart pointers more
anyway yeah that's cappygfx. it's not gonna compete with unreal or anything but it's a decent little graphics sandbox for testing stuff
feel free to use it for whatever, code is pretty straightforward if you know opengl