Skip to content

CHANGE: Move Input System test scenes and samples to URP#2397

Open
Pauliusd01 wants to merge 12 commits intodevelopfrom
move-inputsystem-to-urp
Open

CHANGE: Move Input System test scenes and samples to URP#2397
Pauliusd01 wants to merge 12 commits intodevelopfrom
move-inputsystem-to-urp

Conversation

@Pauliusd01
Copy link
Collaborator

@Pauliusd01 Pauliusd01 commented Mar 25, 2026

Description

Previous approach was to use shadergraph shaders to try and support all 3 pipelines which proved to be very difficult across different editor and package versions. This time I'm dropping the HDRP support and using URP shaders with Built in renderpipeline fallbacks. This does mean that our project will move to use URP by default

Testing status & QA

Mark cells: ✅ pass, ❌ fail, ➖ N/A

Samples

Scene 2022.3 URP 2022.3 Built-in 6.X URP 6.X Built-in
SimpleDemo (×4)
SimpleMultiplayerDemo
ProjectWideActions
UIvsGameInput
InGameHints
RebindingUI
UnityRemote

QA

Scene 2022.3 URP 2022.3 Built-in 6.X URP 6.X Built-in
GUITest
OnMouseEventsTestScene
DocsExamples (×3)
EditModeTest
MLActions

TouchSamples

Scene 2022.3 URP 2022.3 Built-in 6.X URP 6.X Built-in
Tapping
Drawing
Rolling
Swiping
Menu

InputDeviceTester

Scene 2022.3 URP 2022.3 Built-in 6.X URP 6.X Built-in
InputDeviceTester

Overall Product Risks

  • Complexity: 1
  • Halo Effect: 2

Comments to reviewers

N/A

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

Migrate materials and scene/prefab references to new URP shader assets: updated many .mat files to point to the new shader GUID/fileID and replaced placeholder material references in numerous scenes and prefabs (MeshRenderer/ParticleSystemRenderer entries). Added URP assets and global settings under Assets/Settings (URP-PipelineAsset, URP-Renderer, UniversalRenderPipelineGlobalSettings) and new shader sources (SamplesSimpleLit and other sample shaders). Also updated Packages/manifest.json and ProjectSettings (GraphicsSettings, QualitySettings) and added ShaderGraph/URP project settings to enable the URP configuration across the project and external sample projects.
Add a SimpleLit shader and Default.mat assets (with .meta) across multiple sample folders (InGameHints, ProjectWideActions, RebindingUI, SimpleDemo, SimpleMultiplayer, UIvsGameInput, UnityRemote). Update sample scenes and prefabs to reference the new Default material GUIDs and adjust RebindingUI game materials to use the new shader GUID. This provides a shared lightweight PBR shader and default materials for the sample content.
u-pr[bot]

This comment was marked as resolved.

@codecov-github-com
Copy link

codecov-github-com bot commented Mar 25, 2026

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff             @@
##           develop    #2397      +/-   ##
===========================================
+ Coverage    77.92%   78.12%   +0.19%     
===========================================
  Files          482      483       +1     
  Lines        97755    98555     +800     
