Skip to content

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

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

CHANGE: Move Input System test scenes and samples to URP#2397
Pauliusd01 wants to merge 6 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%   77.91%   -0.01%     
===========================================
  Files          482      482              
  Lines        97755    97788      +33     
===========================================
+ Hits         76175    76191      +16     
- Misses       21580    21597      +17     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.30% <ø> (-0.25%) ⬇️
inputsystem_MacOS_2022.3_project 75.35% <ø> (-0.02%) ⬇️
inputsystem_MacOS_6000.0 5.27% <ø> (-0.06%) ⬇️
inputsystem_MacOS_6000.0_project 77.25% <ø> (-0.02%) ⬇️
inputsystem_MacOS_6000.3 5.27% <ø> (-0.06%) ⬇️
inputsystem_MacOS_6000.3_project 77.25% <ø> (-0.02%) ⬇️
inputsystem_MacOS_6000.4 5.28% <ø> (-0.06%) ⬇️
inputsystem_MacOS_6000.4_project 77.26% <ø> (-0.02%) ⬇️
inputsystem_MacOS_6000.5 5.28% <ø> (-0.06%) ⬇️
inputsystem_MacOS_6000.5_project 77.26% <ø> (-0.02%) ⬇️
inputsystem_MacOS_6000.6 5.28% <ø> (-0.06%) ⬇️
inputsystem_MacOS_6000.6_project 77.26% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_2022.3_project 75.15% <ø> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0 5.28% <ø> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.06% <ø> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3 5.28% <ø> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.06% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.4 5.28% <ø> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.4_project 77.07% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.5 5.28% <ø> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.07% <ø> (-0.02%) ⬇️
inputsystem_Ubuntu_6000.6 5.28% <ø> (-0.06%) ⬇️
inputsystem_Ubuntu_6000.6_project 77.06% <ø> (-0.02%) ⬇️
inputsystem_Windows_2022.3 5.30% <ø> (-0.25%) ⬇️
inputsystem_Windows_2022.3_project 75.48% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.0 5.27% <ø> (-0.06%) ⬇️
inputsystem_Windows_6000.0_project 77.38% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.3 5.27% <ø> (-0.06%) ⬇️
inputsystem_Windows_6000.3_project 77.38% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.4 5.28% <ø> (-0.06%) ⬇️
inputsystem_Windows_6000.4_project 77.38% <ø> (-0.01%) ⬇️
inputsystem_Windows_6000.5 5.28% <ø> (-0.06%) ⬇️
inputsystem_Windows_6000.5_project 77.39% <ø> (+<0.01%) ⬆️
inputsystem_Windows_6000.6 5.28% <ø> (-0.06%) ⬇️
inputsystem_Windows_6000.6_project 77.39% <ø> (+<0.01%) ⬆️

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

see 3 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
Copy link
Collaborator

josepmariapujol-unity commented Mar 25, 2026

I saw this error in the CI
error: Error building Player: BuildFailedException: Please fix the following errors before building: Compatibility Mode is enabled in Project Settings, but this feature is deprecated from Unity 6.0, and the setting is hidden in Unity 6.3. To enable Compatibility Mode, go to Edit > Project Settings > Player and add URP_COMPATIBILITY_MODE to the Scripting Define Symbols.

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
Copy link
Collaborator Author

@u-pr Can you confirm that previous feedback has been addressed?

@u-pr
Copy link
Contributor

u-pr bot commented Mar 25, 2026

I have reviewed the latest changes against the previous feedback. Most of the issues have been successfully addressed, though one critical item remains outstanding.

✅ Addressed

  • Shader Name Collisions: All SimpleLit.shader files now have unique names based on their folder structure (e.g., "Samples/InGameHints/SimpleLit"), preventing registration conflicts.
  • Shadow Logic in SimpleLit: A ShadowCaster pass has been added to all SimpleLit variants. The ForwardLit pass now correctly calculates shadowCoord (using TransformWorldToShadowCoord) and passes it to UniversalFragmentPBR via InputData.
  • Triplanar Mapping Improvements: In WorldCoord Diffuse.shader, blending weights are now properly normalized, and the lighting calculation correctly incorporates both distanceAttenuation and shadowAttenuation from the main light.
  • Shader Consolidation: The Capture.shader has been refactored to use a single SubShader per pipeline by utilizing 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 (line 167) still only contains uv_MainTex. However, the surf function (lines 175–181) attempts to access IN.worldPos and IN.worldNormal. This will cause a compilation error in the Built-in Render Pipeline.

ℹ️ Note on CI Error

Regarding the error mentioned by @josepmariapujol-unity about URP_COMPATIBILITY_MODE: this project setting requirement for Unity 6.x is still present and might need to be addressed in the Project Settings if it's blocking the build.

🤖 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