Skip to content

Add decal angle fading + clean tech debt in decal C##1934

Merged
sebastienlagarde merged 19 commits into
HDRP/stagingfrom
HDRP/decal-angle-fade
Oct 4, 2020
Merged

Add decal angle fading + clean tech debt in decal C##1934
sebastienlagarde merged 19 commits into
HDRP/stagingfrom
HDRP/decal-angle-fade

Conversation

@sebastienlagarde
Copy link
Copy Markdown
Contributor

@sebastienlagarde sebastienlagarde commented Sep 17, 2020

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:
visuel_decal_slide_working

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?

  • Opened test project + Run graphic tests locally
  • Built a player
  • Checked new UI names with UX convention
  • Tested UI multi-edition + Undo/Redo + Prefab overrides + Alignment in Preset
  • C# and shader warnings (supress shader cache to see them)
  • Checked new resources path for the reloader (in developer mode, you have a button at end of resources that check the paths)
  • Other:

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.

public DecalLayerEnum decalLayerMask;
}

internal CachedDecalData GetCachedDecalData()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@sebastienlagarde sebastienlagarde marked this pull request as ready for review September 22, 2020 12:52
Copy link
Copy Markdown
Contributor

@JulienIgnace-Unity JulienIgnace-Unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed over slackerd, there's an additional cleanup that can be done on the "current" cached data in the system.

@sebastienlagarde sebastienlagarde requested a review from a team October 4, 2020 22:53
@sebastienlagarde
Copy link
Copy Markdown
Contributor Author

merge for 10.1

@sebastienlagarde sebastienlagarde merged commit a828714 into HDRP/staging Oct 4, 2020
@sebastienlagarde sebastienlagarde deleted the HDRP/decal-angle-fade branch October 4, 2020 22:54
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.

2 participants