You are not logged in.
Pages: 1
As the title says, I got a wild hair idea about using GMS shader to run a pixel precise collision check. What i'm asking you Xot is do think it's possible? I suck as shaders... But the perhaps that you could use x/y against u/v with relative position offsets checks between the sprites in question to yield a pixel accurate check with shader type parallel execution that would hopefully kick the crap out of the existing serial single thread runner method.
Offline
I do not think there would be an effective way to communicate the collision back to the CPU.
A pixel shader could conceivably draw collision areas to a render target using the alpha of a texture as input. But once you've sent the operation to the GPU, it's difficult/slow to get the data back. Your only options for reading the data would be scanning the area with surface_getpixel() or creating a global sprite and colliding with that. If you are doing that, there would be no point in using a pixel shader in the first place. Either method would be exceedingly slow.
I believe intelligent, limited collision checks are the best option. Use precise collision only when absolutely necessary.
Abusing forum power since 1986.
Offline
Pages: 1