Skip to content

Commit abf1821

Browse files
committed
Remove RegisterRender overload with no Bounds parameter
This commit brings breaking changes. To upgrade to this version you need now use overload with explicit bounds parameter.
1 parent dd745fc commit abf1821

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ renderArchetypeStorage.RegisterRender
2727
(
2828
renderID,
2929
material, // material with [Enable GPU Instancing] enabled and shader supporting instancing
30+
bounds // bounds in which sprites will be visible. For example new Bounds(Vector3.zero, Vector3.one * float.MaxValue)
3031
null, // override for MaterialPropertyBlock if needed
3132
128, // initial ComputeBuffers capacity
3233
128, // minimal capacity step for ComputeBuffers

Rendering/Components/RenderArchetypeStorage.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public class RenderArchetypeStorage : IComponentData
1616
internal readonly HashSet<int> RegisteredIds = new();
1717
/// <summary> System's state with all necessary data to pass to <see cref="RenderArchetype"/> to update </summary>
1818
internal SystemData SystemData;
19-
20-
internal static Bounds DefaultBounds => new (Vector3.zero, Vector3.one * 1000f);
2119

2220
internal void Dispose()
2321
{
@@ -67,21 +65,6 @@ private void GatherPropertiesTypes()
6765
foreach (var property in InstancedPropertyComponent.GetProperties())
6866
BindComponentToShaderProperty(property.propertyName, property.componentType);
6967
}
70-
71-
/// <summary>
72-
/// Register render, which is combination of Material + set of StructuredBuffer property names in shader.
73-
/// Every entity with <see cref="SpriteRenderID"/> component with ID value equal to passed ID, will be rendered by registered render.
74-
/// Entity without instanced property component from passed properties will be rendered with uninitialized values (please, initialize entities carefully, because render with uninitialized values can lead to strange visual results).
75-
/// Though you can use <b><see cref="NSPRITES_PROPERTY_FALLBACK_ENABLE"/></b> directive to enable fallback values, so any chunk without property component will pass default values.
76-
/// <param name="id">ID of <see cref="SpriteRenderID"/>.<see cref="SpriteRenderID.id"/>. All entities with the same SCD will be updated by registering render archetype. Client should manage uniqueness (or not) of ids by himself.</param>
77-
/// <param name="material"><see cref="Material"/> which will be used to render sprites.</param>
78-
/// <param name="materialPropertyBlock"><see cref="MaterialPropertyBlock"/> you can pass if you want to do some extra overriding by yourself.</param>
79-
/// <param name="propertyDataSet">IDs of StructuredBuffer properties in shader AND <see cref="PropertyUpdateMode"/> for each property.</param>
80-
/// <param name="initialCapacity">compute buffers initial capacity.</param>
81-
/// <param name="capacityStep">compute buffers capacity increase step when the current limit on the number of entities is exceeded.</param>
82-
/// </summary>
83-
public void RegisterRender(in int id, Material material, MaterialPropertyBlock materialPropertyBlock = null, in int initialCapacity = 1, in int capacityStep = 1, params PropertyData[] propertyDataSet)
84-
=> RegisterRender(id, material, Quad, DefaultBounds, materialPropertyBlock, initialCapacity, capacityStep, propertyDataSet);
8568

8669
/// <summary>
8770
/// Register render, which is combination of Material + set of StructuredBuffer property names in shader.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.tonymax.nsprites",
3-
"version": "3.2.0",
3+
"version": "4.0.0",
44
"displayName": "NSprites",
55
"description": "Entities sprite rendering system. Uses GPU instancing with compute buffers to draw entities as sprites.",
66
"unity": "2022.2",

0 commit comments

Comments
 (0)