Skip to content

Exposed more option in ShaderGraph surface option#952

Merged
sebastienlagarde merged 32 commits into
HDRP/stagingfrom
HDRP/feature/expose-more-surface-option-material
Jun 28, 2020
Merged

Exposed more option in ShaderGraph surface option#952
sebastienlagarde merged 32 commits into
HDRP/stagingfrom
HDRP/feature/expose-more-surface-option-material

Conversation

@alelievr
Copy link
Copy Markdown
Contributor

@alelievr alelievr commented Jun 17, 2020

Purpose of this PR

Unify surface option between SG and non-SG material UI. Thus this PR adds these properties on the material from SG settings:

  • DisableDecals
  • DisableSSR
  • DisableSSRTransparent
  • PreserveSpecular
  • AddPrecomputedVelocity
  • TransparentWriteMotionvector
  • DepthOffset

Opaque UI:
image

Transparent UI:
image

In this PR we also ensure that code for double sided and transparent are always generated, so code must match whatever is selected in the shader graph option.

This PR also expose the following mechanism. There is option that can be exposed from Shader graph to Material by "enabling them" those option are the one that require a blockfield.

  • Alphacutoff
  • AlphaShadow

Then there is option that simply enable pass, if those option aren't enabled on the SG master node, they aren't visible on the material.

  • Backface
  • transparent pre/post pass

under the hood, enabling option allow to force code generation. Regarding transparent depth prepass, this pass is always generated as it is required for SSR transparent. But for Unlit it isn't.
The behavior for alpha clip is now like this:
If SSR transparent is enabled but not transparent depth prepass, then alpha clip with use the regular alpha threshold, otherwise alpha clip will used the transparent depth prepass threshold. The behavior for regular Material haven't change currently, so enabling SSR transparent will use the transparent depth prepass threshold.

Note: With this PR, all pass work with both anykind of lit based material and also with unlit.


Testing status

I tested Receive SSR, Receive SSR Transparent, Receive Decals, Blend Preserve Specular, Depth Offset, Transparent Write MV on a Lit SG.

In addition to Antoine test above I have perform several comparison

Yamato is green:
https://yamato.prd.cds.internal.unity3d.com/jobs/902-Graphics/tree/HDRP%252Ffeature%252Fexpose-more-surface-material/.yamato%252F_abv.yml%2523all_project_ci_CUSTOM-REVISION/2631327/job

Antoine Lelièvre added 2 commits June 17, 2020 17:08
…cular, AddPrecomputedVelocity, TransparentWriteMotionvector and DepthOffset
@alelievr alelievr self-assigned this Jun 17, 2020
@github-actions github-actions Bot added the HDRP label Jun 17, 2020

readonly static string[] floatPropertiesToSynchronize = {
"_UseShadowThreshold", kReceivesSSR, kReceivesSSRTransparent, kUseSplitLighting,
"_UseShadowThreshold", kUseSplitLighting,
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.

_UseShadowThreshold is also suppose to be on the material

const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Lit
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering;
| SurfaceOptionUIBlock.Features.ShowDepthOffsetOnly;
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.

^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 9932957a675f26c4f80761ce43958e89
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.

Marker for myself, why don't we remve HDLitGUI.cs ?

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 think we can

@alelievr alelievr requested a review from a team as a code owner June 28, 2020 00:37
@sebastienlagarde sebastienlagarde merged commit e3a9b17 into HDRP/staging Jun 28, 2020
@sebastienlagarde sebastienlagarde deleted the HDRP/feature/expose-more-surface-option-material branch June 28, 2020 22:09
@sebastienlagarde sebastienlagarde removed the request for review from a team June 28, 2020 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants