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 a late-stage prototype. I'm on the cusp of a major transition: the MVP is progressing well, and Roadmap is nearing completion. Next, I'll move on to building the full product. Once the MVP is complete, I'll immediately focus on promoting the project on social media—and your support can make this launch truly meaningful!
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)
✅ Export to 3d using scikit-image
✅ Built-in real-time scene code editor in GLSL using Tkinter
- 📝 Customization
- 🧷 UX improvements
- 🐛 Fix bugs
- 🔨 Making an GLSL code editor
- 🌐 Localization - Preparation
- Free movement of the camera in 3d space
- Translation operations for primitives – rotation, scale, and position – can be changed in real time in the inspector.
- Save/Load using JSON
- Undo/Redo support
- Export to 3D formats (OBJ)
- Gizmo-based manipulation (drag, rotate, scale primitives)
- 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.
You have several options for compilation: automatic and manual. Automatic compilation is highly recommended as it will save a lot of time.
The automated process is as simple as possible:
- Make sure you are in the directory where the project is located.
- Run the PowerShell script:
➤
.\build.ps1 - Wait for the compilation to complete (the console should display BUILD COMPLETED SUCCESSFULLY!). You now have an executable file in the ReleaseBuild folder.
This method has been tested on Windows.
- 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
├── gui/fonts
│ └── *.ttf files
│
├── 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!.