===========================================
+ Hits         76175    76992     +817     
+ Misses       21580    21563      -17     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.35% <ø> (-0.21%) ⬇️
inputsystem_MacOS_2022.3_project 75.32% <ø> (-0.05%) ⬇️
inputsystem_MacOS_6000.0 5.32% <ø> (-0.02%) ⬇️
inputsystem_MacOS_6000.0_project 77.22% <ø> (-0.05%) ⬇️
inputsystem_MacOS_6000.3 5.32% <ø> (-0.02%) ⬇️
inputsystem_MacOS_6000.3_project 77.22% <ø> (-0.05%) ⬇️
inputsystem_MacOS_6000.4 5.32% <ø> (-0.02%) ⬇️
inputsystem_MacOS_6000.4_project 77.23% <ø> (-0.05%) ⬇️
inputsystem_MacOS_6000.5 5.31% <ø> (-0.03%) ⬇️
inputsystem_MacOS_6000.5_project 77.27% <ø> (-0.01%) ⬇️
inputsystem_MacOS_6000.6 5.31% <ø> (-0.03%) ⬇️
inputsystem_MacOS_6000.6_project 77.27% <ø> (-0.01%) ⬇️
inputsystem_Ubuntu_2022.3_project 75.12% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.0 5.32% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.03% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.3 5.32% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.03% <ø> (-0.05%) ⬇️
inputsystem_Ubuntu_6000.4 5.33% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.4_project 77.04% <ø> (-0.05%) ⬇️
inputsystem_Ubuntu_6000.5 5.32% <ø> (-0.03%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.07% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.6 5.32% <ø> (-0.03%) ⬇️
inputsystem_Ubuntu_6000.6_project 77.07% <ø> (-0.01%) ⬇️
inputsystem_Windows_2022.3 5.35% <ø> (-0.21%) ⬇️
inputsystem_Windows_2022.3_project 75.45% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.0 5.32% <ø> (-0.02%) ⬇️
inputsystem_Windows_6000.0_project 77.35% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.3 5.32% <ø> (-0.02%) ⬇️
inputsystem_Windows_6000.3_project 77.35% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.4 5.32% <ø> (-0.02%) ⬇️
inputsystem_Windows_6000.4_project 77.35% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.5 5.31% <ø> (-0.03%) ⬇️
inputsystem_Windows_6000.5_project 77.40% <ø> (+<0.01%) ⬆️
inputsystem_Windows_6000.6 5.31% <ø> (-0.03%) ⬇️
inputsystem_Windows_6000.6_project 77.40% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 5 files with indirect coverage changes

ℹ️ Need help interpreting these results?

Pauliusd01 and others added 2 commits March 25, 2026 10:54
Add support for punctual light shadows across sample SimpleLit shaders and improve capture shader blending.

- Created Assets/Samples/InGameHints/SimpleLit.shader (full URP+fallback implementation).
- For multiple Sample SimpleLit shaders (various sample folders and ExternalSampleProjects): added #pragma multi_compile _ _CASTING_PUNCTUAL_LIGHT_SHADOW, introduced float3 _LightPosition, and compute lightDir conditionally (use _LightPosition for punctual lights, otherwise _LightDirection) before ApplyShadowBias. Also adjusted shader names to include sample subfolder paths.
- Updated ExternalSampleProjects/InputDeviceTester/WorldCoord Diffuse.shader: added screen shadow and soft shadow multi_compile flags, normalized blend weights for axis-based texturing, use TransformWorldToShadowCoord to get shadowCoord for GetMainLight, and factor in distanceAttenuation and shadowAttenuation into diffuse lighting.
- Refactored ExternalSampleProjects/TouchSamples Capture.shader: added properties for _SrcBlend, _DstBlend and _Premultiplied, made Blend use those properties, added local shader_feature for _PREMULTIPLIED_ON, consolidated URP/premultiplied variants, unified built-in fallback paths, and updated fragment logic to correctly handle premultiplied vs non-premultiplied output.

These changes improve shadow correctness for punctual lights and add flexible, correct blending modes for capture/predicated premultiplied alpha handling.
@u-pr

This comment was marked as resolved.

@josepmariapujol-unity

This comment was marked as resolved.

Pauliusd01 and others added 2 commits March 25, 2026 16:02
Add _MAIN_LIGHT_SHADOWS_SCREEN and _SHADOWS_SOFT multi_compile pragmas to various SimpleLit sample shaders and set inputData.shadowCoord = TransformWorldToShadowCoord(...) so shaders can use screen and soft shadow paths. Also enable the Render Graph in the URP pipeline asset (m_EnableRenderGraph: 1). Affects multiple sample and external sample SimpleLit shaders and the URP pipeline asset.
@Pauliusd01

This comment was marked as resolved.

@u-pr

This comment was marked as resolved.

Pauliusd01 and others added 6 commits March 26, 2026 09:55
Update sample .sample.json descriptions to indicate the Universal Render Pipeline (URP) package is required for shader compilation. Add URP_COMPATIBILITY_MODE to Standalone scripting define symbols in ProjectSettings so code can conditionally enable URP compatibility.
Add the URP_COMPATIBILITY_MODE scripting define symbol to PlayerSettings across projects. Updates ProjectSettings.asset in the root project and ExternalSampleProjects (InputDeviceTester and TouchSamples) to set scriptingDefineSymbols for Android, iPhone, and tvOS, and ensure Standalone retains URP_COMPATIBILITY_MODE (preserving existing UNITY_ENABLE_STEAM_CONTROLLER_SUPPORT for Standalone). This enables URP compatibility mode across those platforms and sample projects.
@Pauliusd01
Copy link
Collaborator Author

@u-pr Can you confirm that previous feedback has been addressed? And that there isn't any other issues?

@u-pr
Copy link
Contributor

u-pr bot commented Mar 26, 2026

I have reviewed the latest changes against the previous feedback. While most issues have been successfully addressed, there are a few items that still require attention.

✅ Addressed

  • Shader Name Collisions: All SimpleLit.shader instances now have unique names following their folder structure (e.g., "Samples/InGameHints/SimpleLit"), which prevents conflicts.
  • Shadow Logic in SimpleLit: The ForwardLit passes now correctly calculate shadowCoord and pass it to UniversalFragmentPBR. The ShadowCaster pass has also been added to all variants.
  • Triplanar Mapping (URP): In WorldCoord Diffuse.shader, blending weights are now normalized, and the lighting calculation correctly accounts for distance and shadow attenuation.
  • Shader Consolidation: Capture.shader has been refactored to use a single SubShader per pipeline using material properties for blending and a shader feature for premultiplied alpha.

❌ Not Addressed

  • Built-in RP Input Struct: In WorldCoord Diffuse.shader, the Input struct for the Built-in RP SubShader (line 171) still appears to be missing the worldPos and worldNormal fields. Since the surf function (lines 175–181) accesses these fields, this will cause a compilation error in projects using the Built-in Render Pipeline.
  • Triplanar Efficiency: In the URP pass of WorldCoord Diffuse.shader, the calculation of blendWeights still uses dot products with axis vectors (lines 71–74). Accessing the normal components directly (e.g., abs(normalWS.z)) is more efficient.

ℹ️ Other Considerations

  • CI Error: The build error regarding URP_COMPATIBILITY_MODE mentioned by @josepmariapujol-unity still needs to be resolved in the Project Settings (Edit > Project Settings > Player > Scripting Define Symbols) if it's blocking the CI.
  • General Review: No other significant issues were found in the shader logic or package manifest updates. The addition of URP as a dependency in manifest.json is correct given the new shader requirements.

🤖 Helpful? 👍/👎

@@ -25,9 +172,9 @@ struct Input {
};
Copy link
Contributor

Choose a reason for hiding this comment

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

The Input struct still lacks the worldPos and worldNormal fields required by the surf function below.

struct Input {
    float2 uv_MainTex;
    float3 worldPos;
    float3 worldNormal;
};

🤖 Helpful? 👍/👎

half3 blendWeights = abs(half3(
dot(normalWS, half3(0, 0, 1)),
dot(normalWS, half3(0, 1, 0)),
dot(normalWS, half3(1, 0, 0))));
Copy link
Contributor

Choose a reason for hiding this comment

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

As mentioned in previous feedback, using dot with axis vectors is less efficient than directly accessing the normal components.

Consider replacing lines 71–74 with:

half3 blendWeights = abs(normalWS.zyx);

🤖 Helpful? 👍/👎

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants