Conversation
Introduce a dedicated VisualPinball.Engine.Unity.Urp.Editor assembly and move MaterialAdapter and PrefabProvider into it. Their IMaterialAdapter and IPrefabProvider members are now exposed through a new UniversalRenderPipelineConverter (IRenderPipelineConverter) rather than the runtime UniversalRenderPipeline, keeping editor-only authoring concerns out of the runtime assembly.
Turn portable VpeMaterialProfiles from a .vpe package into live URP/Lit materials in the Player, replacing glTFast placeholders. This is the URP counterpart of HdrpMaterialResolver: handle base color/map, metallic/smoothness, HDRP-style mask map split into URP metallic-gloss + occlusion, normal map, emissive, and surface/blend state. Shadergraph types and decals fall back to a plain lit build or are left to glTFast. Register the resolver before scene load via a bootstrap, mirroring the HDRP package.
URP computes smoothness as mask.a * _Smoothness, while HDRP uses lerp(remapMin, remapMax, mask.a) and ignores the scalar when a mask is set. Set _Smoothness to the remap max so mask.a drives smoothness fully instead of being scaled down by the mask-irrelevant scalar.
Map authored HDRP-physical values into URP's unitless lighting via a single ReferenceEv100 scale (UrpPhysicalUnits): emissives from nits and punctual/directional lights from candela/lux, the latter registered as a VpeLightUnitAdjuster at bootstrap. Implement emissive color/intensity on the URP MaterialConverter using _EmissionColor (chroma × intensity), replacing the earlier no-op stubs so LightComponent can drive faux bulbs and inserts. Add insert material support: transmittance/base color becomes the body color and the lamp glow becomes emission driven at runtime, approximating HDRP translucency that URP lacks.
Handle VpeMaterialTypes.Decal by rendering the decal mesh as an alpha-blended lit overlay, since URP's decal system only supports projectors. The base-map alpha drives where the decal applies, with HDRP's Decal Blend folded into the base alpha and mask/normal map reuse mirroring BuildLit.
Bump ReferenceEv100 to 5 (A/B'd against the HDRP player under a neutral HDRI) and add a separate EmissiveExtraEv stop so bloom-hot faux bulbs match HDRP while GI lamps stay in line. LightScale now derives from ReferenceEv100 alone, excluding the emissive-only stop. Add LightRangeMultiplier to widen point/spot ranges, letting the overlapping direct pools stand in for HDRP's missing SSGI bounce while still following lamp state.
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.
No description provided.