metauni / metaboard

Multiplayer drawing boards for sharing knowledge in Roblox.
Mozilla Public License 2.0
28 stars 6 forks source link

VR input code #69

Closed blinkybool closed 1 year ago

blinkybool commented 1 year ago

Before the VR #code session, I copy-pasted a bunch of code from the DrawingUI code so that Dan could just "plug-in" the VR input events. It's possible this could be unfolded and simplified. I don't want there to be unnecessary layers of complexity here if they obstruct future enhancements to the VR input code.

The ToolQueue is copied over from DrawingUI because there can be multiple User input's within the same frame. For example on the 120Hz iPad Pro, there can be 2-3 inputs fired while the pencil is being moved across the screen. The ToolQueue queues all the changes you want to make to the state, in particular UnverifiedDrawingTasks (see toolFunctions), and then applies them all at once before triggering self:setState(...). That's the Roact function for re-rendering based on the new state. It's pointless to do this more than once per frame because Roblox only renders the resulting instances once per frame.

However this currently serves no purpose for VR input, because the "tool moved" inputs are being detected by RunService.RenderStepped. Does that mean that curves drawn in VR are less-smooth than they could be because we're missing out on within-frame-inputs? Do multiple inputs per frame occur with UserInputService.InputChanged? What's the "input fps" of VR. I read somewhere that 90Hz is the ideal minimum for VR.

Given this, we should either make the code work with UserInputService.InputChanged, or we should stick with 1 input per frame and therefore get rid of Tool Queue for VR.

blinkybool commented 1 year ago

This was fixed in the new SurfaceCanvas in metauniOS