Damus
Rune Skovbo Johansen profile picture
Rune Skovbo Johansen
@Rune Skovbo Johansen
I tried adding a discard to the terrain shader based on distance to the camera, to achieve a clipping sphere around the camera instead of a clipping plane. The point being to avoid the mountain silhouettes wobbling when merely rotating the camera.

It works fine in the editor in Play Mode, but fails making a build, with an error of
"internal error: argument pulled into unrelated predicate"

No idea what to make of that.
2
Doug Binks · 9w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpq0f7e9qey4t9vv0jqea92zgg7m05ghlx38c7w08yxmnrda63k07ts824e67 I think this is related to HLSL optimizer having issues with code after a discard. I think you can get around this by using if() { discard; } else {rest of code} or by discarding at the ...
Aras Pranckevičius · 9w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpq0f7e9qey4t9vv0jqea92zgg7m05ghlx38c7w08yxmnrda63k07ts824e67 no idea why that would happen, but FYI mere presence of discard in a pixel shader makes it run quite a bit slower than a always-known-to-be-opaque shader. Maybe doing it at vertex level...