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:
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:
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:
And all the shaders will be magically applied one after another when the game is rendered. Neato!
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:
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"));
Comments
Post your comment!