mirror of
https://github.com/Smaug123/ray-tracing-fsharp
synced 2025-10-05 11:58:44 +00:00
Chapter 2 done
This commit is contained in:
@@ -45,5 +45,7 @@ Global
|
||||
{94792D42-3D22-4FAE-A15B-B89AAF6DB732}.Release|x64.Build.0 = Release|Any CPU
|
||||
{94792D42-3D22-4FAE-A15B-B89AAF6DB732}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{94792D42-3D22-4FAE-A15B-B89AAF6DB732}.Release|x86.Build.0 = Release|Any CPU
|
||||
{AE2CD8DA-FFA5-49BE-B5C9-1A96A3928325}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AE2CD8DA-FFA5-49BE-B5C9-1A96A3928325}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -4,17 +4,17 @@ namespace RayTracing
|
||||
module SampleImages =
|
||||
|
||||
let gradient (progressIncrement : float<progress> -> unit) : float<progress> * Image Async =
|
||||
let pixelAt i j =
|
||||
let pixelAt height width =
|
||||
{
|
||||
Red = (byte i)
|
||||
Green = (byte j)
|
||||
Blue = 64uy
|
||||
Red = (byte width)
|
||||
Green = 255uy - (byte height)
|
||||
Blue = 63uy
|
||||
}
|
||||
|
||||
256.0<progress>,
|
||||
async {
|
||||
return Array.init 256 (fun i ->
|
||||
let output = Array.init 256 (pixelAt i)
|
||||
return Array.init 256 (fun height ->
|
||||
let output = Array.init 256 (pixelAt height)
|
||||
progressIncrement 1.0<progress>
|
||||
output
|
||||
)
|
||||
|
Reference in New Issue
Block a user