akavasis / rtfgu Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tfiner/rtfgu
Ray Tracing From The Ground Up
License: Other
This project forked from tfiner/rtfgu
Ray Tracing From The Ground Up
License: Other
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.