Hi everyone,
I'm trying to write a depth mapping shader for a 2D game, inspired from this famous video.
Following the author's explanation on his blog, I was able to reproduce the desired effect in a test application.
Now I'm trying to include it in my actual game, which uses spritesheets and tilesets. What I really don't understand is: what happens inside the shader when you draw with SpriteBatch using a source rectangle? Will the TexCoord be relative to the whole spritesheet? Or just to the actual source rectangle?
Since I also need to pass other textures to the same shader (normal / height maps), and they're all spritesheets of the same size, do I need to scale/adjust the texture coordinates to the source rectangle, or will SpriteBatch take care of everything?
Sorry if I'm not clear or if there's a mistake somewhere, English is not my language ^^'