A sample voxel editor based on OpenGL 3.3+, inspired by MagicaVoxel.
Support Windows 10 currently.
A final project originally of 5 undergraduate students for the course Computer Graphics, SYSU.
A good OpenGL learning example for the green hand in Computer Graphics, while maybe not the best practice in the related field.
- OpenGL 3.3+
- GLAD
From LearnOpenGL:
Go to the web service, make sure the language is set to C++ and in the API section, select an OpenGL version of at least 3.3 (which is what we'll be using for this repo; higher versions may be fine as well). Also make sure the profile is set to Core and that the Generate a loader option is ticked. Ignore the extensions (for now) and click Generate to produce the resulting library files.
Chinese Version: 打开GLAD的在线服务,将语言(Language)设置为C/C++,在API选项中,选择3.3以上的OpenGL(gl)版本(本仓库中将使用3.3版本,但更新的版本应该也能正常工作)。之后将模式(Profile)设置为Core,并且保证生成加载器(Generate a loader)的选项是选中的。现在可以先(暂时)忽略拓展(Extensions)中的内容。都选择完之后,点击生成(Generate)按钮来生成库文件。
GLFW Master 3.2.1GLFW Master branch- GLM 0.9.8.5
- imgui v1.60
- nlohmann::json v3.1.2 , 只需要下载
json.hpp
的 release 文件。 - freetype 2.9.1 , 建议下载
ft291.zip
并解压 , 然后将 freetype-2.9.1 文件夹更名为 freetype 添加至3rd_party
。
- Create a new directory
3rd_party
at root directory. - Download and unzip
glad
,glfw
,glm
,imgui
dependences following the URL above. - Rename all the dependences' directories without certain version number.
- Download
nlohmann/json.hpp
file from the URL above. - Follow the steps above to add
freetype
library.
Now your 3rd_party
looks like:
3rd_party/
----glad/
----glfw/
----glm/
----imgui/
----nlohmann/json.hpp
----freetype
- Use Cmake to generate your project file.
- Use Cmake-gui to generate the
build/
dir. - Open it in Visual Studio, set
MineCube
as Startup Project. - Compile it and run the program.
You might need to modify the shaders' path in
demo.cpp
Still need to be developed.
Still need to be developed.
Read wiki for more technical details.
Feel free to new issues.