Quellcode durchsuchen

fix: Readability improvements

Vaclav Elias vor 1 Jahr
Ursprung
Commit
5b4a623b38

+ 5 - 8
en/manual/graphics/materials/shading-attributes.md

@@ -20,7 +20,6 @@ The **diffuse** is the basic color of the material. A pure diffuse material is c
 The final diffuse contribution is calculated like this:
 
 - the **diffuse** defines the color used by the diffuse model
-
 - the **diffuse model** defines which shading model is used for rendering the diffuse component (see below)
 
 Currently, the diffuse attribute supports only a **diffuse map**.
@@ -42,7 +41,7 @@ Under the Lambert model, light is reflected equally in all directions with an in
 
 | Property      | Description  
 | ------------- | ----------- 
-| Diffuse map   | The diffuse map color provider                                          
+| Diffuse map   | The diffuse map color provider
 | Diffuse model | The shading model for diffuse lighting
 
 ## Specular
@@ -62,10 +61,8 @@ By taking into into account the fact that almost all materials always have some
 The final specular color is calculated by mixing a fixed low-reflection color and the diffuse color.
 
 - With the metalness color at `0.0`, the effective specular color is equal to `0.02`, while the diffuse color is unchanged. The material is not metal but exhibits some reflectance and is sensitive to the Fresnel effect.
-
 - With the metalness color at `1.0`, the effective specular color is equal to the diffuse color, and the diffuse color is set to `0`. The material is considered a pure metal.
-
-    ![media/material-attributes-26.png](media/material-attributes-26.png) 
+  ![media/material-attributes-26.png](media/material-attributes-26.png) 
 
  The screenshots below show the result of the metalness factor on a material with the following attributes:
 
@@ -100,9 +97,9 @@ The microfacet is defined by the following formula, where Rs is the resulting sp
 
 | Property            | Description                                                    
 | ------------------- | ------- 
-| Fresnel             | Defines the amount of light that is reflected and transmitted. The models supported are: <br><p>**Schlick**: An approximation of the Fresnel effect (default)</br> <br><p>**Thin glass**: A simulation of light passing through glass</br>  <br><p>**None**: The material as-is with no Fresnel effect</br> 
-| Visibility          | Defines the visibility between of the microfacets between (0, 1). Also known as the geometry attenuation - Shadowing and Masking - in the original Cook-Torrance. Stride simplifies the formula to use the visibility term instead: <br><p>![media/material-attributes-35.png](media/material-attributes-35.png)</br>      <br><p>and <br><p>![media/material-attributes-36.png](media/material-attributes-36.png)</br>        <br><p>**Schlick GGX** (default)</br> <br><p> **Implicit**: The microsurface is always visible and generates no shadowing or masking</br> <br><p>**Cook-Torrance**</br>  <br><p>**Kelemen**</br> <br><p>**Neumann**</br> <br><p>**Smith-Beckmann**</br> <br><p>**Smith-GGX correlated**</br>  <br><p>**Schlick-Beckmann**</br> 
-| Normal Distribution | <br><p>Defines how the normal is distributed. The gloss attribute is used by this part of the function to modify the distribution of the normal.</br> <br><p>**GGX** (default) </br> <br><p>**Beckmann**</br>  <br><p>**Blinn-Phong**</br> 
+| Fresnel             | Defines the amount of light that is reflected and transmitted. The models supported are: <br>**Schlick**: An approximation of the Fresnel effect (default)<br>**Thin glass**: A simulation of light passing through glass<br>**None**: The material as-is with no Fresnel effect
+| Visibility          | Defines the visibility between of the microfacets between (0, 1). Also known as the geometry attenuation - Shadowing and Masking - in the original Cook-Torrance. Stride simplifies the formula to use the visibility term instead: <br>![media/material-attributes-35.png](media/material-attributes-35.png)<br>and<br>![media/material-attributes-36.png](media/material-attributes-36.png)<br>**Schlick GGX** (default)<br>**Implicit**: The microsurface is always visible and generates no shadowing or masking<br>**Cook-Torrance**<br>**Kelemen**<br>**Neumann**<br>**Smith-Beckmann**<br>**Smith-GGX correlated**<br>**Schlick-Beckmann** 
+| Normal Distribution | Defines how the normal is distributed. The gloss attribute is used by this part of the function to modify the distribution of the normal.<br>**GGX** (default)<br>**Beckmann**<br>**Blinn-Phong**
 
 ## Emissive
 

