Unity LTS 2022.3.50f1
HDRP 14.0.11
Implemented user-drawn spray using decal projector
Issue:
In Editor decal projector works as expected - being clipped by geometry, drawn on all intended surfaces.
In Windows Build unintended behavior starts appearing - decal seen thru objects (i.e. table), not drawn on all intended surfaces.
Link 1 - intended behavior in editor:
Link 2 - issue in windows build:
Details:
Problem seemed to be material based or material adjacent.
Starting ENV of a scene does not change, but scene has a bunch of generated rooms far from origin (i.e. 3000x, 0y, 3000z coords). Player camera far plane limited to 100 (0.2 … 100).
I discovered, that built player dont see sprays created in generated rooms (but see sprays in starting ENV). This problem appears only in builds, as i was able to host on build and connect as client on editor and still saw all sprays in editor-client.
I made a test cube with material A (Standard lit HDRP shader). [Decals layer: 1], [game object layer: Terrain]. I copy this cube 4 times in scene, copy material A 4 times and slightly change tiling (to see difference). Original material DOES NOT receive decals, but copy DOES receive decals. Original material A is used in all rooms.
If i now assign this copy material to rooms - this copy material starts acting like original - no longer receives decals.
I tried changing Atlas size in Quality HDRP settings (4096 → 8kk)
I tried changing Draw Distance (Matching camera 100 → 1000 → 8000)
I tried disabling Decal Layers
I tried making simplest decal in shader graph (sample texture multiplied by color)
I tried changing camera far plane (100 → 5000)
I tried changing shader stripping (Strip all → strip unused → keep all)
I tried adding HDRP/Decal shader to always include shaders
Any of those did not shown any effect on issue.