A lightweight editor for creating and manipulating Signed Distance Field (SDF) primitives using Python, GLSL, and OpenGL.
This project is a work-in-progress editor for designing 3D models using Signed Distance Fields (SDFs). Built with Python, GLSL, ImGui, GLFW, and PyOpenGL, it allows real-time rendering and interaction with SDF primitives.
While the current version is a demo with limited functionality, it serves as a foundation for a more powerful tool. The goal? To simplify 3D modeling by combining primitives into stylized characters or objectsβno sculpting required!
Iβm happy with the result, but thereβs so much more to build!
![]() |
![]() |
![]() |
|---|---|---|
![]() |
![]() |
![]() |
This is an early-stage prototype with known bugs and missing features. Check the Roadmap for planned improvements.
- Redo/Undo bugs
- Small bugs
Your feedback and contributions are welcome! Open an issue or submit a PR.
β Real-time SDF rendering (GLSL shaders)
β Cycles Additional rendering mode - Realistic Ray Tracing algorithm
β Smooth logic operations (substract, intersect, union, etc.)
β Multi-primitive composition (spheres, boxes, cones, etc.)
β ImGui-based UI for intuitive controls
β Save & Load functions (using tkinter)
- π Fix Undo/Redo bugs
- γ½ Found and Fix bugs
- β± Optimize
- π§· Integrate marching cubes written in Rust for export into 3D format (example, obj)
- π Creating a gizmo - Preparation
- Free movement of the camera in 3d space - Done!
- Translation operations for primitives - rotation, scale, and position - can be changed in real time in the inspector.
- Save/Load projects (JSON or custom format)
- Undo/Redo support
- Export to 3D formats (OBJ, GLTF) via voxelization/marching cubes
- Gizmo-based manipulation (drag, rotate, scale primitives)
- Add AABB - optimization
- Write Docs!
- Themes & customization
- Localization (i18n)
- Performance optimizations
Contributions are highly encouraged! Hereβs how you can help:
- Report bugs β Open an issue.
- Suggest features β Share your ideas in Discussions.
- Submit code β Fork the repo and create a Pull Request.
Note: This project is a learning experience - expect refactoring and experimentation!
It all started with this article on SDF-based modeling. The idea of creating stylized 3D characters with just 10-20 primitives was too exciting to ignore!
- Phase 1: Built an MVP using AI tools (ChatGPT, Copilot, Cursor).
- Phase 2: Hit limitations - free chat limits, code complexity, and bugs.
- Phase 3: Spent 2 months refactoring, learning, and improving.
AI isnβt a magic solutionβitβs a tool. The real work is in understanding and refining the code.
β AI accelerates prototyping but requires deep debugging.
β Refactoring is part of the processβembrace it!
β Small steps lead to big resultsβthis is just the beginning.
- SDF Wikipedia
- Inigo Quilezβs SDF Functions
- Shadertoy (for SDF inspiration)
- Cursor AI (the AI assistant that helped)
This project is licensed under the MIT License β see LICENSE for details.
- Inigo Quilez for SDF research.
- AI tools (ChatGPT, Copilot, Cursor) for assistance.
- Open-source community for inspiration and libraries.
Compiled executables for windows can be found in releases
NOTE: I don't have the ability to compile a linux app yet.
git clone https://github.com/EmberNoGlow/SDF-Model-Editor-Demo.git
cd SDF-Model-Editor-Demo
python -m venv .venv
.venv/Scripts/Activate.ps1
pip install -r requirements.txt
python main.pyNOTE: To install the imgui package you will need a c++ compiler. My advice is to use mingw - if you only need a compiler for this task. Build Tools will do for this task too, but it weighs more.
- First, install pyinstaller.
pip install pyinstaller- Compile into one file
pyinstaller --onefile --name sdfeditor --windowed --add-binary ".venv\Lib\site-packages\glfw\glfw3.dll;." main.pyNOTE: You should make sure that you have a virtual environment named .venv created and glfw installed (it is added to requirements). If there is none or the path is incorrect, specify the correct path to
the glfw3.dllfile located in the virtual environment in the\Lib\site-packages\glfw folder!
- Move the compiled file to a separate folder and drag the shaders folder to this directory. You should get it like this:
root directory
βββ shaders
β βββ fragment
β β βββ cycles.glsl
β β βββ template.glsl
β β
β βββ sdf_library.glsl
β βββ vertex_shader.glsl
β
βββ glfw3.dll
βββ sdfeditor.exe
This project is a testament to experimentation - imperfect, evolving, but full of potential. Whether youβre here to learn, contribute, or build, Iβm excited to see where it goes next!
Letβs create something amazing together. π
Your support helps development! Help by leaving a review, reporting an error, suggesting an idea in Discussions, creating a Pull Request, or just star β the repository!.





