metatrace是一个 C++ 编译时间,惠特德风格 Ray Tracer,使用经典 C++98/03 样式元编程. 所有雷追踪在编译过程中完成.
metatrace是一个 C++ 编译时间,惠特德风格 Ray Tracer,使用经典 C++98/03 样式元编程. 所有雷追踪在编译过程中完成.
ORIGINAL GITORIOUS PROJECT META
Metatrace is a C++ compile time ray tracer ^0 (as of the initial release, it is a whitted style one).
It is mostly inane stuff. except, maybe, that it's a nice gadget to test compiler performance and conformance, especially but not exclusively in the Template and Metaprogramming corner of C++.
It requires basic C++0x support; with g++, make sure to have at least 4.4 installed.
... more to come.
^0: For the googles, it is also a c++ compile time raytracer and a c++ meta ray tracer (and unsurprisingly, it is even a c++ meta raytracer (and surely, a c++ template ray tracer)) :D
ORIGINAL README
metatrace
A mostly useless (but funny) C++ Compile Time Ray Tracer.
-------------------------------------------------------------------------------
todo's for this document:
* Proper formatting
* Expand 'Scene configuration'
-------------------------------------------------------------------------------
===============================================================================
DESCRIPTION
===============================================================================
===============================================================================
"USAGE"
===============================================================================
-------------------------------------------------------------------------------
Compiling (for gcc users)
-------------------------------------------------------------------------------
0) Prerequisites
If you know how to invoke g++ 4.4 or newer on your box, skip this section.
Basic C++0x support is required. Make sure you have at least g++
version 4.4 installed:
$ g++ --version
g++-4.4 (Debian 4.4.0-5) 4.4.0
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you have less than 4.4, grab a newer copy from your distro or from
http://gcc.gnu.org.
It might also be that you have 4.4 or newer installed, but it might not be the
default. In that case (in bash), to see your options:
$ g++
g++ g++-4.3 g++-4.4
So instead of just "g++", type "g++-4.4".
1) Option 1.
Simply compile src/main.cc in C++0x mode:
$ g++ -std=c++0x src/main.cc
You probably get a plethora of error messages, so increase the template
recursion limit (sidenote: the Holy Standard states that portable programs
shall not rely on recursion depths greater than 17); a depth of 10000 was
enough for me in all cases:
$ g++ -std=c++0x -ftemplate-depth-10000 src/main.cc
If all went fine (after possibly hours and days of compiling, depending on
image size), you'll reap a classy "a.out". That binary consists of pure
output, no more calculations (we did it at compile time); actually, it prints
a PPM file. So:
$ ./a.out > result.ppm
Open up that file in an image viewer of your choice, et voila.
2) Option 2.
g++ .暂无开放 Issues,或尚未同步最近议题。