Add decal angle fading + clean tech debt in decal C##1934
Merged
Conversation
| public DecalLayerEnum decalLayerMask; | ||
| } | ||
|
|
||
| internal CachedDecalData GetCachedDecalData() |
Contributor
There was a problem hiding this comment.
Is there any way we can actually cache that and not reconstruct every time we need it? (might not be, not super familiar with the rest of the code)
Contributor
Author
There was a problem hiding this comment.
I am not sure, guess when we call this function it usually mean that there is a change (in particular the rotation matrix), but I can investigate)
JulienIgnace-Unity
suggested changes
Sep 22, 2020
Contributor
JulienIgnace-Unity
left a comment
There was a problem hiding this comment.
As discussed over slackerd, there's an additional cleanup that can be done on the "current" cached data in the system.
JulienIgnace-Unity
approved these changes
Sep 25, 2020
Contributor
Author
|
merge for 10.1 |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
This PR add the support of angle based fading for decal when using the Decal Layer feature (as we have access to the vertex normal in this case).
Angle based fading looks like this:

The PR add a test 7512 to check it.
Currently the angle fading is not linear (as we play with angle) to reduce the ALU cost in shader. In practice it shouldn't be a problem as such usage is mainly to avoid uv stretching on hard surfaces.
This feature only work for projector.
What I tested:
I tested with cluster decal (regualr decal with affect transparent on a transparent material), shader graph decal and regular decal, tested that the feature is correctly enabled/disable based on Decal Layer enabling and non default value.
Testing status
Manual Tests: What did you do?
Automated Tests: What did you setup? (Add a screenshot or the reference image of the test please)
Yamato: (Select your branch):
https://yamato.prd.cds.internal.unity3d.com/jobs/902-Graphics
Any test projects to go with this to help reviewers?
Comments to reviewers
Notes for the reviewers you have assigned.