Azure / azure-remote-rendering

SDK and samples for Azure Remote Rendering
MIT License
107 stars 39 forks source link

[Remote rendering problem] No hit results from RayCastQueryResult.Hits is inconsistent between platforms (Quest and Windows) #116

Closed WikkidEdd closed 8 months ago

WikkidEdd commented 8 months ago

SDK Version 1.2.6

We've recently updated the RemoteFocusProviderNoCollider to properly support the teleport pointer. This worked fine in Editor, but didn't return any hits when running on Quest. After some debugging, we tracked it down to some extra processing hits we added.

The cause was that RayCastQueryResult.Hits returns null for no hits on Quest and an empty array on Windows. The comment on the property implies that it should be a at least and empty array and not null.

"A (potentially empty) array of intersections that the raycast encountered."

It would great if this could be made consistent between platforms.

(Apologies if it's already been fixed in a newer version of the SDK, upgrading to the latest is on our backlog)

jloehr commented 8 months ago

Hi @WikkidEdd,

Yes, this has already been fixed with version 1.2.12.

Starting with that versions all Unity APIs should return an empty Array/List instead of null. The only two exceptions are RenderingSessionPropertiesArrayResult.SessionProperties and ConversionPropertiesArrayResult.Conversions, which may still be returning null.

I highly recommend updating to version 1.2.12 or newer, and use the new preallocation APIs for retrieving the results. They greatly reduce the pressure on the GC compared to the regular APIs.

WikkidEdd commented 8 months ago

Ok, great. Will do!