From 83c9204f1e254dc9b1a80a79b2a3727112996a45 Mon Sep 17 00:00:00 2001 From: Shawn Tan Date: Sun, 30 Jun 2024 23:22:31 -0700 Subject: [PATCH] update create window article --- docs/articles/create-window.md | 17 ++++++++-- docs/articles/define-display.md | 13 ++++---- docs/articles/stimuli-alternative.md | 1 - docs/workflows/create-window.bonsai | 48 ++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 docs/workflows/create-window.bonsai diff --git a/docs/articles/create-window.md b/docs/articles/create-window.md index d2de41d..5fe4c9f 100644 --- a/docs/articles/create-window.md +++ b/docs/articles/create-window.md @@ -1,5 +1,18 @@ -# Create Window -## Under Construction - to add more details +# CreateWindow +:::workflow +![Create Window](../workflows/create-window.bonsai) +::: + +The `CreateWindow` operator creates an OpenGL window where all the stimuli will be rendered and contains many properties for adjusting the visual environment. + +- The `ClearColor` property specifies the background color of the visual environment. +- The `DisplayDevice` property controls which monitor the window will be displayed on (for instance if you have multiple monitors). +- The `TargetRenderFrequency` property controls how fast the stimuli are rendered (by default 60fps). +- The `TargetUpdateFrequency` property by default is set to the same as the `TargetRenderFrequency` but can actually be set higher (for instance 120fps) (useful if you have a high refresh rate monitor but cannot render at the higher `TargetRenderFrequency`). +- The `WindowBorder`property can be used to hide the window border or make it resizable (for instance, if you want the window to span multiple displays) +- The `WindowState` property controls how the the window will be displayed (for instance, you can make it full-screen) + + ## Video Walkthrough
diff --git a/docs/articles/define-display.md b/docs/articles/define-display.md index 4743d55..5e96457 100644 --- a/docs/articles/define-display.md +++ b/docs/articles/define-display.md @@ -17,12 +17,10 @@ Each `ViewWindow` must be accompanied by a `DrawViewport` operator. Additional d ## DrawViewport - The `DrawViewport` operator draws the `ViewWindow` to a display and provides additional options for positioning the `ViewWindow` on a display. This example workflow illustrates how we can combine the `ViewWindow` and `DrawViewport` operators to flexibly position different views (for instance, when we have two monitors side by side). -A single checkboard is drawn in the visual environment and two `ViewWindows` are positioned side by side (by adjusting the `X-axis` variable in the `Translation` property). Then we draw -the two views to two displays. +A single checkboard is drawn in the visual environment and two `ViewWindows` are positioned side by side (by adjusting the `X-axis` variable in the `Translation` property). Then we draw the two views to two displays. :::workflow @@ -36,19 +34,20 @@ the two views to two displays. ## Post-processing Operators (optional) -Bonvision comes with post-processing operators to correct for various distortions in the final display of the image. These operators would be placed between the `ViewWindow` and `DrawViewport` operator. +Bonvision comes with post-processing operators to correct for various distortions in the final display of the image (for instance, when using a projector in conjunction with a mirror/lens or projecting on non-uniform surfaces). These operators would be placed between the `ViewWindow` and `DrawViewport` operator. -### PerspectiveMapping and MeshMapping -Using a projector in conjunction with a mirror/lens or projecting on non uniform surfaces can cause distortions in the image, such that pixels across the display surface might not have the same physical dimensions. In this case, one would have to use these operators to warp the images to display them correctly. +### PerspectiveMapping The `PerspectiveMapping` operator can be used to correct distortions when projecting displays on the walls of an rectangular arena. One would specify 4 `ViewWindows`, one for each wall, and then specify a `PerspectiveMapping` for each view window to transform the view before attaching a `DrawViewport` operator. An example implementation can be found at https://groups.google.com/g/bonsai-users/c/WV7V57vlSAk/m/XjQPqCJkCAAJ. + +### MeshMapping The `MeshMapping` operator is best used to correct distortions when projecting displays on a demispherical dome. As the process is more complicated, check out the [mesh mapping calibration](./mesh-mapping-calibration.md) article for more information how to measure and calibrate this operator. -## GammaCorrection +### GammaCorrection The `GammaCorrection` operator applies simple intensity mapping of the three colors, to make sure the stimuli are linear. It uses a simple LUT (Look-up-table), for Red, Green and Blue. Check out the [gamma calibration](./gamma-calibration.md) article for more information on how to measure and calibrate this operator. ## Other nodes to document (under construction) diff --git a/docs/articles/stimuli-alternative.md b/docs/articles/stimuli-alternative.md index 3e4ab76..1563420 100644 --- a/docs/articles/stimuli-alternative.md +++ b/docs/articles/stimuli-alternative.md @@ -1,5 +1,4 @@ # Alternative Stimuli Creation -## Under Construction ## Dynamic Textures In addition to loading premade textures and videos, `BonVision` can display dynamic textures generated online or from other sources. diff --git a/docs/workflows/create-window.bonsai b/docs/workflows/create-window.bonsai new file mode 100644 index 0000000..a501f8c --- /dev/null +++ b/docs/workflows/create-window.bonsai @@ -0,0 +1,48 @@ + + + + + + + 640 + 480 + On + false + Black + DepthBufferBit ColorBufferBit + true + + Resizable + Normal + Primary + 60 + + + + + 8 + 8 + 8 + 8 + + 16 + 0 + 0 + + 0 + 0 + 0 + 0 + + 2 + false + + + + + + + \ No newline at end of file