+ 37 - 34
en/manual/scripts/types-of-script.md

@@ -16,10 +16,10 @@ Example:
 ```cs
 public class StartUpScriptExample : StartupScript
 {
-	public override void Start()
-	{
-		// Do some stuff during initialization
-	}
+  public override void Start()
+  {
+    // Do some stuff during initialization
+  }
 }
 ```
 
@@ -36,10 +36,10 @@ The following script performs updates every frame, no matter what:
 ```cs
 public class SampleSyncScript : SyncScript
 {        
-	public override void Update()
-	{
-		// Performs the update on the entity — this code is executed every frame
-	}
+  public override void Update()
+  {
+    // Performs the update on the entity — this code is executed every frame
+  }
 }
 ```
 
@@ -48,7 +48,6 @@ public class SampleSyncScript : SyncScript
 Asynchronous scripts are initialized only once, then canceled when removed from the scene.
 
 * Asynchronous code goes in the [Execute](xref:Stride.Engine.AsyncScript.Execute) function.
-
 * Code performing the cancellation goes in the [Cancel](xref:Stride.Engine.ScriptComponent.Cancel) method.
 
 The following script performs actions that depend on events and triggers:
@@ -56,34 +55,38 @@ The following script performs actions that depend on events and triggers:
 ```cs
 public class SampleAsyncScript : AsyncScript
 {        
-	public override async Task Execute() 
-	{
-		// The initialization code should come here, if necessary
-		// This method starts running on the main thread
-		
-		while (Game.IsRunning) // loop until the game ends (optional depending on the script)
-		{
-			// We're still on the main thread
-
-			// Task.Run will pause the execution of this method until the task is completed,
-			// while that's going on, the game will continue running, it will display new frames and process inputs appropriately
-			var lobbies = await Task.Run(() => GetMultiplayerLobbies());
-
-			// After awaiting a task, the thread the method runs on will have changed, this method now runs on a thread pool thread instead of the main thread
-			// You can manipulate the data returned by the task here if needed
-			// But if you want to interact with the engine safely, you have to make sure the method runs on the main thread
-
-			// await Script.NextFrame() yields execution of this method to the main thread, meaning that this method is paused, and once the main thread processes the next frame,
-			// it will pick that method up and run it
-			await Script.NextFrame();
-			// So after this call, this method is back on the main thread
-
-			// You can now safely interact with the engine's systems by displaying the lobbies retrieved above in a UI for example
-		}
-	}
+  public override async Task Execute() 
+  {
+    // The initialization code should come here, if necessary
+    // This method starts running on the main thread
+      
+    while (Game.IsRunning) // loop until the game ends (optionalpendingon the script)
+    {
+      // We're still on the main thread
+
+      // Task.Run will pause the execution of this method until the task is completed,
+      // while that's going on, the game will continue running, it will display new frames and process inputs appropriately
+      var lobbies = await Task.Run(() => GetMultiplayerLobbies());
+
+      // After awaiting a task, the thread the method runs on will have changed,
+      // this method now runs on a thread pool thread instead of the main thread
+      // You can manipulate the data returned by the task here if needed
+      // But if you want to interact with the engine safely, you have to make sure the method runs on the main thread
+
+      // await Script.NextFrame() yields execution of this method to the main thread,
+      // meaning that this method is paused, and once the main thread processes the next frame,
+      // it will pick that method up and run it
+      await Script.NextFrame();
+      // So after this call, this method is back on the main thread
+
+      // You can now safely interact with the engine's systems by displaying the lobbies retrieved above in a UI for example
+    }
+  }
 }
 ```
 
+Check out an example from our [Async scripts tutorial](../../tutorials/csharpintermediate/async-scripts.md).
+
 ## See also
 
 * [Create a script](create-a-script.md)