Git Product home page Git Product logo

ray-tracing-with-imgui's Introduction

RayTracing

项目介绍

本项目参考自教程《Ray Tracing in One Weekend》,使用了ImGUI的图形化界面框架,使用官方自带的一个OpenGL2的例子,目的是用直接绘制的方法,在屏幕上逐像素输出整张图片。目前在MacOS(Xcode 10.3)和Windows(Visual Studio 2015)环境中上能顺利运行,其他环境待测试。

笔记目录:
《用两天学习光线追踪》1.项目介绍和ppm图片输出
《用两天学习光线追踪》2.射线、简单相机和背景输出
《用两天学习光线追踪》3.球体和表面法向量
《用两天学习光线追踪》4.封装成类
《用两天学习光线追踪》5.抗锯齿
《用两天学习光线追踪》6.漫反射材质
《用两天学习光线追踪》7.反射向量和金属材质
《用两天学习光线追踪》8.折射向量和电介质
《用两天学习光线追踪》9.可放置相机
《用两天学习光线追踪》10.散焦模糊

因为直接搬运了ImGUI的opengl2的例子,所以整个工程都是ImGUI的,核心代码放在:/examples/example_glfw_opengl2/ 每一节的内容会放到一个main.cpp文件中。每个mainX.cpp都是一个基于上一个文件,增加新的特性。

MacOS运行环境

要想运行相应例子,只需修改makefile中第18行的文件名,然后编译, 例如:

SOURCES = main8.cpp

修改后,在命令行中进入makefile同级目录,执行make,然后运行同级目录下生成的的example_glfw_opengl2

Windows运行环境

运行\example\imgui_examples.sln,然后将对应小节的mainX.cpp的代码粘贴到main.cpp里面。 (支持visual studio 2015,其他版本未测试)

运行效果

小节 描述 效果
main1.cpp 多线程和ppm图片输出
main2.cpp 射线、简单相机和背景输出
main3.cpp 多线程和ppm图片输出
main4.cpp 封装成类
main5.cpp 抗锯齿
main6.cpp 漫反射材质
main7.cpp 反射向量和金属材质
main8.cpp 折射向量和电介质
main9.cpp 可放置相机
main10.cpp 散焦模糊
main11.cpp 随机场景的最终效果

ray-tracing-with-imgui's People

Contributors

maijiaquan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.