You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/Getting-Started.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ The `RenderPasses` folder contains a number of components ("Render Passes") that
24
24
There are two main workflows when using Falcor:
25
25
26
26
### Render Graphs
27
-
The recommended workflow when prototyping or implementing rendering techniques is to create render passes, render graphs, then render them with Mogwai. The [tutorials](../Tutorials/index.md) focus on this workflow.
27
+
The recommended workflow when prototyping or implementing rendering techniques is to create render passes, render graphs, then render them with Mogwai. The [tutorials](./Tutorials/index.md) focus on this workflow.
28
28
29
29
#### To run a sample Render Graph:
30
30
1. Build the Falcor Solution
@@ -65,9 +65,9 @@ When running from Visual Studio:
65
65
- Any directory that was added to the data directories list by calling `addDataDirectory()`.
66
66
- Falcor looks for Shader files relative to your project folder.
67
67
68
-
Upon building, a project's `Data`folders and shader files will be automatically deployed to the `Data` and `Shader` folders in the executable directory while preserving folder hierarchy. When running an application from its executable, Falcor will search in these folders instead. This allows the build output folder to be self-contained for easy sharing.
68
+
Upon building, a project's `Data`folder and shader files will be automatically deployed to the `Data` and `Shaders` folders in the executable directory while preserving folder hierarchy. When running an application from its executable, Falcor will search in these folders instead. This allows the build output folder to be self-contained for easy sharing.
69
69
70
-
The best practice is to create a directory called `Data/` next to your **project** file and place all your data files there. Your shader files should also have a `.slang`, `.slangh`, `.hlsl`, or `.hlsli` extension. Files with these extensions will be marked with the `Shader Source` item type in Visual Studio, and only these files will be deployed. Headers with a `.h` should be used for host-only files. Headers that will be shared between host and shader files should use the `.slangh` extension.
70
+
The best practice is to create a directory called `Data` next to your **project** file and place all your data files there. Your shader files should also have a `.slang`, `.slangh`, `.hlsl`, or `.hlsli` extension. Files with these extensions will be marked with the `Shader Source` item type in Visual Studio, and only these files will be deployed. Headers with a `.h` should be used for host-only files. Headers that will be shared between host and shader files should use the`.slang` or`.slangh` extension.
71
71
72
72
To search for a data or shader file, call `findFileInDataDirectories()` or `findFileInShaderDirectories()` respectively.
Copy file name to clipboardExpand all lines: Docs/Tutorials/02-Implementing-a-Render-Pass.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
--------
4
4
5
+
# Implementing a Render Pass
6
+
5
7
Now that you've successfully loaded a render graph into Mogwai through a script, let's create one. A render graph is formed from a number of component render passes. This tutorial will focus on creating render passes through an example pass that blits a source texture into a destination texture; graph creation and editing will be the subject of the next.
We will ignore further details regarding render passes and their implementation for the purposes of this tutorial. Additional information can be found [here](../Usage/Render-Passes.md).
94
+
We will ignore further details regarding render passes and their implementation for the purposes of this tutorial. Additional information can be found [here](../Usage/Render-Passes.md).
Copy file name to clipboardExpand all lines: Docs/Tutorials/03-Creating-and-Editing-Render-Graphs.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
--------
4
4
5
+
# Creating and Editing Render Graphs
6
+
5
7
Now that we've written a simple render pass, we turn our attention to creating and editing render graphs. There are two methods of doing this: using the Render Graph Editor and using Python scripting. We will cover both in this tutorial though using the editor is recommended.
6
8
7
9
## Render Graph Editor
@@ -71,9 +73,9 @@ The graph containing `ExampleBlitPass` we created using the editor above would l
Copy file name to clipboardExpand all lines: Docs/Tutorials/04-Writing-Shaders.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
--------
4
4
5
+
# Writing Shaders
6
+
5
7
Now that we've written a basic render pass and render graph, let's look at writing more complex passes that use shaders. Falcor uses the Slang shading language and compiler, and files should use one of the following extensions: `.slang`, `.slangh`, `.hlsl`, `.hlsli`. For more information on best practices for working with shaders in Falcor, please refer to the *Using Shaders and Data Files* section of the [Getting Started](../Getting-Started.md) page.
6
8
7
9
For this tutorial, we'll create a pass that renders a scene as a wireframe of a particular color.
Our first render pass had no need for a `Scene` object; however, this pass does and will need this function to set `mpScene`. We will also need to add all scene macro definitions to `mpProgram` and create our `GraphicsVars` so that we can bind shader values later in `execute()`. These are done like so:
65
+
Our first render pass had no need for a `Scene` object; however, this pass does and will need this function to set `mpScene`. We first need to set `mpScene` to the scene that's passed in then add all scene defines to `mpProgram`. We then create our `GraphicsVars` so that we can bind shader variables later in `execute()`. These are done like so:
We need some way to tell Slang/HLSL exactly how many resources the scene needs to bind and need to ensure that this scene data is portable between shaders. However, there's currently no way to do this automatically, so we use scene defines to communicate this information.
72
76
73
77
### `execute()`
74
78
This function will need to perform several operations: create and bind an FBO for our output to the `GraphicsState`, set the render state, and render our scene by calling `Scene::render()`.
@@ -94,7 +98,7 @@ With our scene, shader, and both the `GraphicsState` and `RasterizerState` set u
Using the Render Graph Editor, create a graph solely containing this pass then launch it in Mogwai. Don't worry about needing to load a scene; Mogwai will load the Arcade scene by default. You should see something similar to this:
121
+
Using the Render Graph Editor, create a graph solely containing this pass then launch it in Mogwai. You should see a black screen as there is no scene currently loaded. Load a scene by going to `File -> Load Scene`, and you should now see the wireframe for the scene you selected. We used Arcade.fscene (located in the `Media` folder), which looks like this:
Copy file name to clipboardExpand all lines: Docs/Usage/Environment-Variables.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,5 +10,5 @@ The following environment variables are used in Falcor:
10
10
|-----|-----|
11
11
|`FALCOR_DEVMODE`| Set to `1` to enable development mode. In development mode, shader and data files are picked up from the `Source` folder instead of the binary output directory allowing for shader hot reloading (`F5`). Note that this environment variable is set by default when launching any of the Falcor projects from Visual Studio. |
12
12
|`FALCOR_MEDIA_FOLDERS`| Specifies a semi-colon (`;`) separated list of absolute path names containing Falcor scenes. Falcor will search in these paths when loading a scene from a relative path name. |
13
-
|`FALCOR_GPU_VENDOR_ID`| Specify which GPU vendor to use for rendering. This is useful when having multiple GPUs in a system (e.g. laptop with both integrated and discrete GPUs). Use `0x10DE` to select the NVIDIA GPU. |
14
-
|`FALCOR_GPU_DEVICE_ID`|Specify which GPU to use for rendering. This is useful when having multiple GPUs that can be used in parallel by multiple Falcor instances. |
13
+
|`FALCOR_GPU_VENDOR_ID`| Specify which GPU vendor to use for rendering. This is useful when having multiple GPUs in a system (e.g. laptop with both integrated and discrete GPUs). Falcor tries to select an NVIDIA GPU by default. |
14
+
|`FALCOR_GPU_DEVICE_ID`|Of the GPUs matching the vendor ID specified by `FALCOR_GPU_VENDOR_ID` (or NVIDIA GPUs if unspecified), selects which GPU index to choose. This is useful when having multiple GPUs that can be used in parallel by multiple Falcor instances. By default, the first GPU (ID 0) is used. |
Copy file name to clipboardExpand all lines: Docs/Usage/Path-Tracer.md
+29-26Lines changed: 29 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@
13
13
- From the top menu bar, click `Load Script`, then navigate to `PathTracer.py`.
14
14
- Press `Ctrl + O`, then navigate to `PathTracer.py`.
15
15
- Drag and drop `PathTracer.py` into the application window.
16
+
- Load at startup using the Mogwai `--script` command line option.
16
17
5. Load a model or scene using one of the following methods. A sample scene is included, located at `Media/Arcade/Arcade.fscene`. Falcor can also load any format supported by Assimp.
17
18
- From the top menu bar, click `Load Scene`, then select a file.
The `MegakernelPathTracer` render pass implements an unbiased path tracer in DXR. Paths are created in a raygen shader and hit/miss points are reported back from the respective shader stages. The raygen shader loops over path segments up to the maximum configured path length.
26
+
The `MegakernelPathTracer` render pass implements an unbiased path tracer in DXR 1.0. Paths are created in a raygen shader and hit/miss points are reported back from the respective shader stages. The raygen shader loops over path segments up to the maximum configured path length.
26
27
27
28
For each pixel on screen, `samplesPerPixel` paths are traced.
28
29
At each path vertex (black dots), a configurable number `lightSamplesPerVertex` of shadow rays (dashed lines) is traced to sampled light sources.
@@ -43,7 +44,7 @@ The V-buffer input is the default. It is configured using a parameter `useVBuffe
43
44
44
45
When configured to use G-buffer input:
45
46
46
-
-`bitangentW` is optional and only really needed for anisotropic materials (not supported yet) or if consistent tangent frames are needed. If not connected, a tangent frame is created based on the normal.
47
+
-`tangentW` is optional and only really needed for anisotropic materials (not supported yet) or if consistent tangent frames are needed. If not connected, a tangent frame is created based on the normal.
47
48
-`viewW` is optional but needed for correct shading with depth-of-field (otherwise the view direction points towards the camera origin, instead of the actual lens sample position).
48
49
-`vbuffer` is optional but needed for correct shading with dielectrics (glass), as the renderer fetches the material ID from this input.
49
50
- All other inputs are required.
@@ -52,7 +53,9 @@ When configured to use G-buffer input:
52
53
53
54
- All outputs are optional.
54
55
- Only outputs that are connected are computed.
55
-
- The `rayCount` is a fullscreen 32-bit integer buffer storing number of rays traced per pixel (for debugging/visualization purposes).
56
+
- The `rayCount` is a fullscreen 32-bit uint buffer storing number of rays traced per pixel for debugging/visualization purposes.
57
+
- The `pathLength` is a fullscreen 32-bit uint buffer storing the path length per pixel for debugging/visualization purposes.
58
+
- The `time` output is a fullscreen 32-bit uint buffer with GPU execution time per pixel (requires NVAPI).
56
59
57
60
58
61
### Example: Progressive path tracer in the render graph editor
@@ -70,48 +73,48 @@ Note: Multiple importance sampling is applied to the strategies marked MIS.
0 commit comments