Skip to content

Raytracing in one weekend, in PowerShell.

Notifications You must be signed in to change notification settings

RangHo/powershell-raytracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Raytracing in One Weekend, PowerShell edition

This project is part of Project Lemonade.

Simple path tracer written in PowerShell, based on Raytracing in One Weekend online book.

Currently, this repository can generate the following image:

Preview image

This image was created using the follwing command every commit made to the main branch:

Import-Module .\Sources\PSRaytracing.psm1
Invoke-Raytracing `
  -ImageWidth 640 `
  -ImageHeight 360 `
  -OutputFile "output.png"

Why PowerShell of all things

Read this explanation from Project Lemonade website.

How to run

First, clone and enter this repository.

git clone https://github.com/RangHo/powershell-raytracing
cd powershell-raytracing

Enter PowerShell, and import the PSRaytracing module available in Sources/ directory.

Import-Module .\Sources\PSRaytracing.psm1

This module provides Invoke-Raytracing cmdlet that renders a scene. Provide -ImageWidth and -ImageHeight to set the output image's width and height.

Invoke-Raytracing -ImageWidth 160 -ImageHeight 90

Since all vector arithmetic is implemented in PowerShell, the rendering process is extremely slow. Currently there is no plan to accelerate individual calculations via .NET Numerics library. Speed is not part of the goal of this project, but it may be implemented in the future, after the base implementation is complete.

About

Raytracing in one weekend, in PowerShell.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published