Skip to content

Commit 183f537

Browse files
ludovic-theobaldGitHub Enterprise
authored andcommitted
Sample Point Cache Operator (#92)
* Initial commit * Overflow handling options for the user * Addressing mode for overflow to the choice of the user * Foldable to Constant value * Update 09_PointCache.vfx * Added reference images * Remove float-to-integer conversion * Put the choice of the output type in the Inspector only * Simplify output type handling * Sample Point cache != Attribute map => two operators * Update Branch (error .yamato/docs/editor_pinning.png) * Update SamplePointCache.cs * Update 09_PointCache.vfx * Output type set in a cogwheel * Update 09_PointCache.vfx * Revert "Update Branch (error .yamato/docs/editor_pinning.png)" This reverts commit 02f6b6c993c2382bb10669edd16f7d06876a0cbc. * Restore vfx asset * Revert back to using generics for type handling * Update SampleAttributeMap.cs * Reformating + changelog * Update 09_PointCache.vfx * Update SamplePointCache.cs * Refactor of AttributeFromMap using VFXExpressionSampleAttributeMap * Merge branch 'vfx/staging' into vfx/feature/sample-point-cache * Revert "Merge branch 'vfx/staging' into vfx/feature/sample-point-cache" This reverts commit b4a03e182a3e106c2fabc262777615f9c3b94a7e.
1 parent a515f2f commit 183f537

File tree

15 files changed

+10899
-72
lines changed

15 files changed

+10899
-72
lines changed

TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/09_PointCache.vfx

Lines changed: 2441 additions & 31 deletions
Large diffs are not rendered by default.

TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/UnityLogoPrimeCount.pcache

Lines changed: 8108 additions & 0 deletions
Large diffs are not rendered by default.

TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/UnityLogoPrimeCount.pcache.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

com.unity.visualeffectgraph/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88
### Added
99
- Added new setting to output nodes to exclude from TAA
1010
- Changed the "Edit" button so it becomes "New" when no asset is set on a Visual Effect component, in order to save a new visual effect graph asset.
11+
- New Sample Point cache & Sample Attribute map operators
1112

1213
### Fixed
1314
- Forbid incorrect link between incompatible context [Case 1269756](https://issuetracker.unity3d.com/product/unity/issues/guid/1269756/)
@@ -137,6 +138,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
137138
- Compute culling of particle which have their alive attribute set to false in output
138139
- Mesh and lit mesh outputs can now have up to 4 differents meshes that can be set per Particle (Experimental)
139140
- Screen space per particle LOD on mesh and lit mesh outputs (Experimental)
141+
- Compare operator can take int and uint as inputs
142+
143+
140144

141145
### Fixed
142146
- Moved VFX Event Tester Window visibility to Component Play Controls SceneView Window
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Linq;
3+
using System.Runtime.CompilerServices;
4+
using UnityEngine;
5+
using UnityEngine.VFX;
6+
7+
namespace UnityEditor.VFX
8+
{
9+
class VFXExpressionSampleAttributeMap<T> : VFXExpression
10+
{
11+
public VFXExpressionSampleAttributeMap() : this(VFXTexture2DValue.Default, VFXValue<int>.Default, VFXValue<int>.Default)
12+
{
13+
}
14+
15+
public VFXExpressionSampleAttributeMap(VFXExpression texture, VFXExpression x, VFXExpression y )
16+
: base(Flags.InvalidOnCPU, new VFXExpression[3] { texture, x, y })
17+
{ }
18+
19+
sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } }
20+
sealed public override VFXValueType valueType { get { return VFXExpression.GetVFXValueTypeFromType(typeof(T)); } }
21+
22+
public sealed override string GetCodeString(string[] parents)
23+
{
24+
string typeString = VFXExpression.TypeToCode(valueType);
25+
return string.Format("({3}){0}.Load(int3({1}, {2}, 0))", parents[0], parents[1], parents[2], typeString);
26+
}
27+
}
28+
}

com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionSampleAttributeMap.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)