stalgiag / p5.xr

a library that helps turn p5.js sketches into immersive experiences using WebXR
GNU Lesser General Public License v2.1
117 stars 25 forks source link

frameRate, frameCount and calculate documentation #241

Open TiborUdvari opened 1 month ago

TiborUdvari commented 1 month ago

There are some differences that are not immediately clear to people that want to convert a "standard" sketch to an xr sketch.

The obvious effect is that sketches will run faster than expected. Converting from a 60 fps sketch would make the draw call get called 180 times ( 90 fps * 2 eyes ) on a headset device for instance.

I'll document this and also think about adding examples that uses the frame between times, similar to time.deltaTime in Unity. This would allow for a quicker transition of a sketch than using a separate calculate function, because it would mean less refactoring.

I haven't completely though all this through just yet, but some things that I think need to be addressed.