-
Notifications
You must be signed in to change notification settings - Fork 855
Fix backface and displacement picking for HDRP #2234
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
# Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md
It appears that you made a non-draft PR! |
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.
Checked all SG and HDRP shaders, backfaces are correctly ignored now(except for unlit since it's handled by another pr and tessellation).
For tessellation shaders I've filed a ticket here so it wouldn't get lost in the future: https://fogbugz.unity3d.com/f/cases/1285367/
Like Adrien mentions selection also ignores tessellation displacement and should be taken into account
com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl
Outdated
Show resolved
Hide resolved
* Scene selection pass * Don't cull backfaces * changelog * Lit Shader picking pass * hdrp shaders * Added ScenePickingPass to ShaderGraph * Fixes for decals * Tessellation picking * Update Upgrading-from-2020.1-to-2020.2.md * Move function to common.hlsl * Reorder decal passes * Minor changes Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com>
Purpose of this PR
Fix for https://fogbugz.unity3d.com/f/cases/1282977/
and https://fogbugz.unity3d.com/f/cases/1217722/
Add a ScenePicking Pass to most shaders to have a custom picking
This allows to have picking depend on the material culling mode and to be able to correclty pick objects with vertex displacement.
This is done on HDRP Lit, LayeredLit, AxF, and Decal shaders and ShaderGraphs
[OUTDATED: This PR doesn't change anything for LitTessellation and LayeredLitTessellation so they are still 'broken']
Fix for https://fogbugz.unity3d.com/f/cases/1285370/
and https://fogbugz.unity3d.com/f/cases/1285367/
Tessellation picking now works correclty
The Unlit shader as well as URP shaders will be fixed by this PR:
https://ono.unity3d.com/unity/unity/pull-request/114181/_/editor/fix-picking-raster-state
Decal projectors cannot be picked because they are not taken into account by the picking pass.
To sum up, every object picking should be correct, with or without vertex displacement/tessellation
Materials for test scenes are upgraded in #2349
Testing status
Tested picking of front and back faces of all aforementionned materials with alpha transparency and vertex displacement.
Tested the repro scene given in the second bug case
Lit Tessellation show selected outline on backfaces

Lit Tessellation picking with vertex displacement
