Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Jul 18, 2024. It is now read-only.
/tiny-pathPublic archive

An instructive one-file Ruby path tracer

License

NotificationsYou must be signed in to change notification settings

JVillella/tiny-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A tiny, one-file, Monte Carlo path tracer written in a few hundred lines of Ruby. The source accompanied a short talk I gave as an introduction to Ray Tracing (presentation slides availablehere). The hope is that it provides a simple to understand example. The image below is the rendered output at 1024spp.

Features

  • Monte Carlo method
  • Global illumination
  • Diffuse, and specular BRDFs
  • Ray-sphere intersection
  • Soft shadows
  • Anti-aliasing
  • Modified Cornell box
  • PNG image format output
  • Progressive saving

Usage

$ ruby tiny-path.rb --helpUsage: tiny-path.rb [options]    -w, --width=width                Image width    -h, --height=height              Image height    -s, --spp=spp                    Samples per pixel    -o, --output=filename            Output filename    -p, --[no-]progressive-save      Save file while rendering

To render the scene at 16 samples per pixel, run the following command,

$ ruby tiny-path.rb -s 16

It will save a file in the same directory titledoutput.png.

Author

Julian Villella

License

Tiny Path is available under the MIT license. See the LICENSE file for more info.

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp