SFML community forums
Help => Graphics => Topic started by: dydya-stepa on November 30, 2011, 04:00:04 pm
-
i'm rendering a sprite into window like this:
window.Draw(sprite, shader)
My window's size is 800*600 but my sprite's size is 1024*1024. I'm rendering it with some offset so only portion is shown. The shader (blur) needs texel size which is 1 / width for horizontal and 1 / height per vertical.
So the question is what the width and height should be equal to?
-
It must be equal to the sprite's texture width/height.
shader.SetParameter("width", sprite.GetTexture()->GetWidth());
shader.SetParameter("height", sprite.GetTexture()->GetHeight());