瀏覽代碼

Merge pull request #9816 from ShawnHardern/update-creating-movies-csharp

Add C# example to Creating movies
A Thousand Ships 1 年之前
父節點
當前提交
c0d608cba1
共有 1 個文件被更改,包括 20 次插入1 次删除
  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