百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

metatrace

> DevOps
开源

metatrace是一个 C++ 编译时间,惠特德风格 Ray Tracer,使用经典 C++98/03 样式元编程. 所有雷追踪在编译过程中完成.

99 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

metatrace是一个 C++ 编译时间,惠特德风格 Ray Tracer,使用经典 C++98/03 样式元编程. 所有雷追踪在编译过程中完成.

ORIGINAL GITORIOUS PROJECT META

Metatrace

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.


Extern

  • Announcement
  • git origin
  • download release packages

Features

graphics viewpoint:

  • linear object list
  • recursive ray tracing (whitted style)
  • mirror reflections
  • spheres, axis aligned planes
  • quite easily extensible (considering the circumstances)
  • rgb colors
  • scalar type is fixed point
  • not fast

c++ viewpoint:

  • uses variadic templates in some contexts (e.g. scene, some math-operations)
  • fairly heavy compile time number crunching (brings back the "slow" in "ray tracing")
  • strongly typed enums, to avoid ugly enum hacks like "FORCE_DWORD=0xEFFFFFFF" and the like

bash viewpoint:

  • contains a bash script to compile on multiple cores

... more to come.


Example Rendering


^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· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++c-plus-pluscompiler-testingcompiler-torturecomputer-graphics

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理