Is there any OpenGL, OpenGL ES or WebGL code example on the web how 3D Collision Detection can be implemented with Shaders (preferably GLSL)?
Thank you.
GLGE has shader based collision detection. See this demo. (WASD,spacebar and mouse to move around. Notice how you collide with walls, etc.)
If you look at the source code, collision detection is handled with the code
var ray=gameScene.ray(origin,[0,0,1]);
If you follow this into glge.js
you'll see how this is implemented with a special render mode GLGE.RENDER_PICK
(which in turn uses a picking fragment shader in pkfragStr
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With