I moved to a new URL! Check it out!

Dev Log: Shader Town

Dev Log: Shader Town
I'm back in Shader Town in my framework! Right now I'm just finishing up getting my RenderTexture classes fixed up to support multiple shaders automatically. This is helpful for those post processing effects that require multiple passes. Here's what it looked like after my first attempt to get the shaders working automatically:

Image


And then I realized that I was doing a lot of things wrong with SFML's RenderStates class, as well as not calling Display() on the render texture before rendering it again. After I fixed up some of that stuff, it ended up looking like this:

Image


Much better! Yeah, that is what it's supposed to look like. What I'm doing here is just applying a crapload of shaders to the game's main render texture. So in code all this is right now is:
game.Surface.AddShader(new Shader(ShaderType.Fragment, "assets/blur.frag"));
game.Surface.AddShader(new Shader(ShaderType.Fragment, "assets/blur.frag"));
game.Surface.AddShader(new Shader(ShaderType.Fragment, "assets/shader.frag"));
game.Surface.AddShader(new Shader(ShaderType.Fragment, "assets/blur.frag"));
game.Surface.AddShader(new Shader(ShaderType.Fragment, "assets/blur.frag"));
game.Surface.AddShader(new Shader(ShaderType.Fragment, "assets/blur.frag"));
game.Surface.AddShader(new Shader(ShaderType.Fragment, "assets/blur.frag"));
And all the shaders will be magically applied one after another when the game is rendered. Neato!

Comments

Ivan
Ivan
It would be nice to push some examples along the framework :)
Posted October 11th 2013 10:34 AM
Kyle
Kyle
Yup, as soon as I finish some examples they will be available along with the framework ;D
Posted October 11th 2013 2:55 PM
new comment!

Post your comment!

Name
Email
Comment