Coder Social home page Coder Social logo

rtr's Introduction

RTR

My student CGI project from 1996 that I've recently discovered in my archives.

It turns out it is the only reasonable piece of code I've ever written on C++.

The code implements pure, non-optimized ray tracing with lighting and shadows.

The code is pure C++ and is NOT using any 3-rd party libraries, graphics engines, DirectX or OpenGL.

The code is compiled using Watcom C++ with DOS/4GW to be run under DOS operating system.

The scene contains 9 fixed infinite planes, 20 moving tetrahedrons and a single moving point light source.

The animation originally contained 52 frames arranged for a looped playback, for the modern version it was modified for 208 frames for smoother playback.

Historically the program supported rendering and displaying rendered videos in two video modes:

  • VGA mode 13h: 320x200 with 256-color grayscale palette
  • VESA mode 10Fh: 320x200 24-bit True Color

This resolution is currently too low and the aspect ratio is not 1:1, so for modern publishing the resolution was increased to 1600x1200.

Historical version

The historical version can be found in historical branch. It's almost "as is", but contains a pair of modern scripts to convert the original 52-frame 320x200 animation from original custom format to modern APNG (VESAFILM.png) and MP4 (VESAFILM-H264.mp4) formats.

Historical rendering

Modern version

The master branch contains recently updated code that upscales the rendering to 208-frame 1600x1200 and also strips all the functionality that's difficult to observe now on modern DOS emulators like VirtualBox and DOSBox.

In particular, the following things were removed: Show mode, on-screen rendering, 8-bit grayscale mode, custom rendering modes, RLE data format, command line options, all obsolete code. The modern version only accepts a single parameter โ€“ output file name, and all it's doing is rendering a complete 208-frame 1600x1200 scene in 24-bit color mode.

The output .sht file can be converted to APNG (RTR.png) format with Convert.py and then to MP4 with Convert.cmd, which produces two files, RTR-H264.mp4 and RTR-H265.mp4. The latter is lossless, but is not supported everywhere. The former is lossy because of 4:2:0 color encoding, and contains visible banding, but is widely supported. Lossless 4:4:4 encoding for H.264 is unfortunately not supported by most players.

Modern rendering

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.