Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: ShaderChain Project  (Read 1640 times)

0 Members and 1 Guest are viewing this topic.

Hanmac

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
ShaderChain Project
« on: August 07, 2013, 06:04:25 pm »
currently i planing an ShaderChain class what uses RenderTexture and Sprites to draw an chain of Shaders into an output (Render)Texture, but i also want to publish the code where so other sfml users can use it, or maybe intigrate it into sfml itself if is good.

there are a list of fuctions that are currently available, others may follow:

  • ShaderChain
    • Copied from RenderTarget, bad that i cant inherit from an interface
    • getSize() returns the size of the first RenderTexture
    • clear(Colour) clears the first RenderTexture
    • draw(Drawable,RenderStates) draws other drawable into the first RenderTexture
    • getTexture returns the texture of the last RenderTexture
    • Inherit from Drawable
    • draw(RenderTarget,RenderStates) draws the ShaderChainDrawableInstance stored in this chain and it makes sure that the ShaderChain is updated before the Drawable inside the ShaderChainDrawableInstance is drawn (i mean that the content is drawn from the first RenderTexture to the last, it only does it when needed)
  • ShaderChainShaderInstance  holds the Shader objects with an name, so they can disabled or removed later
  • ShaderChainDrawableInstance  combines ShaderChain with an Drawable object, it

critic and ideas are wanted