-
Notifications
You must be signed in to change notification settings - Fork 855
[VFX] reimport on SRP changed + remove built-in support and notify #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Renable test to cover issue 1206890 * Fix newly introduced test : Exepcted value is original after reset override & handle correctly color
* Add int and uint to Compare node and condition expression * minor fixes * Change SerializeType so that tests are correct against System.Type and null * Fix switch * Update changelog
Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk>
* Fix square complexity on parameter to serialized property matching * Update CHANGELOG.md
* Fix vfx view not beeing framed at launch * safer implementation * Update CHANGELOG.md
#84) * Fix for the lookup of mixed values in the VisualEffectEditor with objects that can be null * Update CHANGELOG.md
# Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md
* Operator creation, does NOT sample an SDF * First implementation of the sampleSDF operator, might not be optimised * Delete VFXExpressionSampleSDF.cs * Updated Test Graph * Better handling of out of bounds queries for normals and distances * Delete HDRenderPipelineEditorResources.asset * Delete XRPackageSettings.asset * Assumption that the SDF is baked in the world space, in a box matching the orientedBox given as input * Update 27_SampleSDF.vfx * Update 27_SampleSDF.vfx * restored the deleted asset * Enforces and apply the 4 parents max rule * Removes the return statements in branch * Revert "restored the deleted asset" This reverts commit 57757b5a3ed4c303c34dc7dc920ad6d0328fcfdb. * Revert "Revert "restored the deleted asset"" This reverts commit 7753b4e85aba5d75e8af659aedc66515a0c56e20. * Fix compilation error and warnings * Fix Pascal case * Fix Pascal. Really. * Revert "Revert "Revert "restored the deleted asset""" This reverts commit daf8b79a78f55b47b6bd85afd9008a57d96f50f1. * Uses the Inverse-Transpose matrix for SDF related normal transformations (for non uniform scaling) * Delete packages-lock.json * Revert "Delete packages-lock.json" This reverts commit 4a10123f3171d6cf981c5effa52128ebb1411735. * Revert "Revert "Delete packages-lock.json"" This reverts commit 84d700f0f1fde91d4ad5a6ab87f3946216f883f4. * Restore this mistakenly modified file * Update 27_SampleSDF.vfx * Get rid of useless transpose * Added Graphic Test * Added reference images * Fix incorrect out-of-bounds check + auto recompile * Added reference images * Clarify the name of the output
* *Prepare a proper way to test different shadow cases * prepare a shadow graph unlit (modifying alpha) * Add reference data for shadow test * Minimal data for reproduce issue 1259511 * Fix shadowpath using common integration of PassDepthOrMV & adding VFX_PASSDEPTH_SHADOW define * *Update ShadowMaterial * *Update ShaderGraphShadow.vfx * *Move shader to common testing asset * Add equivalent test for URP * Add graphicTest for URP * *Update reference images * Fix display of alphaTreshold slider with shaderGraph : only if transparent using motionVector or shadowCasting * Fix alphaClipping condition (will require validation of @shader-graph) : use proper boolean synchronized instead of testing slot presence * Fix incorrect block listing * *Update changelog.md * Fix pass selection for lit effect * Early remove ports which aren't active in VFXTarget : save code compilation & cleaner solution * Voluntary add disabled branch on shadow unlit to cover alphaTreshold case * *Minor comment * Fix return alpha clipping (missing actual alpha test enabled) * *Restore deleted file (to minimize change in MR, these files can be directly deleted on vfx/staging) * VFX Graph Bugfix for shader compilation error in scene selection pass: 'Shaderpass should be defined at this stage.' # Conflicts: # com.unity.visualeffectgraph/Shaders/ParticlePlanarPrimitives/PassDepthOrMV.template * Revert unexpected change iVisualEffectGraph_HDRP\ProjectSettings\EditorBuildSettings.asset * *Update reference image & Fix treshold for URP scene which was really too low (set to default 5e-4f) * Fix issue https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/77#discussion_r69288 It was a bad merge Co-authored-by: pastasfuture <pastasfuture@gmail.com>
* Fix missing type copy in reduce Tested locally on a PS4 * Add expection to detect unsupported value type
* Change the way rand expression equality is handled * Refactor a bit * Add editor test
* World to Viewport Point & Viewport to World Point operators + Test First implementation of World to Viewport Point operator and its reciprocal Viewport to World Point operator. Includes a test scene for these 2 operators. * Update CHANGELOG.md Update Changelog * Added documentation md files. Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk>
* Operator creation, does NOT sample an SDF * First implementation of the sampleSDF operator, might not be optimised * Delete VFXExpressionSampleSDF.cs * Updated Test Graph * Better handling of out of bounds queries for normals and distances * Delete HDRenderPipelineEditorResources.asset * Delete XRPackageSettings.asset * Assumption that the SDF is baked in the world space, in a box matching the orientedBox given as input * Update 27_SampleSDF.vfx * Update 27_SampleSDF.vfx * restored the deleted asset * Enforces and apply the 4 parents max rule * Removes the return statements in branch * Revert "restored the deleted asset" This reverts commit 57757b5a3ed4c303c34dc7dc920ad6d0328fcfdb. * Revert "Revert "restored the deleted asset"" This reverts commit 7753b4e85aba5d75e8af659aedc66515a0c56e20. * Fix compilation error and warnings * Fix Pascal case * Fix Pascal. Really. * Revert "Revert "Revert "restored the deleted asset""" This reverts commit daf8b79a78f55b47b6bd85afd9008a57d96f50f1. * Uses the Inverse-Transpose matrix for SDF related normal transformations (for non uniform scaling) * Delete packages-lock.json * Revert "Delete packages-lock.json" This reverts commit 4a10123f3171d6cf981c5effa52128ebb1411735. * Revert "Revert "Delete packages-lock.json"" This reverts commit 84d700f0f1fde91d4ad5a6ab87f3946216f883f4. * Restore this mistakenly modified file * Update 27_SampleSDF.vfx * Get rid of useless transpose * Added Graphic Test * Added reference images * Fix incorrect out-of-bounds check + auto recompile * Added reference images * Clarify the name of the output * Remove the use of inverse transpose for the "normals" * Restore the Inverse Transpose and modify Collision code * Restore Conform and Collide previous behavior + direction points to the surface * add documentation * Consistent distance and normal handling + ref images * Cleaning + World space stick distance and radius + references * Max scale through expression evaluated on GPU (if needed) * Max3 on CPU
…sions-colorgrading' into vfx/staging
* Simpler update to use now available ByteAddressBuffer * Temp Workaround a GPU hang We should isolate properly this code. * Proper fix of OOB FetchBuffer * *Update changelog.md
…fx-graphics into vfx/staging
* Fix VFXExpressionVector3sToMatrix & VFXExpressionVector4sToMatrix evaluation on GPU * *Update changelog.md
* Base Commit * Moved Files down one folder * Updated Package Configuration, CHANGELOG and documentation * Fixed Behavior of ExposedProperty by implementing a simple Drawer / Debug Behaviour * Small fixes and checks * Updated Documentation / Renamed Attribute handler RigidBody to RigidBodyVeolcity + Safe check * Small Fixes * Added the Execute In Editor Capability + Custom Inspectors in order to handle the capability correctly * Other custom Editors + Helpbox * Added CMCameraShake Editor + Capabilities / Fixed Possible Circular Reference in Prefab Spawn * Removed Rerouting Helpers as CopyValuesFrom is broken at the moment. * Fixed ASMDEFs / class accessibility * Updated Documentation * Fixed Class Accessibility for ExposedPropertyDrawer * Updated Changelog (missing entry for Exposed Proeprty Custom Property Drawer) Co-authored-by: Thomas ICHÉ <peeweek@gmail.com>
It appears that you made a non-draft PR! |
@julienf-unity I don't see any problem with removing BRP (Built-in RP) support as long as #4030 is merged before this PR (or before a final release.) As I understand, it will maintain VFX Graph compatibility with BRP (in a new, render pipeline agnostic way,) now that #3467 has been merged? I suggest to maintain continuous compatibility if at all possible, for to avoid a similar situation Unity had with Enlighten real-time GI support for HDRP:
Ideally, the 2nd and 3rd step are swapped, avoiding final releases where the feature support is effectively missing. This could also be mitigated with backporting, but it seems it could be avoided entirely. EDIT: Actually, I suppose it's already too late to avoid a lapse in BRP support. It looks like VFX graph support for BRP broke 3 months ago with #3443 (and even backported to previous releases) and was about to be fixed in #3950 but promptly canceled due to VFX Graph not "officially" supporting BRP. Good thing most people don't know VFX Graph has (unofficially) supported BRP for years now 🤫 |
@landonth SG supporting built-in does not imply VFX supporting builtin. Even with the new SG integration in VFX, we still have simulation shaders to generate that relies on SRP shader library for instance and also all our outputs that do not depend on new SG integration. So this PR means no builtin support in VFX. This has been discussed and it's approved to remove built in support in VFX (while shader graph is adding it... confusing I know). But maintaining built in in our case is too much of a burden. So this PR officialy states "VFX not supported with built in" instead of being in an undefined territory with no clear communication (i.e we detect and compile for builtin but generated shaders are not compiling anymore since a few versions) |
Hi @julienf-unity , got some things jotted down on the test doc to take a look at when you get a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, one small (possibly unrelated) occasional console message case can be investigated down the road (noted on the test doc).
Otherwise tried switching between HDRP-URP-Built-in in various orders with many VFXs and it works as expected.
Attempting to use VFX in built-in provides an informative console message in the appropriate most common scenarios (SRP switch, project opening, creating new VFX, opening a VFX, and compiling a VFX).
No outstanding issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful with the fact an SRP can be active from the QualityLevel while GraphicsSettings are for a different SRP. (those workflow should not happen on future versions once the deprecation of GfxSettings' defaultRP lands)
{ | ||
if (binder == null && (forceLog || !unsupportedSRPWarningIssued)) | ||
{ | ||
Debug.LogWarning("The Visual Effect Graph is supported in the High Definition Render Pipeline (HDRP) and the Universal Render Pipeline (URP). Please assign your chosen Render Pipeline Asset in the Graphics Settings to use it."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should also mention the Quality Settings (A valid Render Pipeline asset needs to be assigned in the Graphics Settings or the Quality Settings.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what would be the text? "Please assign your chosen Render Pipeline Asset in the Graphics or Quality Settings to use it" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what message the tech writing team gave to me for my feature "Project graphics settings do not refer to a URP Asset. Check the settings: Graphics > Scriptable Render Pipeline Settings, Quality > Render Pipeline Asset."
maybe it could be tweaked for your case to:
"The Visual Effect Graph is supported in the High Definition Render Pipeline (HDRP) and the Universal Render Pipeline (URP). Check the settings: Graphics > Scriptable Render Pipeline Settings, Quality > Render Pipeline Asset."
bool logIssued = unsupportedSRPWarningIssued; | ||
var binder = currentSRPBinder; | ||
|
||
if (logIssued || !unsupportedSRPWarningIssued) // Don't reissue warning if inner currentSRPBinder call has already logged it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that if is a bit weird - it can probably be removed
logIssued == unsupportedSRPWarningIssued value according to line 498
and you are checking the value of unsupportedSRPWarningIssued in the other function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because we have 2 paths. LogUnsupportedSRP can be called from lazily initializing the currentSRPBinder (in that case we want to log only the first time) or explicitely upon some users action (opening the graph view, explicitely trying to compile a VFX...) and in this case we want to log always.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let us imagine unsupportedSRPWarningIssued equals to true. then
if(logIssue || !unsupportedSRPWarningIssued ) <=> if(true || false) > then TRUE
the opposite is:
if(logIssue || !unsupportedSRPWarningIssued ) <=> if (false|| true) > then TRUE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logIssued is just a cache to check whether the inner call to currentSRPBinder has issued the log already (logIssued is false and unsupportedSRPWarningIssued is true after the call) and in that case we don't reissue (else it will be logged twice in a row). true to false is not possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt it be forceLog
in the if statement instead of logIssue
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the test "if (logIssued || !unsupportedSRPWarningIssued)" is false, it means the message has already been log during the inner call to currentSRPBinder just above (unsupportedSRPWarningIssued was false before currentSRPBinder call, and true after), regardless of forceLog. This just prevents logging twice from the same explicit LogUnsupportedSRP call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okayyyyyy.... currentSRPBinder is not a getter but a function call! now all of it makes sense :)
I was going crazy
so now... how do we prevent others from going crazy? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a getter but lazily initialized. We could move the initialization directly in the callback probably. But it was safer and less intrusive to do it this way now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside the remark from @jenniferd-unity
It looks good to me.
However, you should also double check your empty folder after master merge : the universal template folder has been moved to urp package, you could have an unexpected remaining metafile for the folder "RenderPipeline".
We'll do a follow up PR to remove the reflection and polish things after C++ has landed |
Purpose of this PR
This PR uses the new SRP changed callback to reimport automatically VFX on SRP switch
It also removes built-in support (and all related code) and issue a warning if current pipeline is not supported by VFX
Limitation
There are a couple of cases where some VFX data can be lost when switching pipeline. Mostly slots value that are spawned based on some SRP caps (alphathreshold value for transparent outputs with motion vectors or shadows for instance)
Switiching SRP should not alter VFX asset in any way and this should be adress in another PR.
Side note
A callback should be added on SRP switch to inform user that some reimports will occur and this might take time
Testing status
Tested locally by switching pipeline asset
Comments to reviewers
This PR requires a C++ custom branch: https://ono.unity3d.com/unity/unity/pull-request/125169
At the moment this branch fails to compile with laltest master. I asked for a trunk merge
But if you encouter the compilation, just commenting out those in HDRenderPipeline.cs does the trick:
// , autoAmbientProbeBaking = false
// , autoDefaultReflectionProbeBaking = false
// , enlightenLightmapper = false