From a54e278e873f0d267fe1f37e0b596fcf7850debe Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 22 Jan 2019 07:24:00 +0000 Subject: [PATCH] Added gitpod support --- .gitpod.yml | 12 ++++++++++++ Dockerfile | 6 ++++++ Readme.md | 22 +++++++++++++++------- 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 .gitpod.yml create mode 100644 Dockerfile diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..8dd80f1 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,12 @@ +image: + file: Dockerfile +tasks: +- command: > + mkdir --parents build && + cd build && + cmake .. && + make && + ./tinyraytracer && + pnmtopng out.ppm > out.png && + open out.png && + cd .. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..aa1f8a5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM gitpod/workspace-full + +USER root +# add your tools here +RUN apt-get update && apt-get install -y \ + netpbm diff --git a/Readme.md b/Readme.md index 6e561e4..c5830b7 100644 --- a/Readme.md +++ b/Readme.md @@ -3,20 +3,28 @@ This repository is a support code for my computer graphics lectures. It is not meant to be the ultimate rendering code or even physically realistic. It is meant to be **simple**. This project is distributed under the [DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE](https://en.wikipedia.org/wiki/WTFPL). Check [the article](https://github.com/ssloy/tinyraytracer/wiki) that accompanies the source code. -If you are looking for a software rasterizer, check the [other part of the lectures](https://github.com/ssloy/tinyrenderer/wiki). +If you are looking for a software rasterizer, check the [other part of the lectures](https://github.com/ssloy/tinyrenderer/wiki). -In my lectures I tend to avoid third party libraries as long as it is reasonable, because it forces to understand what is happening under the hood. So, the raytracing 256 lines of plain C++ give us this result: +In my lectures I tend to avoid third party libraries as long as it is reasonable, because it forces to understand what is happening under the hood. So, the raytracing 256 lines of plain C++ give us this result: ![](https://raw.githubusercontent.com/ssloy/tinyraytracer/master/out.jpg) ## compilation ```sh -git clone https://github.com/ssloy/tinyraytracer.git -cd tinyraytracer -mkdir build -cd build -cmake .. +git clone https://github.com/ssloy/tinyraytracer.git +cd tinyraytracer +mkdir build +cd build +cmake .. make ``` + +You can open the project in Gitpod, a free online dev evironment for GitHub: + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ssloy/tinyraytracer) + +On open, the editor will compile & run the program as well as open the resulting image in the editor's preview. +Just change the code in the editor and rerun the script (use the terminal's history) to see updated images. + # Homework assignment [homework_assignment branch](https://github.com/ssloy/tinyraytracer/tree/homework_assignment) contains all necessary stuff to easily add environment maps: ![](https://raw.githubusercontent.com/ssloy/tinyraytracer/homework_assignment/out-envmap.jpg)