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:
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"
Read this explanation from Project Lemonade website.
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.