Skip to content

Conversation

PaulDemeulenaere
Copy link
Contributor

@PaulDemeulenaere PaulDemeulenaere commented Sep 23, 2021


Purpose of this PR

Fix issue introduced at #5428

Unhandled log message: '[Error] Shader error in 'Hidden/VFX/SampleScene/System (1)/Output Particle Quad': 'VFXGetPositionRWS': no matching 1 parameter function at line 1647 (on d3d11)

The condition which generates VFX_VARYING_POSWS wasn't consistent between defines & code generation
Extract code which computes the ScreenPosition/PositionNDC from the WorldPosition dependency, it saves interpolator & computation when it isn't actually needed.


Testing status

Locally 🟢
Yamato ⏳


Comments to reviewers

See this conversation

Use common function to factorize the requirement test from SG
Regression introduced by #5428
@github-actions github-actions bot added the vfx label Sep 23, 2021
@Unity-Technologies Unity-Technologies deleted a comment from github-actions bot Sep 23, 2021
@PaulDemeulenaere PaulDemeulenaere marked this pull request as ready for review September 23, 2021 12:19
@PaulDemeulenaere PaulDemeulenaere marked this pull request as draft September 23, 2021 15:55
@PaulDemeulenaere
Copy link
Contributor Author

I'm switching back to draft while I'm improving this implementation: #5784 (comment)

Isolate screen computation from the world dependancy
See #5784 (comment)
/!\ Remove the VFXTransformPositionWorldToClip evaluated in fragment /!\
GraphicTest are 🟢 locally
@Unity-Technologies Unity-Technologies deleted a comment from github-actions bot Sep 23, 2021
@PaulDemeulenaere PaulDemeulenaere marked this pull request as ready for review September 23, 2021 20:08
If we want to be consistent with SG implementation, we have to reproduced this code: https://github.com/Unity-Technologies/Graphics/blob/75f4b421fa774d43000d703f2bbf05d7a1ca6606/com.unity.render-pipelines.universal/Editor/ShaderGraph/Templates/SharedCode.template.hlsl#L56
```
$SurfaceDescriptionInputs.ScreenPosition: output.ScreenPosition = ComputeScreenPos(TransformWorldToHClip(input.positionWS), _ProjectionParams.x);
```
Checked manually the values were consistent with VFX
@Unity-Technologies Unity-Technologies deleted a comment from github-actions bot Sep 24, 2021
@PaulDemeulenaere PaulDemeulenaere merged commit 11417d3 into master Sep 24, 2021
@PaulDemeulenaere PaulDemeulenaere deleted the vfx/fix/regression-from-sg-fix-1352662 branch September 24, 2021 19:05
cdxntchou pushed a commit that referenced this pull request Sep 27, 2021
* Fix inconsistent NeedsPositionWorldInterpolator

Use common function to factorize the requirement test from SG
Regression introduced by #5428

* Better fix & Better performance

Isolate screen computation from the world dependancy
See #5784 (comment)
/!\ Remove the VFXTransformPositionWorldToClip evaluated in fragment /!\
GraphicTest are 🟢 locally

* Fix incorrect computation of INSG.ScreenPosition

If we want to be consistent with SG implementation, we have to reproduced this code: https://github.com/Unity-Technologies/Graphics/blob/75f4b421fa774d43000d703f2bbf05d7a1ca6606/com.unity.render-pipelines.universal/Editor/ShaderGraph/Templates/SharedCode.template.hlsl#L56
```
$SurfaceDescriptionInputs.ScreenPosition: output.ScreenPosition = ComputeScreenPos(TransformWorldToHClip(input.positionWS), _ProjectionParams.x);
```
Checked manually the values were consistent with VFX
@PaulDemeulenaere
Copy link
Contributor Author

Has been backported with #5817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants