From e046f6c4b9c701603304d379f6bbb4780c56c3ac Mon Sep 17 00:00:00 2001 From: Pascal Grittmann Date: Mon, 6 Jan 2025 18:01:23 +0100 Subject: [PATCH] Polyglot notebook utilities --- SeeSharp.Templates/SeeSharp.Templates.csproj | 2 +- SeeSharp/SeeSharp.csproj | 8 +++- SeeSharp/extension.dib | 44 ++++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 SeeSharp/extension.dib diff --git a/SeeSharp.Templates/SeeSharp.Templates.csproj b/SeeSharp.Templates/SeeSharp.Templates.csproj index 5ee3efd..bac1137 100644 --- a/SeeSharp.Templates/SeeSharp.Templates.csproj +++ b/SeeSharp.Templates/SeeSharp.Templates.csproj @@ -2,7 +2,7 @@ SeeSharp.Templates - 1.0.2 + 1.0.3 SeeSharp Experiment Template Pascal Grittmann Basic setup for a raytracing experiment with SeeSharp diff --git a/SeeSharp/SeeSharp.csproj b/SeeSharp/SeeSharp.csproj index 95ac48a..3ec4fd8 100644 --- a/SeeSharp/SeeSharp.csproj +++ b/SeeSharp/SeeSharp.csproj @@ -6,7 +6,7 @@ SeeSharp A flexibility-first framework for rapid prototyping of rendering algorithms. SeeSharp - 2.1.0 + 2.2.0 (c) Pascal Grittmann https://github.com/pgrit/SeeSharp @@ -30,9 +30,13 @@ + + + + - + diff --git a/SeeSharp/extension.dib b/SeeSharp/extension.dib new file mode 100644 index 0000000..a15f3fd --- /dev/null +++ b/SeeSharp/extension.dib @@ -0,0 +1,44 @@ +#!csharp + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Numerics; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Threading; +using System.Threading.Tasks; + +using TinyEmbree; +using SimpleImageIO; + +using SeeSharp; +using SeeSharp.Cameras; +using SeeSharp.Common; +using SeeSharp.Experiments; +using SeeSharp.Geometry; +using SeeSharp.Images; +using SeeSharp.Integrators; +using SeeSharp.Integrators.Bidir; +using SeeSharp.Integrators.Common; +using SeeSharp.Integrators.Util; +using SeeSharp.Sampling; +using SeeSharp.Shading; +using SeeSharp.Shading.Background; +using SeeSharp.Shading.Emitters; +using SeeSharp.Shading.Materials; + +// The polyglot notebook VSCode extension has exceptionally poor performance for rapid console output, +// so we suppress the progress bar updates +ProgressBar.Silent = true; + +// Loads a scene from file (using SceneRegistry) and initializes it for ray tracing with the given render resolution +Scene QuickloadScene(string name, int width, int height) { + var scene = SceneRegistry.LoadScene("CornellBox").MakeScene(); + scene.FrameBuffer = new(width, height, ""); + scene.Prepare(); + return scene; +}