0 Members and 1 Guest are viewing this topic.
Would that work?
Or is there another way to apply a global shader to a rendertexture?
Main question is how can I pass the Rendertexture to the shader
Other than what?
Other than drawing a rectangle over the texture after everything else is drawn with blendmode set to None and apply a shader to the rectangle. The rendertextures texture is passed to the shader so you can modify it there.
I get a error saying "parameter "texture" not found in shader" when I call shader.setParameter("texture", rendertexture.getTexture()); although I declared uniform sampler2D texture; in the shader.
So that is the only way how i can fade out a render-texture? Using two textures and a shader
By the way: what exactly do you me by a render-texture can't be source and destination. If I apply the shader to the rectangle and draw it onto the render-texture, the rectangle is the source and the render-texture the destination. the shader simply uses information from the render-texture to compute it's color.