Skip to content

Commit 405f572

Browse files
PaulDemeulenaerejulienf-unityiTris666Thomas Ichépeeweek
authored
[VFX] Direct Link Event & Multiple Per Frame (#4457)
* More changelog fixes * Add missing warning for other block operator using depth (#140) Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/131#discussion_r79026 * *Adding missing meta file in TestProject * Missing doc & Deprecate VFXViewModicationProcessor (#143) * Fix missing doc & Deprecate VFXViewModicationProcessor Unexpected public API * *Revert unexpected change * Fix several issue from @lewisjordan - fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/143#discussion_r79397 - fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/143#discussion_r79398 * Fix Several issue in Property Binder (#106) * Fix case 1274790 : Use DestroyImmediate when editor isn't playing * Fix case 1247230 : Avoid null exposed property Property entry is modified by UX always not null, however, it requires a default value * Fix case 1274788 : Missing null check in Hierarchy to Attribute Map * Fix case 1248711 : Property window view wasn't working Missing Update, it also fixes Undo/Redo * *Update changelog * Fix compilation when ENABLE_LEGACY_INPUT_MANAGER isn't enabled Should be fix for 10.2 * Fix case 1279471 : Avoid OnMouseDown/Up/... declaration Game scripts or other custom code contains OnMouse_ event handlers. Presence of such handlers might impact performance on handheld devices." when building for Android/IOS * Fix positionDepthOperator ref images * Add one pixel to height in non wide mode so that margin is equal to wide mode. (#145) * Update CHANGELOG.md * Fix API validation * Harmonize Composition in Position / Velocity Blocks (#44) * Base refactor + Attempt to get position from AABox (not working for thickness ATM) * Fixed cone syntax issues + correct computation of AABox direction * Added Variant providers + Composition in Sequential * Updated Variants for Shape Sequential Blocks * Harmonized Namings + added composition to Position Depth * Updated Changelog * Fixes for PR * Fixed Blend Composition in Sequential * Added Direction to PositionSequential * Fixes in Position Circle / Set Blend factor in shapes to 1.0 by default * Used Absolute Box size as expression * Propal for https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/44/files/e029bb9ec37555e70af21a97399774667030c031#r61533 Use case by case approach for direction of AABox * *Temp add test data for graphicTest * Fix ApplyAddressingMode : clamp & mirror was overflowing, mirror has also a wrong pattern * Edit graphicTest * Move 014 to common package * Add 014_PositionBlock in editor test listing * Precompute line_direction in PositionLine Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/44/files#r67908 * *Add reference images * Fix editor test (wrong reference data) * Fix issue introduced at 9c54056a68e9ef90354e969e9baba18aa552f8f4 : Looping correctly the circle See also : https://unity.slack.com/archives/G1BTWN88Z/p1598508170069200?thread_ts=1598429838.039200&cid=G1BTWN88Z * Probably uploaded the wrong image reference for standalone * *Update reference images (I think I mess up twice, I should double check the change in motionVector) * Fix build (VFXExpressionCondition now supports uint) * *Temp* Delete motion vector reference image, should regenerate them from yamato. * Readd reference image using yamato result at b9a04b7424323e0c3801e34c13213c4050f020f1 * *Update changelog Fix issue : https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/44#discussion_r70582 * Fix PositionTorus when used in vertex shader * Fix multiple definition of UNITY_PI * Fix changelog bad automatic merge * Fix incorrect volume Base radius while computing volume factor on sphere & circle : use fix approach from https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/89 using name instead of index See : https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/44#issuecomment-28990 & https://docs.google.com/document/d/1RAVkfmMQA9D_hKkJyt6PKOgRs8JHkjlYRhcfBtIU1Ag/edit?disco=AAAAJ7Z4S18 Co-authored-by: Thomas ICHÉ <peeweek@gmail.com> Co-authored-by: Paul Demeulenaere <pauld@unity3d.com> Co-authored-by: Julien Fryer <julienf@unity3d.com> * Fix 1285603 View and Object mode of Shadergraph position node don't return proper values (#141) * Update VFXShaderGraphParticleOutput.cs * Update CHANGELOG.md Co-authored-by: Julien Fryer <julienf@unity3d.com> * Fix collapse exception and added automated test (#149) * Misc fixes for vfx shadergraph integrations (#130) * Diffusion profile has PropertyType.Float but isn't castable in Vector1ShaderProperty : safeprof code * Unity serialization produced a beast with object.ReferenceEquals(null) != 0 and instanceID == 0 foolProof code for this * Update CHANGELOG.md * Small fix for collapse test * Some extra security around error feedback (#153) * Prevent exceptions from making notification stay. Prevent exception in errors to potential break the ui * Prevent list from being badly deserialized. * Fix Event connected directly to Output Event (#152) * Add missing filter in CanLink function * Add editor test * *Update changelog.md * *Update comment * *Update Comment * Misc fixes in strips (#136) * Vfx/feature/strips improvements (#265) * Add spanwIndexInStrip attribute * Fix particleCountInStrip in Init * Add OrientStrip block * Remove some useless code * Add From Target Position mode in Orient Strip * Update changelog * Fix SpawnOverDistance * Fix reference images * Fix changelog * Merge Orient and OrientStrip blocks * Remove FaceCameraPlane from strips * Sanitize quad strip orientation * Update VFX * Update changelog * Add error feedback * Use IsPerspectiveProjection * Fix GetStripTangent for lines * Add subpixel AA to head and trails template system * Add strip variant for intialize in menu * Fix for errors not appearing after convert output * Update graph version * Fix ribbon VFX * Fix spawnIndexInStrip (tooltip + init) * Fix issue with inspector not triggering OnSettingChanged * Check that a converted output could keep the same flow links. Co-authored-by: Tristan Genevet <tristan@unity3d.com> * Revert adaeba7f20802aa19fe089463e1abfaf2a0488e6 * update vfx * Update URP assets * Update URP ref * Vfx/fix/additional subgraphs 2 (#155) * Updated Changelog * Updated Blocks with Fixes and Missing Workflows * update VFX additions Co-authored-by: Thomas Iché <peeweek@gmail.com> * Fix 1255182 Compile errors using Baked GI (default UV settings) / Output Particle Mesh / Connected Attributes (#139) * Reindex the TEXCOORD[n] * Update CHANGELOG.md Co-authored-by: Julien Fryer <julienf@unity3d.com> * Fix serveral minor issues (#103) Fix issue https://github.com/Unity-Technologies/Graphics/pull/1131#discussion_r458987790 Fix issue https://github.com/Unity-Technologies/Graphics/pull/1131#discussion_r458988272 Fix issue https://github.com/Unity-Technologies/Graphics/pull/1131#discussion_r458988870 * Update rebuild all script to take subgraph into account * Update VFX assets * Fix URP vfx assets * Allow Set Spawn Count & Set Spawn Time TODO : List Spawn count in available variant # Conflicts: # com.unity.visualeffectgraph/Editor/Expressions/VFXAttributeExpression.cs * Add comment * Add explicit attribute SpawnCount Remove also some dead code, remove hack since we have now a reachable spawnCount attribute * Fix potential issue : spawnCount supposed to be first in all eventAttribute * Fix incorrect spawner ordering *WIP* * Missing *important* change * Add spawner test to cover behavior of CollectSpawnersHierarchy * *Commit temp data, I wil remove them before starting the PR I would like to test/check the sanitize manually * Move Get Spawn Count to deprecated * *Move old attribute to "deprecated" folder * Sanitize GetSpawnCount using VFXAttributeParameter & VFXInlineOperator * Remove test data * Add set spawn test * Fix unexpected exception since globalAttribute can be empty if there isn't any spawner linked * Minor : update comment * *Update changelog * Minor update in changelog.md * Remove unexpected expcept with leads to incorrect depth count * *Update expected reference image changes * Remove TODOPAUL * Fix Event connected directly to Output Event (revival) (#154) * Add missing filter in CanLink function * Add editor test * *Update changelog.md * *Update comment * *Update Comment * Fix regression with subgraph * Add Subgraph_Event_Link_To_Spawn editor test * spawnCount & spawnTime can be stored per attribute Use specific exception for set spawn event attribute. * Fix changelog Add entry in the right place from 0009e5373ddd6927977fc8054e2ab16c14b5e81b * Restore disabled 26_NonUnifomScale due to a wrong merge (need backport to 10.x.x) * [HDRP] Fix debug view material (albedo/normal/...) (#163) * Fix debug view material TODO : Add GraphicTest * Fix tab/space mix * Add HDRP debug scene * *Add reference image for HDRD_Debug(Property) * *Update changelog.md * Force ui update when shader might be reimported in StaticMeshOutput (#158) * Don't create VFXGraph during import callbacks (#148) * do not Create VFXGraph in import callbacks * error when graph missing. Better test code for asset creation * Add the necessary openasset callback for the system to know if we open the asset inside the editor. (#118) * Added OnOpenAssetAttributeMode.Validate * added UNITY_2021_1 * remove the shaders has they are not edited in the editor. * Fix macro * Select node on create (#166) * Select node on create * Fix for right click in block and add doesn't deselect clicked block * fix for subgraph not being selected on drag and drop * Select converted node/block after convert subgraph * Fix for selection undo separate in some cases. Fixed flow anchor drag context selection. * Fix for undo of add subgraph operator * “Refactor” * "Refactor" bis (some file has been missed) * Dont flag dirty in vfxgraph is the model modified is a copy (#165) * *Apply formatting on branch * Workflow improvement : Change VisualEffect inspector "Edit" button to "New" when no asset is set. (#173) * Base Commit * Documentation * Updated Changelog * Fixed Typo Co-authored-by: Thomas ICHÉ <peeweek@gmail.com> * Added excludeFromTAA setting to VFX outputs (#170) * Added excludeFromTAA setting to VFX outputs Added excludeFromTAA setting to VFX outputs. Currently it is only supported in HDRP suboutputs. Required adding ${VFXStencilForward} variable to forward pass templates * Update VFXHDRPSubOutput.cs suport exclude from TAA in transparent only * Added documentation to exclude from TAA property * Graphic test Added graphic test: 32_ExcludeFromTAA * Update graphic test background for better contrast * Update CHANGELOG.md Co-authored-by: Lewis Jordan <lewisjordan@unity3d.com> * Missing Reference image for test 32_ExcludeFromTAA * Add test to cover case exposed by 1258022 (#54) * Fix Custom Spawn serialization (#132) * Allow Set Spawn Count & Set Spawn Time TODO : List Spawn count in available variant * Fix reference lost in m_SerializableType No idea of implication of this :-/ * Squashed commit of the following: (retrieve fix from @tristan) commit c24981d7dad15100eb40a92a6a9370e9ba800acd Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Oct 9 17:27:57 2020 +0200 Update message from @vlad suggestion Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/131#issuecomment-30757 commit a87ba182b30da7683e31a29048c9f2f3a0312927 Merge: 13b501e15863 296ffd333bcf Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Oct 9 09:25:02 2020 +0200 Merge branch 'vfx/staging' into vfx/fix/error-at-creation # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md commit 13b501e158634dfc98b96058723d248cd5d1f34d Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Oct 9 09:24:27 2020 +0200 *Add warning for CollisionDepthBuffer Update & Fix Changelog.md commit 4bfb1e7c9874d8a9403ca5267d1e10735e52a87b Author: Tristan Genevet <tristan@unity3d.com> Date: Thu Oct 8 18:10:42 2020 +0200 Fix for displaying error from the creation of a node. * Add error feedback on failing custom spawner reference * Revert "Allow Set Spawn Count & Set Spawn Time" This reverts commit 0a6c75cc54072b831dcc56bffc3bbe04734d3324. # Conflicts: # com.unity.visualeffectgraph/Editor/Expressions/VFXAttributeExpression.cs * Remove unexpected change * *Revert change in changelog * *WIP* add ResolveCustomCallbackInstance Some refactor mark as "TODOPAUL" * Clean implementation : customBehavior & comment * *Add test to cover sanitize before modify references * Change namespace for builtin custom spawner & sanitize * Extend test to verify connexion * *Update changelog.md * Add specific error if customBehavior returns null * Fix corner case when ScriptableObject reference has been lost * Work but not idea with copy/past + potential leak * Better implementation : use directly "MonoScript" * Fix spawnerTest * Rename "Can't found" => "Can't find" * Fix case 1294180 : Error feedback throwing an error while changing capacity (#174) Issue introduced with https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/136 And more precisely https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/136/commits/27c041da92ec89407ae775fe4c4f24681f156cb8 * [Test] Add test to cover "Thread Group Size" error (#104) * Add test * Add test to cover behavior from case 1271839 * Fix Preset (with exclusion) (#177) * Trick ExcludeFromPreset Since this attribute is declared with "Inherited = false", we can't use it directly on VFXObject. Extend the VFXInfo is valid to filter out preset. * Fix missing ExcludeFromPreset for subgraph * *Update changelog * Fix 1276602 incorrect uchar pcache import (#129) * Base Commit * Updated Documentation with explicit limitations. * Fixed incorrect Merge * Add regression Test * Removed Test as It can't handle Exceptions thrown in Custom Importers * Fixed value divider Co-authored-by: Thomas ICHÉ <peeweek@gmail.com> * Update gradient test (#151) * Update gradient test * Update CHANGELOG.md Co-authored-by: Julien Fryer <julienf@unity3d.com> * 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. * Fix point cache vfx + update HDRP vfx * Update URP assets * Fix changelog * Fix Case 1223747 - NaN caused by normal bending (#181) * Update Pass.template * Update CHANGELOG.md * 1293608 - Fix LPPV not working in deferred (#180) * Enable LPPV in HDRP test project * Fix LPPV for gbuffer pass * Add graphics test * Update changelog * Fix 1290493 - Spaceship specific warnings (#176) * Avoid implicit trucation in template + safe normalize setting * Update CHANGELOG.md * Added variants * Delete conditioning on GPU evaluation + conservative safe normalize Co-authored-by: Julien Fryer <julienf@unity3d.com> * Fix incorrect compilation condition for linux build (#184) * Fix formatting * Update 26_NonUniformScale kind of sky : gradient instead of procedural * Fix regression from https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/176 Issue introduced at 44f497b438b46a54072721d335910bfab3e392ef : Incorrect VFXExpressionCondition See also : https://unity.slack.com/archives/G1BTWN88Z/p1607963794139900?thread_ts=1607955907.136600&cid=G1BTWN88Z * Disable Gradient Sky in 26_NonUniformScale & 33_LightProbe * *Update VFX (newly introduced safeNormalize, default 0) * Add VFXGraphicTest settings to disable XR for 32_ExcludeFromTAA * Revert "Add VFXGraphicTest settings to disable XR for 32_ExcludeFromTAA" This reverts commit ddee2e356dc7e529cad2904836fef8a688e546a8. * 32_ExcludeFromTAA : Disable XR * 33_LightProbe : Slighlty increase treshold from 0.0005 to 0.0006 * *Update Image Reference for D312 (mainly missing file) * *Disable 32_ExcludeFromTAA Instability detected. * *Add missing D3D12 image references * Fix GPUEvent & SubGraph (#178) * Fix SelectionHasCompleteSystems Detect correctly if there are dependencies due to GPUEvent (or stripAttribute) * Add allDependenciesIncludingNotCompilable in VFXData This helper is usefull for UI + use it in SelectionHasCompleteSystems * Add note without change the beahvior * Remove debug ToArray() * [Subgraph] Prevent Pasting Context invalid subgraph (#191) * Prevent pasting context within operator/block subgraph * Fix case https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/191#discussion_r102007 Fix Approximate english log warning * Update VFXPaste log message Missing "the" * Fix Mouse Event Binder in player (#175) * Fix missing call to CreateVFXEventAttribute OnValidate is only called in editor, in runtime, we should init cache data with OnEnable * *Update changelog.md * Remove the direct link to initialize constraint * Add initSystems collection from event link * Add editor test to cover Safe Normalize behavior (#189) * Draft of specific code to handle dynamic source spawn event * - Change default SpawnCount value to 1.0f (it will be more consistent & ease debug) * Fix incorrect systemIndex computation * Vfx/docs/bugfixes (#188) * Resolved 1272101 * Resolved 1264943 * Removed uncertainty around 'should' * Resolved 1298031 * Added snippets file * Resolved 1292127 * Fixed typos * Resolved 1295296 Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk> * Fix incorrect indexOfData (sill *wip*) * *Commit test data (to remove) * Texture2D Array Layout for Flipbooks (#97) * Initial commit, working for planar primitives only * Increased support to Cube, Decals, Meshes, Lit Planar Primitives, Lit Meshes * Correct handling of depth pass * Added Reference images for test * Added graphic test / restore defaut HD Material This reverts commit 1d8c36af255f41e515cbe3c87ea691125cd43077. * Update Test References * Added Tooltips, simplify input type selection * Fix handling of Lit Mesh output * Automatic Flipbook size for Array Layout * Delete the flipBookSize slot when Texture2DArray is set * More explicative Tooltip + end of flipbook blend fixed * Update CHANGELOG.md * Distortion Quad and Mesh output support * Update VFXAbstractParticleHDRPLitOutput.cs * Retrieve changelog from staging * Added entry * Motion Vector generation improvements (#194) * Added VFX_FEATURE_MOTION_VECTORS_VERTS mode to store motion vector info per vertex Optimized default motion vectors mode to store 4x3 matrix instead of 4x4. Added mode to store each previous vertex position for quads, triangles, lines and points. Refactor of motion vector defines. * Motion vectors support in lines and points * Resize buffer according to the element size * fix points and lines when not using the optimization * Fix motion vectors for lines * Changes suggested in review - Removed misplaced comment in VFXLineStripOutput - Access VFXLineOutput useTargetOffset through GetSettingValue in VFXOutputUpdate - Moved previous frame position calculation to the end of OutputUpdate compute - Added 4 bytes per particle for last frame index in elementToVFXBufferMotionVector buffer - Added noperspective when using VFX_FEATURE_MOTION_VECTORS_VERTS, through VFX_FEATURE_MOTION_VECTORS_INTERPOLATION define. - Fixed order of verts in lineSW particles. * Missing define rename in ParticleMeshes/PassForward.template * Improved condition for discarding due to not enough indirect buffers * Missing renaming of WRITE_MOTION_VECTOR_IN_FORWARD for particle lit meshes * Spawn State documentation (#195) * Added Spawn State doc * Fixed formatting Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk> * Added what's new page and moved blocks out one level in the table of contents (#199) * Added what's new documentation for version 10 * Updated image and minor rewording * Added link from what's new to node library * Updated changelog link Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk> * HDRP - Fix Debug View Material (#182) * Fix fallback (?) depth state in debug view material Not sure about this : should double check with HDRP team * *Update changelog * *Updare reference image It corresponds to the result in 7.x.x & 8.x.x * *Apply reformat * *Apply reformat (bis) * Fix CameraFade for shadows (#179) * Fix CameraFade for shadows +CameraFade was taking the distance to the light when rendering the shadow map. +Added setting to optionally affect shadow, with warning for multiple cameras +Implemented functions to get camera position and direction * Update CHANGELOG.md * Update CameraFade.cs -Change fade default value to false. -Fix behaviour when affect shadows is false * Update documentation Added Affect shadows setting * Update documentation Modified AffectShadows setting description following @lewisjordan suggestions * Move camera functions to VFXCommonOutput * Remove ${VFXFragmentCommonFunctions} ${VFXFragmentCommonFunctions} was used only for the VFXCommonOutput.hlsl include, which is now generated by VFXCodeGenerator as part of ${VFXPerPassInclude} * Correct Sign operator node output for float when input is 0.0f (#190) * Changed specialization for floats to be consistent with others. * Update CHANGELOG.md * Update test * changed sky, emission scale, and updated references (#203) * Fix ProcessOperatorSign test Related to this PR : https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/190 & this change 1d6e19db547ca6a79f75c839825e15943fde6288 * Allow remaking an existing link. (#146) * Allow remaking an existing link. * Update CHANGELOG.md Co-authored-by: Paul Demeulenaere <pauld@unity3d.com> * ShaderGraph loosing reference while updating (sync with 7.x.x) (#185) * Use explicit GetOrRefreshShaderGraphObject & always lazy init the shadeGraph access. # Conflicts: # com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs # com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXMeshOutput.cs # com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs # com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphParticleOutput.cs # com.unity.visualeffectgraph/Editor/ShaderGraph/VFXShaderGraphPostProcessor.cs * Fix shaderGraph not listed in VFXModel This is actually an issue in VFXModel.GetSettings, we don't have any cases like this where the parent value is private. * Update changelog.md Same entry than https://github.com/Unity-Technologies/Graphics/pull/2873/ * Removing changelog entry The actual fix was already there, this code is only a synchronisation with 7.x.x & prior version. * *Minimal test to check actual content of modified property after an override (#171) * Add test to cover behavior from https://fogbugz.unity3d.com/f/cases/1122404/ (#196) * *Updating reference image for D3D12 Related to this PR : https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/182 * *Extend test * More consistent behavior : always list spawnCount first (before any other attributes) * More consistent behavior : always list spawnCount first (before any other attributes) * Fix source of attribute : event should also be considered * Force re-apply formatting * Fix ordering for "+" button in blackboard (#197) * Add test to cover behavior of https://fogbugz.unity3d.com/f/cases/1300115/ (#192) * Fix changelog.md (new entries should be in 12.0.) * *Update changelog.md (unexpected diff in 11.x.x) * [Fix Case 1221557] Checkbox Age Particles consistency (#202) * Provides consistent behavior with Add Age and Set Age * Update Changelog * update changelog * Add _CameraViewMatrix shader variable (#208) Add _CameraViewMatrix shader variable in HDRP, instead of using legacy unity_CameraToWorld. Remove functions using unity_CameraToWorld from VFXCommonOutput.hlsl and move to SRP specific VFXCommon.hlsl files * Fix compute culling compilation in URP (case 1309174) (#210) * Add GeometricTools.hlsl include Missing include containing DistanceFromPlane function used by IsSphereOutsideFrustum * Update changelog * *Proper test (ready to be shared with HDRP project) * *Reduce m_SourceCount to minimal value * HotFix for source code generator * Remove the 0 size buffer constraint for sourceAttributeBuffer of initialize * [pCache] Fix minor UX issues (#207) * Disable mesh statistic field * Fix cancel while save texture * Fix create pCache from unreadable texture * *Update changelog.md * Fix missing disable for Texture Statistics * Disable motion vector per vertex optimization (#214) Temporarily disable motion vector per vertex optimization. Small refactor for vertex count calculation * Fallback for camera buffers from Main camera (#200) * Add setting for main camera buffer fallback * Move enum to C++ * Update changelog * Rename setting to Main Camera fallback and the option "None" to "No fallback" * Added an entry for Main Camera feedback in the preferences doc. * Updated tooltip * Reworded tooltip and doc entry * Added doc entry for User Systems. Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk> * [VCS] Handle correctly locked asset (#193) * Prelimary refactor : gather IsAssetEditable in common test to ease testing * Move always m_LockedElement in front * Fix inspector of slot container when asset is locked * Fix inspector for VFXManager when asset is locked * *Update changelog.md * Fix incorrect cast in VFXSlotContainerEditor * Use m_LockedElement in blackboard & redirect it when needed Simplify integration from m_ComponentBoard * Fix case 1243947 : Debug View artefact Correctly clear the VFXDebugView while reassigning * *Update changelog.md * Let selection passing through locked label : it allows inspection * Fix locked label in blackboard when empty * Fix "Shader Value is not saved when switching between VFX Manager and Version Control" * Prevent Drag&Drop when asset is locked * Prevent tricky way to instantiate BuildContextualMenu There was an issue while clicking on left & right at the same time * Fix two issue with target - Attach a stopped visualEffect component - Stop & Reset behavior * Fix UpdateDebugMode which could be called too soon In the case of an not yet loaded VisualEffect component (because the VFXGraph has been just recompiled) * Fix ordering We want the "asset locked" just after contentViewContainer and not just before m_ComponentBoard * Update maxAlive state checking the actual IsAssetEditable during update * Fix locked issue with the VFXParameterEditor Should disable everything if IsAssetEditable returns false * Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/193#discussion_r109552 blackboard => componentBoard * Mesh Index & Skinned (#30) * Squashed commit of the following: commit f51b7d616b77487339b2ec3db1e2e8bee35b3ae1 Merge: 2589034c08 229945b992 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Apr 6 17:32:10 2020 +0200 Merge branch 'vfx/feature/mesh-sampling-support-texcoord-dimension' into vfx/feature/mesh-sampling-index-buffer commit 229945b99247402006916c9c73a640d2b5662486 Merge: d26b342644 4cd4cb244d Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Apr 6 17:31:23 2020 +0200 Merge branch 'vfx/feature/mesh-sampling' into vfx/feature/mesh-sampling-support-texcoord-dimension commit 4cd4cb244d720c87580c3386a75209532f2b8629 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Apr 2 18:13:24 2020 +0200 Minor change to ease graphViz output view commit a6f9f78ecff57045899508f8a7bb03c9cc731c29 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Apr 2 18:11:09 2020 +0200 Fix VFXObjectValue initial flag (cc @tristan) : Store ContentType & return it in VFXObjectValue directly (VFXObjectValue become an extension of VFXValue) Fix regression introduced by my change at 7abaf9bbf27c587033ad621301778b15748793e4 (due to missing in PropagateParentsFlags) Add OuputExpression_From_Slot_Mesh_Should_Be_Invalid_Constant & OuputExpression_From_Slot_Mesh_Should_Be_Invalid_Constant_Propagation to ease the check of expected behavior commit 7c11de30553cbc378926e3a1d6775f361921ad7a Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Apr 2 14:54:57 2020 +0200 *Update 007 SampleMesh to cover more cases commit 2589034c088795ba63bf61f22e8ba84a7ffe7607 Merge: 47e04162e6 a9338688a6 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 31 18:24:43 2020 +0200 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling-index-buffer commit 47e04162e60683e331c930a02e77f6d5eeae568e Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 31 18:18:43 2020 +0200 Minor : add a TODO commit a7bd11748549e25789e7515c50b1c3d96499301b Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 31 18:17:32 2020 +0200 Actually, keep minimal scope for VFX_GENERIC_BUFFER, it's useful for platform testing purpose. commit 0baa1401f6fad276323d6369eb4330ef717c978f Merge: 40749ce2ba a9338688a6 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 31 18:04:49 2020 +0200 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling commit 0f9fc14afb9e6e8666b39860bd84922eba4a64e5 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 31 16:49:52 2020 +0200 Remove temporary code commit bc8121349789de632d1115a7804a17b882559e1b Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 31 16:02:23 2020 +0200 Choose StructuredBuffer<float> over ByteAddressBuffer commit 21b9d002b29b9887da8661f32505973e75d0420f Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 30 17:16:37 2020 +0200 Change Buffer<uint> to Buffer<float> to avoid dx warning issue. commit be691cd625a18194c5662de17c952613b4f591e3 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Sun Mar 29 19:06:25 2020 +0200 Fix alignement for ByteAddressBuffer commit 3ec05dfadefc483507d3de12caf4a2e216af6e66 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Sun Mar 29 17:58:05 2020 +0200 WIP : Trying to move to ByteAddressBuffer commit 2cf1db8679851ff55afcd5f17afa8a52b4d9e179 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Sat Mar 28 18:06:49 2020 +0100 add note for later commit e6fd7c1931919c657b7c65f8197be03e387e56dc Author: Paul Demeulenaere <pauld@unity3d.com> Date: Sat Mar 28 17:44:24 2020 +0100 *Draft test data (will be removed) commit c84f0e927ebe00f655d3fb92bbe98d6c03fdcf34 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Sat Mar 28 17:16:12 2020 +0100 Fix expressionMesh format commit 6f48ffbdb55f38da5750f63fc1a38d79a5d19800 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Sat Mar 28 15:01:01 2020 +0100 Update draft test commit edec8e1e997188e0dbc82ad9bb38e0ac178476d2 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Sat Mar 28 15:00:41 2020 +0100 Sample Index *WIP* commit 2853d8b25eabd0dcf3f5af4718d71f17685d5a7b Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 27 15:54:29 2020 +0100 *Remove End expression for mesh evaluation (invalid because we can't guess context for this case) commit d4f09e0cc4c058d07a2c40366e4e0bd45476d7fb Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 27 12:00:30 2020 +0100 Add minimal integration for newly added VFXExpressionVertexBufferFromMesh commit baf39dcdf6fc340269fb5442c763e4932ead57f2 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 27 11:59:25 2020 +0100 Add test data (to revert) commit 7a2fd0337ecc965dcea105dfd34973499f736bb8 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 27 11:58:53 2020 +0100 Revert "Add test file & minimal integration testing newly added VFXExpressionVertexBufferFromMesh" This reverts commit 6d507a684f14dc09641877d6d691fd96adb63be4. commit 6d507a684f14dc09641877d6d691fd96adb63be4 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 27 11:56:51 2020 +0100 Add test file & minimal integration testing newly added VFXExpressionVertexBufferFromMesh commit d26b342644bc08c2ab4118a71899bb78a2c303a7 Merge: b1512335cb 40749ce2ba Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 27 09:27:26 2020 +0100 Merge branch 'vfx/feature/mesh-sampling' into vfx/feature/mesh-sampling-support-texcoord-dimension commit 40749ce2ba015f004c6e161d75c4063edefd0f3a Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Mar 26 21:50:40 2020 +0100 *Reupdate Image (HDRP, there was an issue with shaderGraph) commit fa7ecbf9656db5316a60aadd450414b4d790e9ff Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Mar 26 21:46:02 2020 +0100 *Update reference Image & .vfx (always in HDRP project) commit b1512335cb09b7b3e1ee783f991347704c4952be Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Mar 26 18:24:05 2020 +0100 Fix after merge commit 43e25995ca9a15aa0ee5c88297616ccbd3fc5c2d Merge: e357f4871b 7abaf9bbf2 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Mar 26 17:47:34 2020 +0100 Merge branch 'vfx/feature/mesh-sampling' into vfx/feature/mesh-sampling-support-texcoord-dimension # Conflicts: # com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionMesh.cs commit 7abaf9bbf27c587033ad621301778b15748793e4 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Mar 26 15:13:20 2020 +0100 Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r44714 : set InvalidConstant directly on VFXValueType of Mesh commit c5a7a3ed477af8732da0095091c080692c9c64b2 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Mar 26 14:52:07 2020 +0100 Add graphic test to cover constant folding (TODO : Update all images) commit 27e3c7464d60659905f13f172c79a79a94b7ac56 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Mar 26 13:37:38 2020 +0100 Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r44714 commit e357f4871b8c39257c62daf1fe63f85241325712 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Wed Mar 25 08:56:53 2020 +0100 Fix build in 2020.1 to resolve comment https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/258#pullrequestreview-52608 commit bfc0d9f7aeaa8b34407bfa8279d30bf59cf55099 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 24 18:44:28 2020 +0100 *Fix compilation commit 6cfd2d90292796c5b21e63d01c4b4bf8563c0184 Merge: 41a1a8e212 128101bc63 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 24 14:56:22 2020 +0100 Merge branch 'vfx/feature/mesh-sampling' into vfx/feature/mesh-sampling-support-texcoord-dimension commit 128101bc638d98d9628dc90be078450e1f706534 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 24 12:39:39 2020 +0100 Minor : forgot a punctation commit 8c395cd600dfd8301cf6c83d1354ba457e49e889 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 24 11:01:30 2020 +0100 *Update documentation from @lewis feedback https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#issuecomment-18488 commit 41a1a8e212c82b48832ab88f68348c145c0960c6 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 23 15:19:24 2020 +0100 *Update expression name commit 27794064fd01207a35e7d967ff322e9d552a2054 Merge: ad597a0388 28f0ca20a0 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 23 10:21:38 2020 +0100 Merge branch 'vfx/feature/mesh-sampling' into vfx/feature/mesh-sampling-support-texcoord-dimension commit 28f0ca20a0c422c5a5f1e64e1401271f63762ade Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 23 09:33:39 2020 +0100 Fix documentation image link (bis) commit 1b102c1c1ef3d3da69c9aa4332737e3f935959fa Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 23 09:24:13 2020 +0100 *Fix path in documentation commit 662d086481c228491536d1463dfe61198048a263 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 23 09:06:12 2020 +0100 Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r43790 commit 241ca5edf7451345ecce30da9310b19e24ee37d5 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 23 08:21:56 2020 +0100 *Update documentation commit d89f307aca40f88bdda2dc0e9a0324556e296400 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 20 17:50:44 2020 +0100 *Update documentation commit 9f79d5a48e22881011ccf978217b21ce44ed9a37 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 20 15:59:56 2020 +0100 first draft of documentation commit f84300e560bfd3698e27da58a4e93236209ac513 Merge: 9c5bd4e887 c04b64c1b3 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Mar 20 13:22:28 2020 +0100 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling commit ad597a03881e11743e68555f985c304ee2d7557d Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 17 11:18:40 2020 +0100 Support float or uint read in sample mesh color commit 8ca98dd9a375431ddc04c7a0cb625c35a2c99f57 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 17 10:05:40 2020 +0100 Add compatibility code & use new available expression from https://ono.unity3d.com/unity/unity/changeset/6afd1f99b768984023366f3aba746390c763432f commit 9c5bd4e88764d91371d0551fdf3fe64654c2e63f Merge: f8284406c8 ec959d5de3 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 16 10:13:09 2020 +0100 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling commit f8284406c8a99ceb442c13e20049ca14efd3cd7d Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Mar 16 10:12:08 2020 +0100 Fix issue : https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r43071 & https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r43068 & https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r43067 & https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#pullrequestreview-50944 Split Texture & Buffer commit 39328fb09e1d470727becea05842cd48ceb7c5e2 Author: Tristan Genevet <tristan@unity3d.com> Date: Wed Mar 11 11:42:23 2020 +0100 Fix delegate set that must not be postponed commit 9ddac63551eea34f630ddea0380035728b97bf3a Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 10 17:48:44 2020 +0100 Add sample test for case 1226578 (TODO : fix HDRP 007_SimpleMaterial) commit e04224320d5404e44c969e49470eec827622916f Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 10 15:30:46 2020 +0100 Fix after merge commit fb7dbd291fc063640295b35a24caf87ddccef1f9 Merge: 302ae40d59 5bdcd30bd9 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Mar 10 15:15:42 2020 +0100 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling commit 302ae40d59ec0c3dd214405392853de8097373ca Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 25 10:48:54 2020 +0100 Fix build & behavior commit 61ce50e6dd9e08987bb7273f678e064edc01d110 Merge: 70c93148d4 5d2dfe278f Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 25 10:18:17 2020 +0100 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling # Conflicts: # com.unity.visualeffectgraph/Editor/Compiler/VFXShaderWriter.cs commit 70c93148d49f776dc68a47c28053258f8a713f54 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Wed Feb 12 09:04:23 2020 +0100 Relate to issue https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r36772 Add adressing mode in Position (Mesh) too & Update Tooltips commit e5d35ed0d6b6398c7d25d02166a32ca7d2afec65 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 17:18:28 2020 +0100 *Update reference image for HDRP (clear color isn't exactly the same) commit 65883b0f521cd1e1438890084593081400d594a2 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 16:09:18 2020 +0100 Fix Color Sampling test commit 3e7ab2cddca5556855280709d18395df1229be57 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 15:54:25 2020 +0100 *Update Mesh Sampling vfx commit b46ffc745a55347e4d310e617afd1a40f2c2a804 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 15:47:06 2020 +0100 Resolve issue https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#issuecomment-15567 commit 03dff8383f4cc7acb383a630f0745871db2b7303 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 15:31:48 2020 +0100 Resolve issue : https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#issuecomment-15555 Remove output count from the SampleMesh for consistency commit 0d6620339efc53b56906226e78b005ab06a0ab53 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 15:26:24 2020 +0100 *Update test using vertex mesh sampling commit 33433a4ccacc91c5861957b4f1d414d91eb1abb5 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 15:17:00 2020 +0100 *Use flag in inspector as @julienf suggested commit f6d9f3ab494b50dcd15ad7104ff0ea40f398cee9 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 11:22:36 2020 +0100 Resolve issue : https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r36772 Add adressingMode in Custom Sampling commit 00444271a0c3c1efda6373f16432cad3659d8238 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 10:29:07 2020 +0100 Resolve issue : https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r36771 & https://github.cds.internal.unity3d.com/unity/vfx-graph/pull/197#discussion_r36770 commit d4422c88b66f0cf67c561086798b176db69b3d1a Merge: a7052746e1 0e325d7de5 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 09:05:59 2020 +0100 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md commit a7052746e10326979c3e4c4d69ddc4004bcad83b Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Feb 11 09:04:44 2020 +0100 Unexpected change in upm-ci-vfxmain.yml commit 3fa67e367aeda4f85025886d53729111a0d841e6 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Dec 23 10:34:57 2019 +0100 Update upm-ci-vfxmain.yml commit 8abf8e07dbe96fb4f02ab0733e3f22fa30622a7d Merge: 442c3cd4e0 1758e4de4b Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Dec 23 10:34:28 2019 +0100 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling commit 442c3cd4e0264a0ef2942ebbe4c1476da370d848 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Dec 9 08:59:41 2019 +0100 Fix experimental & add mesh vertex count output as suggested by @vlad commit 7e306fe26a8839a9d72f4625a61e91814b4105ce Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Nov 28 13:13:04 2019 +0100 Update upm-ci-vfxmain.yml commit 31604a66ff6f0b2031681bf26ac7f59d047d493d Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Nov 28 13:12:46 2019 +0100 Revert upm-ci-vfxmain.yml commit 9f8cdafdbc98f084453894897b54858a67e75483 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Nov 28 13:11:49 2019 +0100 Revert upm-ci-vfx_lwrp.yml commit e95e7659b7f0a5a6cf1fc15ee8aef9a207038573 Merge: 858f1a94ed 5b678082c5 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 26 16:55:52 2019 +0100 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling commit 858f1a94edfc88756a43b41d4652624939a6ab57 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 26 16:49:20 2019 +0100 Restrict constant folding on mesh operation commit 1b5216571e1a8b6d21787f10f33c4a819729c0ba Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 26 16:04:40 2019 +0100 *Update ChangeLog.md commit 651ce34b5baa57c43b2aff6b10f602f4643ec13a Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 26 14:21:01 2019 +0100 Clean useless code commit 8e2e438886de3db5b8ba6c2613102a38947461aa Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 26 13:45:51 2019 +0100 Use name expression to compute vertex index commit 8349f56e96668f3656113850048e427859602583 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 26 09:03:17 2019 +0100 Rename "texture_" to "mesh_" when expression is actually a mesh Remove useless sampler for mesh commit 51f1e01943e4d221a7323363c39656b861a94fe7 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 26 08:39:31 2019 +0100 Update Canvas to include test in graphicTest commit fff4b79856a215bc1d13cb08752f88e40549ddbb Merge: ca39c0d6ec efba8dad57 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 26 07:49:14 2019 +0100 Merge branch 'refs/heads/vfx/staging' into vfx/feature/mesh-sampling # Conflicts: # TestProjects/VisualEffectGraph/ProjectSettings/EditorBuildSettings.asset # TestProjects/VisualEffectGraph_LWRP/ProjectSettings/EditorBuildSettings.asset commit ca39c0d6ece391081f786e10e96aa6007af6b18e Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 19 11:22:36 2019 +0100 Remove shape test commit 2aedcdd8bcee3342fc2a43be759f7c31d77628d4 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Nov 18 15:02:58 2019 +0100 Temporary : change yamato target to graphics/vfx/fix/mesh-sampling commit aea552d59b018fbf7c217b37d8846e02bfefb349 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Nov 18 14:59:04 2019 +0100 *Update player reference images commit b0ab2685f7bdbd0b859a010422e8074bc95bfbc3 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Nov 18 14:36:49 2019 +0100 Fix PositionMesh commit 05aec35f9a430497583f5b952fa97ce6784c676d Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Nov 14 17:01:52 2019 +0100 *Update graphicTest commit 052cb87133878404390365f0403b6faa44821133 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Nov 14 15:30:46 2019 +0100 Fix mesh color sampling commit c2db4d2ebe41d1ba0648b439bb167e486fd318ff Author: Paul Demeulenaere <pauld@unity3d.com> Date: Thu Nov 14 11:41:59 2019 +0100 Use explicit VFXExpressionMesh.GetVertexCount which handle in unified way to mesh nullity commit 2ecdcc54480aa17665db6b980a5ba797539931e9 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Wed Nov 13 10:28:19 2019 +0100 Add MeshVertexCount operator commit c5b144214270c741bc61a6bc0994c0c5098ba39a Author: Paul Demeulenaere <pauld@unity3d.com> Date: Wed Nov 13 10:08:14 2019 +0100 Add a true embedded random in SampleMesh commit d4e9dcf5a9abbc6ad79315cc1c60afe79f94af87 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Tue Nov 12 18:35:35 2019 +0100 Fix unexpected cast int to uint commit 0fc7ed15c61435dbe917a56da4c939de35b57f2c Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Nov 8 14:39:06 2019 +0100 Add WIP TODOPAUL commit 6ff729e50e85204a597c0628be601a2b8064cc3e Author: Paul Demeulenaere <pauld@unity3d.com> Date: Fri Nov 8 13:55:20 2019 +0100 Use uint instead of int & remove RandInt commit 22770d8cfef4135a054e0ed7194ee4a45b1497b4 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Nov 4 15:09:22 2019 +0100 *Update Shape.vfx commit 5d17343ddd478986d867e6d0f499cb5bd6c93d52 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Nov 4 15:07:11 2019 +0100 Fix build commit 3a2729fb19b09fda873eff06ebad83b38b84ceb6 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Nov 4 14:46:47 2019 +0100 Report changes from https://github.cds.internal.unity3d.com/unity/vfx-graph/blob/bd366e5cf8dc25b725a4f064ad65577d26d1f51f/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc commit cc0a36b42965c6e04f9b088d363f68ec8b2d41ae Merge: bd366e5cf8 d2bacd6482 Author: Paul Demeulenaere <pauld@unity3d.com> Date: Mon Nov 4 14:43:23 2019 +0100 Merge branch 'vfx/staging' into vfx/feature/mesh-sampling # Conflicts: # TestProjects/VisualEffectGraph/ProjectSettings/EditorBuildSettings.asset # com.unity.visualeffectgraph/Editor/Compiler/VFXCodeGenerator.cs # com.unity.visualeffectgraph/Editor/Compiler/VFXShaderWriter.cs # com.unity.visualeffectgraph/Shaders/VFXCommon.cginc commit bd366e5cf8dc25b725a4f064ad65577d26d1f51f Author: Richard Kettlewell <richardk@unity3d.com> Date: Wed Dec 12 12:53:50 2018 +0000 Fix mesh sampling stride and remove fmod when not needed commit 706aa48a4a98b76f5f2a4d190b4df9250e0896dc Author: Richard Kettlewell <richardk@unity3d.com> Date: Tue Dec 11 16:40:06 2018 +0000 color space fix commit 3df16fe0c60a235e3991249553ccf4167bd7d736 Author: Richard Kettlewell <richardk@unity3d.com> Date: Tue Dec 11 16:03:25 2018 +0000 Shape gfx test commit ceef2e0410503647eb1f997f217e9442fb50b823 Author: Richard Kettlewell <richardk@unity3d.com> Date: Tue Dec 11 12:32:36 2018 +0000 Remove baking prototype and fix channel offsets commit 39d518807d279fd328cc4408d5f85667f60e719b Author: Richard Kettlewell <richardk@unity3d.com> Date: Mon Dec 10 15:26:55 2018 +0000 Mesh sampling * Commit data files as lfs * Sample mesh, add placement mode : Surface & Edge *WIP* * Some experiment with low distorsion mapping * *WIP* debug data (will be removed anyway) * Clean BarycentricCoordinatesBis * Fix to graft : support for flag enum in inspector * Add animation test data from @vlad * Test scene *WIP* * Use GetVertexStride depending of channelIndex & VFXExpressionVertexBufferFromMesh depending of channelFormatAndDimensionAndStream * *WIP* pushing test data * *Push Some test data (will be removed) * Fix test adding a *WIP* note * Minor fixes after merge * Add SkinnedMeshRenderer exposable * Add SkinnedMeshRenderer in IsTypeConstantFoldable * Add VFXExpressionSampleSkinnedMeshRendererFloat & co support (it should be factorizable) * Move hexahredron to common data, it will be convinient for graphicTest * Fix PositionMesh (bad merge) * Implement Graphic Test for skinned mesh (not yet tested in standalone yet) * *Add reference images * Clean some code, remove intermediate compatibility code * Add variant provider for sample mesh * Factorize sampling function to share them with PositionMesh * Start factorization of SamplePositionMesh * Add simple TODOPAUL * Add another TODOPAUL * Change VertexAttributeFlag to VertexAttribute, use proper mesh type in MeshPosition * Implement surface coordinate & sample vertex for position mesh * Remove test data & Update actual graphicTest * Use nameof instead of verbatim (this code will not be backported) * Fix sample edge * Add skinned & mesh index/vertex count * Fix editor test (todo : graft this change to master to anticipate the C++ change) * *Update reference image for mesh sampling * *Add sampleMesh index for skinned & mesh * Fix after merge (wasn't so obvious but now works \o/ Can be factorized) * Simpler update to use now available ByteAddressBuffer # Conflicts: # com.unity.visualeffectgraph/Editor/Compiler/VFXShaderWriter.cs # com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionAbstract.cs # com.unity.visualeffectgraph/Shaders/VFXCommon.hlsl * Revert "Simpler update to use now available ByteAddressBuffer" (onluy VFXCommon.hlsl) This reverts commit 65b5ce1c588b969b95726a83d06a34a386a8c16d. * Fix compilation * Fix wrong return type of FetchBuffer * *Restore lost test for triangle sampling * Proper sample OOB fix * Use explicit branch in SampleMeshReadFloat : we aren't supposed fetch in invalid buffer * Enable GPUSkinng, default mode * Remove float cast for condition since we are able to compare uint * Factorize insertGPUTransformation using the common switch * Clean multiple place where "ByteAddressBuffer" is declared * Simply generated code verifying at http://shader-playground.timjones.io/d7df4e7dbec05529d6943aacca2812b9 * Remove unexpected restored file (as been renamed) * *Update changelog * *Fix build * *Update image reference * Remove useless case in GetFunctionParameterType (ByteAddressBuffer is in TypeToCode anyway) * Fix after merge * First draft of documentation for sample mesh * *Update documentation * *up doc * *documentation * Add documentation for Mesh Index Count & Vertex Count * *documentation * *Remove unexpected change & deprecated code * *documentation * Remove unexpected change in changelog.mp * *Apply formatting * *Update documentation * Minor documentation update * Documentation : add "inspector" flag when relevant * Rename confusing "x" in "edge" See https://docs.google.com/document/d/1VbIc5pMkgFX2Ui4-LWrZ7uQ4EKlXlFxWWW4ufcex70I/edit * *Remove deprecated MeshSampling & Update TOC * Reviewed the Set Position(Mesh) doc * Reviewed mesh index count doc * reviewed the rest of the sample mesh operators. * Fix ToC & rename some "Skinned Mesh Renderer" in "Skinned Mesh" * Missing minor change * *Reupdate VFX after merge * Fix several tooltip issues - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89530 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89531 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89532 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89533 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89534 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89535 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89536 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89538 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89539 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89540 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89541 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89542 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89544 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89545 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89546 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89547 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89548 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89549 - https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r89550 * Forgot to stage files from previous commit d8c1bef513605c8c7b40ec855cfe2be4de2e7d5e * Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r109724 Remove not needed UNITY_2020_2_OR_NEWER condition * Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r109727 Isolate helper function to VFXMeshSampling.hlsl * Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/30#discussion_r109725 - Rename sourceExpression to targetExpression - Add InvalidOperationException if we are detecting an unexpected graph * Add missing compile of channelFormatAndDimensionAndStream - Check branch behavior - Trying to find infinite recursion due to dependent sampling - TODO : Add an editor test to inspect the actual generated graph (already checked in debug) Co-authored-by: Tristan Genevet <tristan@unity3d.com> Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk> * *Update all VisualEffectAsset "flipbookLayout: 0" everywhere + Some missing meta in test project (minor) * *Apply formatting * *Update missing reference images * Other missing update screenshot & missing meta * Fix formatting : this change can be grafted directly on master * Three minor fixes from https://github.com/Unity-Technologies/Graphics/pull/3414 - Wrong Image reference : Fix D3D11 standalone - Unconsistent debug assert (the recreate can be called on subslot) : Fix Space_Slot_Sanitize_Still_Possible_ArcSphere - CreateComponentWithAllBasicTypeExposed : remove VFXValueType.CameraBuffer from list of tested exposed type (it can'td irectly be exposed) These change can independantly land in `master` * Fix incorrect changelog.md in com.unity.visualeffectgraph * Remove unexpected duplicated entry in changelog.md * Fix changelog : unexpected removed entries in 11.x * *Update changelog.md * Fix build * Rename vfx file * [BRP] Fix Shader Compilation (#216) * Fix incorrect direct access to GetWorldToObjectMatrix * *Update changelog.md * Proper virtual in VFXData to handle hasDynamicSourceCount in VFXCodeGenerator without cast * Refactor GenerateComputeSourceIndex * Store system index in VFXContextCompiledData Avoid this "Anticipate what will be index of this particle system, not ideal and arbitrary." * Minor : rename define * Simplify FillEvent implementation using directly EventStructure * *Add mixing test * Update VFXSettings for 016 * Move 016 to common test package * *Update using HDRP * *Add 016_DirectLink to EditorBuildSettings * Sphere and cube outputs as experimental * *Update test to have a clearer and more stable behavior & Add editor reference images * Minor : fix compilation warning Check locally : 016_DirectLink (1.714s) --- The referenced script (Unknown) on this Behaviour is missing! The referenced script on this Behaviour (Game Object 'Main Camera') is missing! * *Missing editor build settings update * Add castShadows as additionalMappings in VFXStaticMeshOutput (#217) * [Orient] 'Look At Position' particle disappearance (#101) * Expensive fix Computes two cross products to avoid the case when one of them is zero. Is it faster than branching to check ? Is this edge case worth the additional cost ? * More explicit approach/similar instruction cost + LookAtLine * Update Orient.cs * Handles edge case when cross(axis1, axis2) = (0,0,0) for all Orient variants * Small mistake in the exception message * Factorize SafeNormalizedCross * Update changelog * Added information about compute shaders and ssbos (#222) * Added information about compute shaders and ssbos * Added recommendation to use Vulkan over OpenGL ES * Removed 'two' * Added entry about vfx graph not being out of preview for mobile platforms Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk> * [Fix] PropertyBinder : Reset & Undo (#212) * Fix missing record object for proper undo/redo & reset * *Update changelog.md * Fix issue https://favro.com/organization/c564ede4ed3337f7b17986b6/1973edb4634ba00a90689144?card=Uni-160638 * Avoid VFXPropertyBinder to be added twice * Fix incorrect reference after copy past * Fix RemoveComponent clearing property binder first * Handle Copy/Past \o/ * Let the LateUpdate without any editor code & use Update (avoid the one frame of latency for inspector) * Remove useless recompute of GetComponents every frame, and use Reload (safer) * Remove dead code * *Add new entry in changelog (side improvement/fix) * *Update comment * [Fix] Null Ref Exception due to IsAssetEditable (#221) * Resource can be null on a block inspector while we are removing it Use safe check of resource before IsAssetEditable * *Update changelog * Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/221#discussion_r113060 * [Fix] Component Board UX issue (#220) * Fix missing call to OnSelectionChanged on first display (before selection changed called) * Fix change from component notifying the VFXView * Fix toggle component board state * Minor fixes * *Update changelog.md * Add custom namespace for test script * Minor code update * Remove reflection about compileInitialVariants : it's available since 19.3 * Remove unexpected entry in changelog.md * *Update (some) reference images * Restore the constraint on OutputEvent & Event It can't work because we aren't generating any data in that case * *Update reference image URP * *Update reference images * *Update changelog.md * Fix build of VFXSpawnerTest.cs * [Fix] System name 'Model is not registered' (#224) * *Add editor test to catch corner case issue with system name * Move Create_Simple_Graph_Then_Remove_Edget_Between_Init_And_Update_TestCaseto VFXGUITest * Actual fix of 1315593 The flow edge change is only triggering kConnectionChanged so, if you are trying to access m_SystemNames before compilation * Remove unexpected change * [Test] Revert after change (#213) * Local test (I'm using git diff to check actual file change) * test adding a lit mesh output * *Testing with shaderGraph * *test bis * *Add unit test to cover unexpected increasing size * Properly implement the test * Remove test data * *Temp lot of log & save it to independant file * HotFix : UpdateSubAsset in OnPreprocessAsset Shouldn't be necessary, the actual problem is maybe in C++ implementation * Clean test & add comment * *WIP* Serialization test which seems (tm) to reproduce the same issue * To revert : experiment adding log while loading VFXSerializableObject *Without Import Asset after write* Saving : 100 Loading : 100 Loading : 100 OnBeforeSerialize : 100 Saving : 101 Loading : 101 Loading : 101 OnAfterDeserialize : 100 Loading : 100 => Test fail ! *With Import Asset after write* Saving : 100 Loading : 100 Loading : 100 OnBeforeSerialize : 100 OnAfterDeserialize : 100 Saving : 101 Loading : 101 Loading : 101 Loading : 101 OnBeforeSerialize : 101 OnAfterDeserialize : 101 Saving : 102 Loading : 102 Loading : 102 Loading : 102 OnBeforeSerialize : 102 OnAfterDeserialize : 102 Saving : 103 Loading : 103 Loading : 103 * *Revert unwanted change * Clean & Unify test behavior * Safety check in newly integrated test (if asset is empty, it isn't expected neither) * Remove OnCompile : Avoid recompile twice, the WriteAsset is already trigerring an import * [Test] Add test to cover CopyValuesFrom (#225) * *Add test to cover CopyValuesFrom issue * *Extend the newly added test Check every value in copied values * Just added a perf marker * Changed `mobile` to `…
1 parent 483bda2 commit 405f572

File tree

67 files changed

+7703
-218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+7703
-218
lines changed

TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/VFXContextTests.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,39 @@ public void Link_Fail_From_Event_To_OutputEvent()
203203
Assert.IsFalse(VFXContext.CanLink(from, to));
204204
}
205205

206+
[Test]
207+
public void MultiLink_Spawn_And_Event_To_Initialize()
208+
{
209+
var from1 = ScriptableObject.CreateInstance<VFXBasicSpawner>();
210+
var from2 = ScriptableObject.CreateInstance<VFXBasicEvent>();
211+
212+
var to = ScriptableObject.CreateInstance<VFXBasicInitialize>();
213+
to.LinkFrom(from1);
214+
to.LinkFrom(from2);
215+
216+
Assert.AreEqual(2, to.inputContexts.Count());
217+
}
218+
219+
[Test]
220+
public void MultiLink_Event_And_Spawn_To_Initialize()
221+
{
222+
var from1 = ScriptableObject.CreateInstance<VFXBasicEvent>();
223+
var from2 = ScriptableObject.CreateInstance<VFXBasicSpawner>();
224+
225+
var to = ScriptableObject.CreateInstance<VFXBasicInitialize>();
226+
to.LinkFrom(from1);
227+
to.LinkFrom(from2);
228+
229+
Assert.AreEqual(2, to.inputContexts.Count());
230+
}
231+
206232
[Test]
207233
public void Link_Fail_From_Event_To_Initialize()
208234
{
209235
//For now, we can't use direct link from event to initialize context.
210236
var from = ScriptableObject.CreateInstance<VFXBasicEvent>();
211237
var to = ScriptableObject.CreateInstance<VFXBasicInitialize>();
212-
Assert.IsFalse(VFXContext.CanLink(from, to));
238+
Assert.IsTrue(VFXContext.CanLink(from, to));
213239
}
214240

215241
[Test]

TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/Editor/Tests/VFXSpawnerTest.cs

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,88 @@ public IEnumerator Create_Asset_And_Component_Spawner_And_Output_Event_Expected_
416416
yield return new ExitPlayMode();
417417
}
418418

