compute-toys / wgpu-compute-toy

Cross-platform compute shader engine
https://compute.toys
MIT License
119 stars 16 forks source link

default mouse position in center of screen #9

Closed munrocket closed 1 year ago

munrocket commented 1 year ago

This is very useful for camera controls.

Examples: https://compute.toys/view/31 https://compute.toys/view/459

davidar commented 1 year ago

I think shadertoy defaults to zero so you can detect when the mouse has been used (eg some shaders will disable automatic rotation when that happens). Not sure if anyone is relying on that behaviour here yet though? Might just have to check the published shaders first to confirm

munrocket commented 1 year ago

Checked around 20 examples and no one using it.

But I found example where a guy commented mouse at all, because initialization not in center of a screen. https://compute.toys/view/80

munrocket commented 1 year ago

Here something complicated with mouse exactly for that reason I guess. https://compute.toys/view/256 https://compute.toys/view/248 I think they will be ok after patch.

davidar commented 1 year ago

Ok cool, thanks for checking!