skywind3000/mini3d
skywind3000/mini3d has 2,341 GitHub stars and 504 forks. GitHot measured 0 stars in 24 hours and +1 in 7 days. Last checked 2026-11-05 11:24 UTC. Last push 2024-09-23.
3D Software Renderer in 700 Lines !!
Measured star growth
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.en.md
Originalmini3d
3D software rendering tutorial, without any performance optimization, mainly explains how to write a fixed pipeline software renderer. Although the main code is only 700 lines, it is small but complete.
Features
- Single File: The source code consists of only one file, mini3d.c, which implements all the functionality. It is easy to read and understand.
- Independent Compilation: There is no third-party library dependency and no complex project directory.
- Model Standard: Uses the standard D3D coordinate model, left-handed system with WORLD/VIEW/PROJECTION matrices.
- Clipping Implementation: Implements simple CVV (Canonical View Volume) clipping.
- Texture Support: Supports textures up to a maximum of 1024 x 1024.
- Depth Buffering: Uses a depth buffer to determine the order of image rendering.
- Perspective Texture Mapping: Implements perspective texture mapping and perspective color filling.
- Edge Calculation: Accurately calculates polygon edge coverage.
- Simplified Implementation: The rendering engine consists of only 700 lines of code, with clear modules and a prominent main structure.
- Detailed Comments: The primary code is well-documented with detailed comments.
Compile
- mingw: gcc -O3 mini3d.c -o mini3d.exe -lgdi32
- msvc: cl -O2 -nologo mini3d.c
- Compiled version: https://github.com/skywind3000/mini3d/releases
Demonstration
Texture Mapping:RENDER_STATE_TEXTURE

Color Filling:RENDER_STATE_COLOR

Wireframe Rendering:RENDER_STATE_WIREFRAME

Added Lighting and Bicubic Interpolation (screenshot of lighting effect added by a friend to Mini3D)

Basic TO-DO:
- Add backface culling
- Implement simple lighting
- Provide more rendering modes
- Implement texture sampling with bicubic interpolation
Advanced TO-DO:
- Derive and prove all geometric knowledge used in the program
- Optimize vertex computation performance
- Optimize draw_scanline performance
- Load textures from BMP/TGA files
- Load BSP scenes and implement roaming.
Explanation of principles
- Wei Yixiao: How do OpenGL and DirectX determine the position of pixels only based on vertices?
- Wei Yixiao: How does the computer access the graphics card at a low level?
Related Projects
- RenderHelp:Another implementation of a streamlined software renderer with support for programmable rendering pipelines, for more details see https://skywind.me/blog/archives/2589
Welcome to donate:

Your donation is the greatest recognition for this tutorial. You are welcome to use Alipay to scan the QR code above to make a donation. The donated funds will be used to improve the tutorial documentation and illustrations, as well as to help me write more interesting tutorials.
Welcome to follow us:
blog: https://skywind.me/blog
Explore related projects
ytdl-org/youtube-dl
Command-line program to download videos from YouTube.com and other video sites
141,460 starsexcalidraw/excalidraw
Virtual whiteboard for sketching hand-drawn like diagrams
135,175 starsgodotengine/godot
Godot Engine – Multi-platform 2D and 3D game engine
119,611 starsmrdoob/three.js
JavaScript 3D Library.
117,611 stars