Skip to content

Commit a1c4ddf

Browse files
ludovic-theobaldjulienf-unity
authored andcommitted
Sample Point Cache operator (#92)
1 parent c8e95e0 commit a1c4ddf

File tree

15 files changed

+10896
-72
lines changed

15 files changed

+10896
-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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [10.3.0] - 2020-11-16
88
### Added
99
- Added new setting to output nodes to exclude from TAA
10+
- New Sample Point cache & Sample Attribute map operators
1011

1112
### Fixed
1213
- Forbid incorrect link between incompatible context [Case 1269756](https://issuetracker.unity3d.com/product/unity/issues/guid/1269756/)
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)