Jelajahi Sumber

Add C# examples to Creating movies

Co-authored-by: Raul Santos <[email protected]>
Shawn Hardern 11 bulan lalu
induk
melakukan
25aae6b45e
1 mengubah file dengan 20 tambahan dan 1 penghapusan
  1. 20 1
      tutorials/animation/creating_movies.rst

+ 20 - 1
tutorials/animation/creating_movies.rst

@@ -285,7 +285,8 @@ This feature tag can also be queried in a script to increase quality settings
 that are set in the Environment resource. For example, to further improve SDFGI
 that are set in the Environment resource. For example, to further improve SDFGI
 detail and reduce light leaking:
 detail and reduce light leaking:
 
 
-::
+.. tabs::
+ .. code-tab:: gdscript
 
 
     extends Node3D
     extends Node3D
 
 
@@ -296,6 +297,24 @@ detail and reduce light leaking:
             get_viewport().world_3d.environment.sdfgi_min_cell_size *= 0.25
             get_viewport().world_3d.environment.sdfgi_min_cell_size *= 0.25
             get_viewport().world_3d.environment.sdfgi_cascades = 8
             get_viewport().world_3d.environment.sdfgi_cascades = 8
 
 
+ .. code-tab:: csharp
+
+    using Godot;
+
+    public partial class MyNode3D : Node3D
+    {
+        public override void _Ready()
+        {
+            if (OS.HasFeature("movie"))
+            {
+                // When recording a movie, improve SDFGI cell density
+                // without decreasing its maximum distance.
+                GetViewport().World3D.Environment.SdfgiMinCellSize *= 0.25f;
+                GetViewport().World3D.Environment.SdfgiCascades = 8;
+            }
+        }
+    }
+
 .. _doc_creating_movies_recording_at_higher_resolution:
 .. _doc_creating_movies_recording_at_higher_resolution:
 
 
 Rendering at a higher resolution than the screen resolution
 Rendering at a higher resolution than the screen resolution