Skip to content

Make packaging more solid#29

Merged
freezy merged 27 commits into
masterfrom
dev
Jun 26, 2026
Merged

Make packaging more solid#29
freezy merged 27 commits into
masterfrom
dev

Conversation

@freezy

@freezy freezy commented Jun 25, 2026

Copy link
Copy Markdown
Member

This PR adds the HDRP side of the new VPE packaging pipeline. It teaches the HDRP package how to export portable material profiles, restore them at runtime from .vpe packages, cook/repack HDRP textures, generate package screenshots, and apply VPE graphics settings to HDRP scenes.

  • Added HDRP material translation for .vpe export, including renderer state, HDRP hints, texture payloads, and shader-specific material profiles.
  • Added runtime HDRP material resolution from portable VPE material profiles.
  • Added template materials for opaque, transparent, translucent, decal, and fabric/silk HDRP material reconstruction.
  • Added runtime material resolver bootstrap and glTF material generator integration.
  • Added HDRP texture cooking support, including GPU-ready payloads, normal-map packing, 16-bit PNG downconversion, and texture blob loading improvements.
  • Added HDRP screenshot environment support for package screenshot generation.
  • Added runtime HDRP graphics application for anti-aliasing, SSR, SSAO, SSGI/RTGI, and bloom.
  • Updated shader graph property names to semantic VPE names for rubber and metal materials.
  • Added/updated diffusion profiles, measured material mappings, translucent material support, and fallback behavior when HDRP/Lit lookup is unavailable.
  • Added a debug collider shader.

freezy added 25 commits April 25, 2026 16:16
Side-channel every captured texture as a block-compressed payload
(BC7 for color/mask, DXT5 for normals) with mips baked at export
time. Runtime uploads raw bytes instead of decoding PNGs and
re-compressing, and normal maps ship in HDRP's AG layout so no
runtime repack is needed. The glTF clone drops every texture from
captured materials so glTFast no longer re-encodes hundreds of MB
of PNGs into table.glb.

Also honor the table's HDRI cubemap and exposure during package
screenshots via a top-priority temporary volume override, and make
the directional light optional.
Move BC7/DXT5 cooking and normal-map repacking out of the export
path: the package now carries the original PNG/JPG source bytes
(or a lossless PNG fallback) and the player cooks GPU-ready
payloads into its local cache at load time.

Add an editor-side .vpe material importer that drives the shared
HdrpMaterialResolver against freshly imported texture assets and
persists the resulting materials as .mat files, marking normal
maps as DXT5nm so the resolver doesn't re-pack them.
Renames HdrpMaterialV1* importer/translator/encoder to drop the V1
suffix now that the resolver targets the v2 portable material schema
(legacy v1 payloads are upgraded before reaching it). HDRP-only Lit
fields (TexWorldScale, InvTilingScale, GeometricSpecularAa, SpecularAA
thresholds, SupportDecals, RayTracing, EmissiveExposureWeight) move
from VpeMaterialProfile.Lit onto a nested VpeHdrpLitHints object so
the cross-pipeline profile stays renderer-agnostic.

Also threads a resolveNode callback through the editor importer for
per-node material application.
The player cook produces 8-bit BC7 regardless, so the extra precision
roughly doubled payload size and made 16-bit decode the cook's
main-thread bottleneck (notably the 50 MB cabinet normals).
Replaces the Unity LoadImage+EncodeToPNG path, which is single-threaded
and slower. libvips is native, thread-safe, and produces the same
high-byte 16->8 downconvert.
Record file-path or inline-byte sources during the main-thread walk
instead of reading and downconverting PNGs inline. A separate loader
(VpeTextureBlobLoader) consumes the sources in parallel, moving the
disk I/O and 16-bit PNG → 8-bit re-encode off the main thread.

File-name uniqueness now uses a dedicated reservation set since the
blob dictionary no longer exists at name-allocation time.
Add HdrpGraphicsApplier, registered before scene load, that maps the
host app's VpeGraphicsSettings onto the main camera's anti-aliasing
mode and the active global Volume's SSR, SSAO, bloom, and GI effects
(including ray-traced reflections and GI tracing modes).

Reference Unity.RenderPipelines.Core.Runtime from the HDRP asmdef so
the Volume APIs resolve.
Translate and rebuild HDRP/Fabric/* materials via a new fabric-silk
template, capturing thread/fuzz properties and the supporting clear-coat,
specular-color, blend-mode and Z-test state on the underlying lit
profile so cloth materials survive a round trip.

Replace the gltFast HDRP material generator with one that falls back to
stock HDRP/Lit, since gltFast's bundled shadergraphs ship broken
ray-tracing passes that fail to compile in player builds, and the
imported materials are transient placeholders the resolver swaps anyway.

Tighten CreateTextureFreeClone to walk the serialized TexEnv list and
verify each property is actually a texture on the shader, so fabric and
other non-Lit templates don't trip on stale or non-texture properties.
Shader.Find("HDRP/Lit") can return null during very early gltFast
init before HDRP registers the shader, which caused materials to
silently fall through to the stripped shadergraph and emit a
"shader missing" warning. Load the shipped VpeLitOpaqueTemplate as
a fallback so the same HDRP/Lit shader is always resolved.
@freezy freezy self-assigned this Jun 25, 2026
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown

Too many files changed for review. (124 files found, 100 file limit)

freezy added 2 commits June 26, 2026 08:21
Bump unity to 6000.5.0f1 and the high-definition render
pipeline dependencies from 17.0.3 to 17.5.0.

Also switch the diffusion profile cache key in
HdrpMaterialResolver to UnityObjectId.Get instead of
GetInstanceID.
Add a packing/signing step using the Unity Package Manager CLI so
the published package is signed with the org service account, then
publish the resulting signed tarball instead of running a bare
`npm publish`.

Also bump action versions: actions/checkout v2 -> v5 and
peter-evans/repository-dispatch v1 -> v4.
@freezy freezy merged commit 6e65d21 into master Jun 26, 2026
4 checks passed
@freezy freezy deleted the dev branch June 26, 2026 06:47
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.

1 participant