Git Product home page Git Product logo

rtfgu's Introduction

This is a fork of the source code for the book: "Ray Tracing From the Ground Up" by Kevin Suffern.

The source code was taken from http://www.raytracegroundup.com/ and is GPL.  See License.txt for details.

I decided to host my changes to save other people time.  I found a couple of bugs in the Sampler section
and decided to shore up the design to make bugs less likely in the future.

I split the code into a static raytracer library and the UI application.  This is the raytracer library.

BUILDING PREQUISITES
    CodeBlocks, a free C/C++ IDE.
    Boost, high quality C++ libraries.


STATUS
I'm on Chapter 5 right now, but have gone back to 4 to fix all the samplers.

New Features
    * Memory Usage
        Switched from bald pointers to boost shared pointers.
        This makes the code vastly simpler, there's no more need for
        assignment operators, copy ctors, clones, and
        a whole host of segfaults disappeared.  =D

        Not all the code has been refactored to use this idiom (yet), but I
        will make this change as I work my way through the book.

    * Regular Sampler Bugs
        There were a two bugs in the Regular sampler that left noise in the 3-1 sphere sample
        rendering.  The generate_samples routine wasn't generating the correct samples, and the
        unti_square routine wasn't returning the right samples.  i fixed both and made the
        archicture simpler.

    * Sampler Architecture
        Sampler architecture completely redone into a simpler abstract base class.
        It occurred to me that the samplers are really sample generators.  As an implementation
        detail, some of the samplers cache their data, others do not.  The old design stored
        too much data in the base class resulting in a lot of extra code that leaked abstractions.
        (The base class had functions that only worked when used by certain subclasses).
        The solution was to move all the data down into the appropriate subclasses and make the
        base class abstract.

        2D and 3D point generation is handled by template in the base class SampleGenerator.
        Typedefs make their usage much easier.

        I intend to also have subclasses handle the distinction of 2D (square & circle).

Changes
    Library / UI Split
        The source code is split into two projects;
        one that contains the raytracer built as a static library,
        the other mostly contains the UI.

    Style
        Astyle, style K&R.
        Unecessary code deleted (notably ctors, dtors copy, and
            assignment operators that are the same as the compiler generated ones).
        Other Nits:
            // ---- comments with no point are deleted.
            return (value) -> return value;
            void func(void) -> void func()
            void
            func()          -> void func()
            for(...)
                for(...)    ->  for () {
                                    for () {
                                    }
                                }

TODO
    I'm still adding back in other samplers and changing raw pointers, etc.
    CMake build.

rtfgu's People

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.