Skip to content

Commit 25987bd

Browse files
authored
Merge pull request #414 from stride3d/master
Deploy latest documentation updates to staging
2 parents 03e21dd + 7366466 commit 25987bd

File tree

7 files changed

+17
-7
lines changed

7 files changed

+17
-7
lines changed

en/ReleaseNotes/ReleaseNotes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ A massive thank you to the open-source Stride community for your dedicated contr
1010

1111
## Minor releases since the last major release
1212

13+
- [4.2.0.2381](https://github.com/stride3d/stride/releases/tag/releases%2F4.2.0.2381): March 2025
14+
- [4.2.0.2374](https://github.com/stride3d/stride/releases/tag/releases%2F4.2.0.2374): February 2025
1315
- [4.2.0.2293](https://github.com/stride3d/stride/releases/tag/releases%2F4.2.0.2293): January 2025
1416
- [4.2.0.2282](https://github.com/stride3d/stride/releases/tag/releases%2F4.2.0.2282): December 2024
1517
- [4.2.0.2232](https://github.com/stride3d/stride/releases/tag/releases%2F4.2.0.2232): September 2024

en/community-resources/rendering-and-camera.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
- [StrideCameraController](https://github.com/herocrab/StrideCameraController) - Swapping Cameras/Resident Evil Style
3232
- [CameraFollow.cs](https://gist.github.com/ykafia/371b310de1ba7bb8ab3d2feffce2a190)
3333
- [SplitScreen](https://github.com/profan/XenkoByteSized#xenkobytesizedsplitscreen)
34-
34+
- [Multiple Cameras in the scene](https://www.youtube.com/watch?v=_qUhcn9i_yw)

en/manual/graphics/materials/materials-for-developers.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ This diagram shows the Material interfaces and implementation classes:
1717

1818
The file @'Stride.Rendering.Materials.MaterialKeys' contains most material keys you might need to use, have a look through it to figure out which one you might need to get to modify the parameter you are interested in.
1919

20-
Let's say you have this fairly simple material
20+
Let's say you have this fairly simple material:
21+
2122
![media/runtime-param-modif-ex.png](media/runtime-param-modif-ex.png)
2223

2324
And you want to clone that material, but change its color to red at runtime.
2425
Searching through the different keys contained in @'Stride.Rendering.Materials.MaterialKeys' you would find `MaterialKeys.DiffuseValue` and use it as the key to set the new color value you want:
26+
2527
```csharp
2628
var clone = SerializerExtensions.Clone(MyMaterial);
2729
clone.Passes[0].Parameters.Set(MaterialKeys.DiffuseValue, new Color4(1, 0, 0));

en/manual/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ These pages contain information about how to use Stride, an open-source C# game
1313

1414
#### Manual
1515

16+
- <span class="badge text-bg-info">Updated</span> [Graphics - Materials - Materials for developers ](graphics/materials/materials-for-developers.md) - Modifying parameters at runtime added
1617
- <span class="badge text-bg-success">New</span> [Scripts](scripts/best-practice.md) - Best Practises docs added
1718
- <span class="badge text-bg-success">New</span> [Physics](physics/index.md) - Bepu Physics docs added
1819
- <span class="badge text-bg-info">Updated</span> [Bullet Physics](physics-bullet/index.md) - Bullet Physics docs moved
@@ -23,7 +24,7 @@ These pages contain information about how to use Stride, an open-source C# game
2324

2425
#### Contributing
2526

26-
- <span class="badge text-bg-info">Updated</span> [Contributing - Roadmap](../contributors/roadmap.md) - GitHup Project - Roadmap link added
27+
- <span class="badge text-bg-info">Updated</span> [Contributing - Roadmap](../contributors/roadmap.md) - GitHub Project - Roadmap link added
2728

2829
### Previous updates
2930

en/manual/scripts/create-a-model-from-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ var materialDescription = new MaterialDescriptor
154154
}
155155
};
156156
var material = Material.New(GraphicsDevice, materialDescription);
157-
material.Parameters[0].Set(MaterialKeys.DiffuseValue, Color.Red);
157+
material.Passes[0].Parameters.Set(MaterialKeys.DiffuseValue, Color.Red);
158158
model.Materials.Add(0, material);
159159
```
160160

en/manual/scripts/custom-assets.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ using Stride.Core.BuildEngine;
3737
using Stride.Core.Serialization;
3838
using Stride.Core.Serialization.Contents;
3939
using Stride.Engine;
40+
using Stride.Engine.Design;
4041

4142
namespace YOUR_GAME_NAMESPACE;
4243

@@ -45,7 +46,11 @@ namespace YOUR_GAME_NAMESPACE;
4546
/// </summary>
4647
[DataContract]
4748
[ContentSerializer(typeof(DataContentSerializerWithReuse<YOUR_CLASS>))]
49+
// The ReferenceSerializer attribute is required when specifying a DataSerializerGlobal with ReferenceSerializer<>,
50+
// The two of them specifies to the serializers that this class is a runtime Asset
4851
[ReferenceSerializer, DataSerializerGlobal(typeof(ReferenceSerializer<YOUR_CLASS>), Profile = "Content")]
52+
// The line below ensures that the asset's reference is re-used instead of cloned for all new instances when instantiating prefabs
53+
[DataSerializerGlobal(typeof(CloneSerializer<YOUR_CLASS>), Profile = "Clone")]
4954
public class YOUR_CLASS
5055
{
5156
// Replace this with whatever you would want this asset to hold at runtime
@@ -122,7 +127,7 @@ public sealed class YOUR_CLASS_COMPILER : AssetCompilerBase
122127
```
123128

124129
> [!Warning]
125-
> Every changes made to the runtime asset will break previously built asset databases, make sure to delete the build artifacts stride generates for assets (`YOUR_PROJECT.Windows/obj/stride` and `bin/db`) after changing the class to make sure the asset database is fully rebuilt on the next build.
130+
> Every changes made to the runtime asset will break previously built asset databases, make sure to clean the solution or manually delete the build artifacts stride generates for assets (`YOUR_PROJECT.Windows/obj/stride` and `bin/db`) after changing the class to make sure the asset database is fully rebuilt on the next build.
126131
127132
This takes care of the support for this asset, you could create a `*.blks` file inside your `Assets` directory and fill in the content manually, but might as well do it through the editor ...
128133

@@ -189,4 +194,4 @@ And you're finally done, have fun !
189194

190195
## See also
191196

192-
* [Best Practice](best-practice.md)
197+
* [Best Practice](best-practice.md)

en/manual/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ items:
540540
href: scripts/gizmos.md
541541
- name: Create Custom Assets
542542
href: scripts/custom-assets.md
543-
- name: Best Practice
543+
- name: Best Practices
544544
href: scripts/best-practice.md
545545

546546
- name: Sprites

0 commit comments

Comments
 (0)