419+
[UnityTest]
420+
public IEnumerator Create_Asset_And_Component_Spawner_With_Manual_Set_SpawnCount_And_Output_Event_Check_Expected_Count()
421+
{
422+
yield return new EnterPlayMode();
423+
424+
//This mainly cover return value & expected behavior, event attribute values are covered by a graphic test
425+
var spawnCountValue = 1.0f; //We running these test at 10FPS, half of rate provided by constantRate, the other comes from manaul spawnCount
426+
VisualEffect vfxComponent;
427+
GameObject cameraObj, gameObj;
428+
VFXGraph graph;
429+
CreateAssetAndComponent(spawnCountValue / 2.0f, "OnPlay", out graph, out vfxComponent, out gameObj, out cameraObj);
430+
431+
//Manual constant rate
432+
var spawnState = ScriptableObject.CreateInstance<Operator.SpawnState>();
433+
graph.AddChild(spawnState);
434+
435+
var currentSpawnCount = ScriptableObject.CreateInstance<VFXAttributeParameter>(); //Also available in spawn state
436+
currentSpawnCount.SetSettingValue("location", VFXAttributeLocation.Current);
437+
currentSpawnCount.SetSettingValue("attribute", VFXAttribute.SpawnCount.name);
438+
graph.AddChild(currentSpawnCount);
439+
440+
graph.AddChild(spawnState);
441+
442+
var multiply = ScriptableObject.CreateInstance<Operator.Multiply>();
443+
multiply.SetOperandType(0, typeof(float));
444+
multiply.SetOperandType(1, typeof(float));
445+
graph.AddChild(multiply);
446+
447+
var add = ScriptableObject.CreateInstance<Operator.Add>();
448+
add.SetOperandType(0, typeof(float));
449+
add.SetOperandType(1, typeof(float));
450+
graph.AddChild(add);
451+
452+
var setSpawnCount = ScriptableObject.CreateInstance<Block.VFXSpawnerSetAttribute>();
453+
setSpawnCount.SetSettingValue("attribute", VFXAttribute.SpawnCount.name);
454+
graph.children.OfType<VFXBasicSpawner>().First().AddChild(setSpawnCount);
455+
456+
Assert.IsTrue(spawnState.outputSlots.First(o => o.name == "SpawnDeltaTime").Link(multiply.inputSlots[0]));
457+
multiply.inputSlots[1].value = spawnCountValue / 2.0f;
458+
459+
Assert.IsTrue(multiply.outputSlots[0].Link(add.inputSlots[0]));
460+
Assert.IsTrue(currentSpawnCount.outputSlots[0].Link(add.inputSlots[1]));
461+
Assert.IsTrue(add.outputSlots[0].Link(setSpawnCount.inputSlots[0]));
462+
463+
//Create output event
464+
var outputEvent = ScriptableObject.CreateInstance<VFXOutputEvent>();
465+
var basicSpawner = graph.children.OfType<VFXBasicSpawner>().FirstOrDefault();
466+
graph.AddChild(outputEvent);
467+
outputEvent.LinkFrom(basicSpawner);
468+
AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(graph));
469+
470+
s_ReceivedEventNamedId = new List<int>();
471+
vfxComponent.outputEventReceived += OnEventReceived_RegisterNameID;
472+
473+
int maxFrame = 512;
474+
while (vfxComponent.culled && --maxFrame > 0)
475+
{
476+
yield return null;
477+
}
478+
Assert.IsTrue(maxFrame > 0);
479+
480+
vfxComponent.Reinit();
481+
float deltaTime = 0.1f;
482+
uint count = 32;
483+
vfxComponent.Simulate(deltaTime, count);
484+
Assert.AreEqual(0u, s_ReceivedEventNamedId.Count); //The simulate is asynchronous
485+
486+
float simulateTime = deltaTime * count;
487+
uint expectedEventCount = (uint)Mathf.Floor(simulateTime / spawnCountValue);
488+
489+
maxFrame = 64; s_ReceivedEventNamedId.Clear();
490+
cameraObj.SetActive(false);
491+
while (s_ReceivedEventNamedId.Count == 0u && --maxFrame > 0)
492+
{
493+
yield return null;
494+
}
495+
Assert.AreEqual(expectedEventCount, (uint)s_ReceivedEventNamedId.Count);
496+
yield return null;
497+
498+
yield return new ExitPlayMode();
499+
}
500+
419501
[UnityTest]
420502
public IEnumerator Create_Asset_And_Component_Spawner()
421503
{
@@ -1110,6 +1192,103 @@ bool CompareWithExpectedLog(StringBuilder actualContent, string identifier, out
11101192
return success;
11111193
}
11121194

1195+
public static IEnumerable<IEnumerable<T>> PermutationHelper<T>(IEnumerable<T> set, IEnumerable<T> subset = null)
1196+
{
1197+
if (subset == null)
1198+
subset = Enumerable.Empty<T>();
1199+
1200+
if (!set.Any())
1201+
yield return subset;
1202+
1203+
for (var i = 0; i < set.Count(); i++)
1204+
{
1205+
var newSubset = set.Take(i).Concat(set.Skip(i + 1));
1206+
foreach (var permutation in PermutationHelper(newSubset, subset.Concat(set.Skip(i).Take(1))))
1207+
{
1208+
yield return permutation;
1209+
}
1210+
}
1211+
}
1212+
1213+
public static string[] k_CreateSpawner_Chaining_And_Check_Expected_Ordering = PermutationHelper(new[] { "A", "B", "C", "D" }).Select(o => o.Aggregate((a, b) => a + b)).ToArray();
1214+
public static bool[] k_CreateSpawner_Chaining_And_Check_Expected_Plug_C_First = { true, false };
1215+
[UnityTest]
1216+
public IEnumerator CreateSpawner_Chaining_And_Check_Expected_Ordering([ValueSource("k_CreateSpawner_Chaining_And_Check_Expected_Ordering")] string ordering, [ValueSource("k_CreateSpawner_Chaining_And_Check_Expected_Plug_C_First")] bool plugCFirst)
1217+
{
1218+
var graph = VFXTestCommon.MakeTemporaryGraph();
1219+
// A -> B -> C -> Init
1220+
// \-> D /
1221+
var correctSequences = new string[] { "ABCD", "ABDC" };
1222+
1223+
foreach (var c in ordering)
1224+
{
1225+
var spawnerContext = ScriptableObject.CreateInstance<VFXBasicSpawner>();
1226+
var blockSpawnerConstant = ScriptableObject.CreateInstance<VFXSpawnerConstantRate>();
1227+
blockSpawnerConstant.GetInputSlot(0).value = 0.1f;
1228+
spawnerContext.label = c.ToString();
1229+
spawnerContext.AddChild(blockSpawnerConstant);
1230+
graph.AddChild(spawnerContext);
1231+
}
1232+
1233+
var initialize = ScriptableObject.CreateInstance<VFXBasicInitialize>();
1234+
var setPosition = ScriptableObject.CreateInstance<SetAttribute>();
1235+
setPosition.SetSettingValue("attribute", "position");
1236+
initialize.AddChild(setPosition);
1237+
var output = ScriptableObject.CreateInstance<VFXPointOutput>();
1238+
graph.AddChild(initialize);
1239+
graph.AddChild(output);
1240+
output.LinkFrom(initialize);
1241+
1242+
var spawn_a = graph.children.OfType<VFXBasicSpawner>().First(o => o.label == "A");
1243+
var spawn_b = graph.children.OfType<VFXBasicSpawner>().First(o => o.label == "B");
1244+
var spawn_c = graph.children.OfType<VFXBasicSpawner>().First(o => o.label == "C");
1245+
var spawn_d = graph.children.OfType<VFXBasicSpawner>().First(o => o.label == "D");
1246+
1247+
if (plugCFirst)
1248+
{
1249+
initialize.LinkFrom(spawn_c);
1250+
initialize.LinkFrom(spawn_d);
1251+
}
1252+
else
1253+
{
1254+
initialize.LinkFrom(spawn_d);
1255+
initialize.LinkFrom(spawn_c);
1256+
}
1257+
1258+
spawn_d.LinkFrom(spawn_a);
1259+
spawn_c.LinkFrom(spawn_b);
1260+
spawn_b.LinkFrom(spawn_a);
1261+
1262+
Assert.AreEqual(2, spawn_a.outputFlowSlot[0].link.Count);
1263+
Assert.AreEqual(1, spawn_b.outputFlowSlot[0].link.Count);
1264+
Assert.AreEqual(1, spawn_c.outputFlowSlot[0].link.Count);
1265+
Assert.AreEqual(1, spawn_d.outputFlowSlot[0].link.Count);
1266+
graph.SetCompilationMode(VFXCompilationMode.Runtime);
1267+
AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(graph));
1268+
1269+
var gameObj = new GameObject("CreateSpawner_Chaining_And_Check_Expected_Ordering");
1270+
var vfxComponent = gameObj.AddComponent<VisualEffect>();
1271+
vfxComponent.visualEffectAsset = graph.visualEffectResource.asset;
1272+
1273+
var particleSystem = new List<string>();
1274+
vfxComponent.GetParticleSystemNames(particleSystem);
1275+
Assert.AreEqual(1, particleSystem.Count);
1276+
1277+
var spawnSystem = new List<string>();
1278+
vfxComponent.GetSpawnSystemNames(spawnSystem);
1279+
Assert.AreEqual(4, spawnSystem.Count);
1280+
Assert.Contains("A", spawnSystem);
1281+
Assert.Contains("B", spawnSystem);
1282+
Assert.Contains("C", spawnSystem);
1283+
Assert.Contains("D", spawnSystem);
1284+
1285+
var actualSequence = spawnSystem.Aggregate((a, b) => a + b);
1286+
Assert.Contains(actualSequence, correctSequences);
1287+
yield return null;
1288+
1289+
GameObject.DestroyImmediate(gameObj);
1290+
}
1291+
11131292
static readonly System.Reflection.MethodInfo[] k_SpawnerStateGetter = typeof(VFXSpawnerState).GetMethods().Where(o => o.Name.StartsWith("get_") && o.Name != "get_vfxEventAttribute").ToArray();
11141293
static string DebugSpawnerStateAggregate(IEnumerable<string> all)
11151294
{
Loading
Loading

TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/016_DirectLink.png.meta

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

0 commit comments

Comments
 (0)