Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noteed/smallpt-hs
A Haskell port of the C++ smallpt path tracer
https://github.com/noteed/smallpt-hs
Last synced: about 2 months ago
JSON representation
A Haskell port of the C++ smallpt path tracer
- Host: GitHub
- URL: https://github.com/noteed/smallpt-hs
- Owner: noteed
- License: bsd-3-clause
- Created: 2010-09-08T20:15:42.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2020-12-14T14:25:29.000Z (about 4 years ago)
- Last Synced: 2023-09-20T06:18:28.426Z (over 1 year ago)
- Language: Haskell
- Homepage:
- Size: 12.7 KB
- Stars: 15
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
smallpt-hs
==========**Update**: [bollu](https://github.com/bollu) and
[davean](https://github.com/davean) have made an [optmized
version](https://github.com/bollu/smallpt-opt).This is a port of [smallpt](http://www.kevinbeason.com/smallpt/), a global
illumination path tracer written in 99 lines of C++. The port is written in
99 lines of Haskell.There are two major differences: performance and argument parsing. The Haskell
code compiled with GHC 6.12.1 is about 4.5 times slower than the C++ version.
(I only tested on my anemic Atom N450-powered netbook...) The C++ code takes an
optional argument, which should be a integer greater than 4.Give it a spin
--------------The complete package contains more than the 99 lines smallpt-hs.hs file. There
are other variants with a criterion wrapper to benchmark the code. The cbits
directory contains the original smallpt.cpp file modified to be expose the main
entry point as a C symbol callable from Haskell via FFI.Every attempt so far use the vector package. The 99 lines file is derived from
Smallpt/Mutable.hs. The Storable code doesn't improve the performance and is
less convenient to use. The Unboxed code lose in performance because the Vec
type can't benefit from an explicit unpack pragma.If you can make the code faster or easier to read, please let me know!
License
-------Although the LICENSE file is a BSD3 license, I should contact Kevin Beason (the
original author of the C++ code) to make sure it is ok. The linked site above
has the original LICENSE.