Port over Bitmap 'radial_blur' from old SFML codebase
This implementation is also heaps better than the old one as it doesn't use a (differently sized) aux texture, meaning the Bitmap discards its old texture and aquires one of same size, making reuse through the TexPool a lot more likely. It also saves on the aux texture blits and binding switches. As the setup / resource acquisition far outweighs the actual rendering cost, operation time is relatively constant no matter how many divisions are used.
This commit is contained in:
parent
088f0a2a30
commit
9f26ff9fb0
8 changed files with 151 additions and 1 deletions
|
@ -40,6 +40,7 @@
|
|||
#include "../simple.vert.xxd"
|
||||
#include "../simpleColor.vert.xxd"
|
||||
#include "../sprite.vert.xxd"
|
||||
#include "../simpleMatrix.vert.xxd"
|
||||
|
||||
|
||||
#define INIT_SHADER(vert, frag) \
|
||||
|
@ -226,6 +227,21 @@ void SimpleSpriteShader::setSpriteMat(const float value[16])
|
|||
}
|
||||
|
||||
|
||||
SimpleMatrixShader::SimpleMatrixShader()
|
||||
{
|
||||
INIT_SHADER(simpleMatrix, simpleAlpha);
|
||||
|
||||
ShaderBase::init();
|
||||
|
||||
GET_U(matrix);
|
||||
}
|
||||
|
||||
void SimpleMatrixShader::setMatrix(const float value[16])
|
||||
{
|
||||
glUniformMatrix4fv(u_matrix, 1, GL_FALSE, value);
|
||||
}
|
||||
|
||||
|
||||
TransShader::TransShader()
|
||||
{
|
||||
INIT_SHADER(simple, trans);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue