Add rotation

This commit is contained in:
2026-03-10 17:02:00 +08:00
parent 46d2247bd9
commit 701619ce90
5 changed files with 2406 additions and 663 deletions
+52
View File
@@ -127,6 +127,58 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Float.m_Array.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Vector3f.m_Array.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Float.m_Array.Array.data[0].m_Name
value: ScaleMultiplier
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Float.m_Array.Array.data[1].m_Name
value: OpacityMultiplier
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Float.m_Array.Array.data[0].m_Value
value: 1
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Float.m_Array.Array.data[1].m_Value
value: 1
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Vector3f.m_Array.Array.data[0].m_Name
value: Pivot
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Float.m_Array.Array.data[0].m_Overridden
value: 1
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Float.m_Array.Array.data[1].m_Overridden
value: 1
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Vector3f.m_Array.Array.data[0].m_Value.x
value: 1.85
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Vector3f.m_Array.Array.data[0].m_Value.y
value: -1.19
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Vector3f.m_Array.Array.data[0].m_Value.z
value: -13.3
objectReference: {fileID: 0}
- target: {fileID: -973084862543737302, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_PropertySheet.m_Vector3f.m_Array.Array.data[0].m_Overridden
value: 1
objectReference: {fileID: 0}
- target: {fileID: -774367247743995920, guid: 25c54d8c074f08447ab1c822a6a052fa, type: 3}
propertyPath: m_Enabled
value: 1
+1 -1
View File
@@ -72,7 +72,7 @@ namespace SplatVfx
_cachedBuffers.position.SetData(PositionArray);
_cachedBuffers.scale.SetData(ScaleArray);
// _cachedBuffers.rotation.SetData(RotationArray);
_cachedBuffers.rotation.SetData(RotationArray);
_cachedBuffers.color.SetData(ColorArray);
_cachedBuffers.opacity.SetData(OpacityArray);
// _cachedBuffers.sh.SetData(SHArray);
+33 -15
View File
@@ -12,9 +12,9 @@ namespace SplatVfx
{
public SplatData SplatData = null;
// public string SplatCountProperty
// { get => (string)_splatCountProperty;
// set => _splatCountProperty = value; }
public string SplatCountProperty
{ get => (string)_splatCountProperty;
set => _splatCountProperty = value; }
public string PositionBufferProperty
{
@@ -23,19 +23,31 @@ namespace SplatVfx
}
public string ScaleBufferProperty
{ get => (string)_scaleBufferProperty;
set => _scaleBufferProperty = value; }
{
get => (string)_scaleBufferProperty;
set => _scaleBufferProperty = value;
}
public string ColorBufferProperty
{ get => (string)_colorBufferProperty;
set => _colorBufferProperty = value; }
{
get => (string)_colorBufferProperty;
set => _colorBufferProperty = value;
}
public string OpacityBufferProperty
{ get => (string)_opacityBufferProperty;
set => _opacityBufferProperty = value; }
{
get => (string)_opacityBufferProperty;
set => _opacityBufferProperty = value;
}
// [VFXPropertyBinding("System.UInt32"), SerializeField]
// ExposedProperty _splatCountProperty = "SplatCount";
// public string RotationBufferProperty
// {
// get => (string)_rotationBufferProperty;
// set => _rotationBufferProperty = value;
// }
[VFXPropertyBinding("System.UInt32"), SerializeField]
ExposedProperty _splatCountProperty = "SplatCount";
[VFXPropertyBinding("UnityEngine.GraphicsBuffer"), SerializeField]
ExposedProperty _positionBufferProperty = "PositionBuffer";
@@ -49,20 +61,26 @@ namespace SplatVfx
[VFXPropertyBinding("UnityEngine.GraphicsBuffer"), SerializeField]
ExposedProperty _opacityBufferProperty = "OpacityBuffer";
[VFXPropertyBinding("UnityEngine.GraphicsBuffer"), SerializeField]
ExposedProperty _rotationBufferProperty = "RotationBuffer";
public override bool IsValid(VisualEffect component)
=> SplatData != null &&
// component.HasUInt(_splatCountProperty) &&
component.HasGraphicsBuffer(_positionBufferProperty); // &&
// component.HasGraphicsBuffer(_axisBufferProperty) &&
// component.HasGraphicsBuffer(_colorBufferProperty);
component.HasGraphicsBuffer(_positionBufferProperty) &&
component.HasGraphicsBuffer(_scaleBufferProperty) &&
component.HasGraphicsBuffer(_colorBufferProperty) &&
component.HasGraphicsBuffer(_opacityBufferProperty); // &&
// component.HasGraphicsBuffer(_rotationBufferProperty);
public override void UpdateBinding(VisualEffect component)
{
// component.SetUInt(_splatCountProperty, (uint)SplatData.SplatCount);
component.SetUInt(_splatCountProperty, (uint)SplatData.SplatCount);
component.SetGraphicsBuffer(_positionBufferProperty, SplatData.PositionBuffer);
component.SetGraphicsBuffer(_scaleBufferProperty, SplatData.ScaleBuffer);
component.SetGraphicsBuffer(_colorBufferProperty, SplatData.ColorBuffer);
component.SetGraphicsBuffer(_opacityBufferProperty, SplatData.OpacityBuffer);
component.SetGraphicsBuffer(_rotationBufferProperty, SplatData.RotationBuffer);
}
// public override string ToString()
+26 -1
View File
@@ -222,7 +222,6 @@ namespace SplatVfx.Editor
{
case '0':
splatData.ScaleArray[i].x = val;
Debug.Log(splatData.ScaleArray[i].x);
break;
@@ -237,6 +236,32 @@ namespace SplatVfx.Editor
break;
}
}
else if (property.name.StartsWith("rot"))
{
switch (property.name[4])
{
case '0':
splatData.RotationArray[i].x = val;
break;
case '1':
splatData.RotationArray[i].y = val;
break;
case '2':
splatData.RotationArray[i].z = val;
break;
case '3':
splatData.RotationArray[i].w = val;
break;
}
}
break;
File diff suppressed because it is too large Load Diff