Skip to content

Commit 57e3d42

Browse files
authored
4.1 (#234)
* Falcor 4 Revision 1
1 parent 76816c0 commit 57e3d42

File tree

269 files changed

+4786
-2529
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+4786
-2529
lines changed

Build/deploycommon.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ robocopy %ExtDir%\FreeImage %OutDir% freeimage.dll /r:0 >nul
2525
robocopy %ExtDir%\assimp\bin\%2 %OutDir% *.dll /r:0 >nul
2626
robocopy %ExtDir%\FFMpeg\bin\%2 %OutDir% *.dll /r:0 >nul
2727
rem robocopy %ExtDir%\dxcompiler\%2 %OutDir% dxcompiler.dll /r:0 >nul
28-
robocopy %ExtDir%\OptiX\bin64 %OutDir% *.dll /r:0 >nul
2928
robocopy %ExtDir%\openvr\bin\win64 %OutDir% openvr_api.dll /r:0 >nul
3029
robocopy %ExtDir%\Slang\bin\windows-x64\release %OutDir% *.dll /r:0 >nul
3130
robocopy %ExtDir%\GLFW\lib %OutDir% *.dll /r:0 >nul

Docs/Tutorials/04-Writing-Shaders.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ This function will need to perform several operations: create and bind an FBO fo
7777
We can create and bind an FBO for our renderer to render to by first calling `Fbo::create()` on our output texture, clearing it to remove any data from previous executions (preventing it from leaving permanent trails if you try to move the camera), and calling `GraphicsState::setFbo()` to bind it. This step looks like this:
7878
```c++
7979
auto pTargetFbo = Fbo::create({ renderData["output"]->asTexture() });
80-
const glm::vec4 clearColor(0, 0, 0, 1);
80+
const float4 clearColor(0, 0, 0, 1);
8181
pRenderContext->clearFbo(pTargetFbo.get(), clearColor, 1.0f, 0, FboAttachmentType::All);
8282
mpGraphicsState->setFbo(pTargetFbo);
8383
```
@@ -86,7 +86,7 @@ mpGraphicsState->setFbo(pTargetFbo);
8686
We need to perform two operations here: indicate that we want to use a custom `RasterizerState` and bind all necessary values to our shader. We can indicate that we're using a custom `RasterizerState` by creating a `Scene::Renderflags` object and setting the flag `Scene::RenderFlags::UserRasterizerState`. Binding shader values is also fairly straightforward as Falcor allows you to set shader values in the `GraphicsVars` object in the same way as you would set values in an array. Our shader requires a single color value, `gColor`, which is located inside the `perFrameCB` constant buffer. This step should look like this:
8787
```c++
8888
Scene::RenderFlags renderFlags = Scene::RenderFlags::UserRasterizerState;
89-
mpVars["perFrameCB"]["gColor"] = vec4(0, 1, 0, 1);
89+
mpVars["perFrameCB"]["gColor"] = float4(0, 1, 0, 1);
9090
```
9191

9292
#### Rendering a Scene Using the Shader
@@ -99,18 +99,18 @@ Your `execute()` function should now look like this:
9999
void WireframePass::execute(RenderContext* pRenderContext, const RenderData& renderData)
100100
{
101101
auto pTargetFbo = Fbo::create({ renderData["output"]->asTexture() });
102-
const glm::vec4 clearColor(0, 0, 0, 1);
102+
const float4 clearColor(0, 0, 0, 1);
103103
pRenderContext->clearFbo(pTargetFbo.get(), clearColor, 1.0f, 0, FboAttachmentType::All);
104104
mpGraphicsState->setFbo(pTargetFbo);
105105
106106
// Set render state
107107
Scene::RenderFlags renderFlags = Scene::RenderFlags::UserRasterizerState;
108-
mpVars["PerFrameCB"]["gColor"] = vec4(0, 1, 0, 1);
108+
mpVars["PerFrameCB"]["gColor"] = float4(0, 1, 0, 1);
109109
110110
mpScene->render(pRenderContext, mpGraphicsState.get(), mpVars.get(), renderFlags);
111111
}
112112
```
113113

114114
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:
115115

116-
![WireframePass](./images/WireframePass.png)
116+
![WireframePass](./images/WireframePass.png)

Docs/Tutorials/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
1. [Mogwai Usage](./01-Mogwai-Usage.md)
88
2. [Implementing Render Passes](./02-Implementing-a-Render-Pass.md)
9-
3. [Creating and Editing Render Graphs](./03-Creating-And-Editing-Render-Graphs.md)
9+
3. [Creating and Editing Render Graphs](./03-Creating-and-Editing-Render-Graphs.md)
1010
4. [Writing Shaders](./04-Writing-Shaders.md)

Docs/Usage/Render-Passes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ static void regExampleClass(ScriptBindings::Module& m)
123123
{
124124
auto c = m.regClass(SomeClass);
125125
c.property("property", &SomeClass::getProperty, &SomeClass::setProperty);
126+
c.roProperty("readOnlyProperty", &SomeClass::getReadOnlyProperty);
126127
}
127128
```
128129
This allows you to access the bound properties of your pass the same way you would access properties for any given instance of a Python class.

Docs/Usage/Scene-Creation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Scene::SharedPtr pScene = pBuilder->getScene();
2020
Model loading functions also provide an optional parameter for creating multiple instances of a model from file. The following example loads a model from file and creates two instances at positions [-5, 0, 0] and [5, 0, 0].
2121
```c++
2222
SceneBuilder::InstanceMatrices instances = {
23-
glm::translate(vec3(-5.0f, 0.0f, 0.0f)),
24-
glm::translate(vec3(5.0f, 0.0f, 0.0f))
23+
glm::translate(float3(-5.0f, 0.0f, 0.0f)),
24+
glm::translate(float3(5.0f, 0.0f, 0.0f))
2525
};
2626

2727
SceneBuilder::SharedPtr pBuilder = SceneBuilder::create("path/to/model.file", SceneBuilder::Flags::Default. instances);

Docs/Usage/Scene-Formats.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
### [Index](../index.md) | [Usage](./index.md) | Scene Formats
2+
3+
--------
4+
5+
# Scene Formats
6+
7+
Falcor uses [Assimp](https://github.com/assimp/assimp) as its core asset loader and can load all file formats Assimp supports by default.
8+
9+
From assets, Falcor will import:
10+
- Scene Graph
11+
- Meshes
12+
- Materials
13+
- Diffuse Texture
14+
- Metal-Rough Shading Model (Default)
15+
- RGB: Base Color
16+
- Spec-Gloss Shading Model (Default for OBJ only)
17+
- RGB: Diffuse Color
18+
- Specular Parameters Texture
19+
- Metal-Rough Shading Model (Default)
20+
- R: Occlusion
21+
- G: Roughness
22+
- B: Metallic
23+
- Spec-Gloss Shading Model (Default for OBJ only)
24+
- RGB: Specular Color
25+
- A: Glossiness
26+
- Normals Texture
27+
- Occlusion Texture (Used for Spec-Gloss shading model only)
28+
- Emissive Color/Texture
29+
- The first camera
30+
- Point lights
31+
- Directional lights
32+
- Keyframe animations
33+
- Skinned animations
34+
35+
36+
## Python Scene Files
37+
38+
You can also leverage Falcor's scripting system to set values in the scene on load that are not supported by standard file formats. These are also written in Python, but are formatted differently than normal Falcor scripts.
39+
40+
### Usage
41+
42+
The first line must be a Python comment containing only a path to the base asset to be loaded. File paths in Python scene files may be relative to the file itself, in addition to standard Falcor data directories.
43+
44+
```python
45+
# BistroInterior.fbx
46+
```
47+
48+
The asset will be loaded and will be bound to an object called `scene`. Through this object, you have access to any script bindings accessible through Scenes. See the [scripting documentation](./Scripting) for a full list of functions and properties.
49+
50+
Example:
51+
52+
```python
53+
# BistroInterior.fbx
54+
# Line above loads BistroInterior.fbx from the same folder as the script
55+
56+
scene.setEnvMap("BistroInterior.hdr") # Set the environment map to "BistroInterior.hdr" located in the same folder as the script
57+
58+
bottle_wine = scene.getMaterial("TransparentGlassWine") # Get a material from the scene by name
59+
60+
# Set material properties
61+
bottle_wine.indexOfRefraction = 1.55
62+
bottle_wine.specularTransmission = 1
63+
bottle_wine.doubleSided = True
64+
bottle_wine.nestedPriority = 2
65+
bottle_wine.volumeAbsorption = float3(0.7143, 1.1688, 1.7169)
66+
```

0 commit comments

Comments
 (0)