Coder Social home page Coder Social logo

zach2good / tinyraytracer-interactive Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 932 KB

tinyraytracer by ssloy, but rendering to the screen in realtime with SDL2 and dear imgui

CMake 0.08% C 98.78% C++ 1.14%
c-plus-plus graphics software-renderer rendering learning fun images computer-graphics rendering-engine tutorial

tinyraytracer-interactive's Introduction

tinyraytracer-interactive

tinyraytracer, but rendering to the screen in realtime

Original

https://github.com/ssloy/tinyraytracer

Points of Interest

Instead of writing the results of the raytracing out to a .ppm file like in the original, the framebuffer data is pushed into an OpenGL texture: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_FLOAT, data);, this is easily presented by imgui: ImGui::Image((ImTextureID)texture_id, ImVec2(width, height));.

For clarity, and in order to keep the focus on ssloy's raytracing code, I've kept unrelated code away from tinyraytracer.cpp.

At the cost of an increased build time, all dependencies are built from source and statically linked to the final binary.

Build

git clone --recurse-submodules https://github.com/zach2good/tinyraytracer-interactive.git
cd tinyraytracer-interactive
mkdir build
cd build
cmake ..
make

Tested On

macOS Mojave 10.14 - Apple LLVM version 10.0.0 (clang-1000.11.45.5)
macOS Mojave 10.14 - clang version 6.0.1 (tags/RELEASE_601/final)

Screenshot

Screenshot

tinyraytracer-interactive's People

Contributors

zach2good avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.