25 #include <OpenGLFramework/SpecializedBatches/PlainPerPixelProcessing.hh>
26 #include <OpenGLFramework/Utils/Primitives.hh>
27 #include <OpenGLFramework/Base/glfUniformNotFoundException.hh>
34 basicInit_(false), initialized_(false), numInputTextures_(0),
36 externalUniformsChanged_(false)
62 SetTextures(
const std::vector<BIAS::glfTexture2D*>& inputTextures)
64 for(
unsigned int i=0; i<inputTextures.size(); i++)
75 std::list<BIAS::glfTexture2D*>::iterator it = inputTextures.begin();
76 std::list<BIAS::glfTexture2D*>::iterator itEnd = inputTextures.end();
78 for( ;it!=itEnd; it++ ) {
92 static_cast<int>(height));
123 for(std::map<std::string, float>::iterator it =
uniformsFloat_.begin();
127 for(std::map<std::string, int>::iterator it =
uniformsInt_.begin();
void SetFragmentShaderFromFile(const std::string &fileName)
std::map< std::string, int > uniformsInt_
void SetVertexBuffer(const glfVertexBuffer *vertexBuffer)
Sets the vertex buffer.
void SetModelViewMatrix(const glfMatrix *matrix)
Sets the modelview matrix.
Defines the usage of the depth buffer.
void Create()
Creates the shader program.
void SetUniform(const std::string &varName, float value)
void Link()
Links the attached shaders.
void AttachShader(const glfShader &shader)
Attaches a shader to the program.
void CreateFromFile(GLenum type, const std::string &fileName)
Creates the shader from GLSL source code loaded from a file.
void SetDepthBufferMode(const glfDepthBufferMode *depthBufferMode)
Sets the depth buffer mode.
void Create(GLenum type)
Creates the shader without the GLSL source code, use other Create() methods to upload source afterwar...
void Draw()
Draws the batch.
void SetTexture(BIAS::glfTexture2D *inputTexture)
unsigned int numInputTextures_
PlainPerPixelProcessing(bool flip=false)
void SetOutputSize(unsigned int width, unsigned int height)
Returns the currently set texture set;.
BIAS::glfShaderProgram shaderProgram_
void SetFlip(bool flip=true)
void SetViewport(const glfViewport *viewport)
Sets the viewport.
void SetFragmentShaderFromString(const std::string &source)
void SetUniform(const std::string &name, float val)
void SetTexture(const glfTexture *texture, int textureUnit)
Sets the texture of a texture unit.
BIAS::glfDepthBufferMode depthTest_
void InitPrimitiveData_()
BIAS::glfMatrix ProjectionMatrix_
void SetRenderTarget(const glfRenderTarget *renderTarget)
Sets the render target.
glfDepthBufferMode & GetDepthBufferMode()
static void PlainQuad2DWithTexture2D(BIAS::glfVertexBuffer &vb, BIAS::glfElementBuffer &eb, bool flip=false)
Vertex Order: 3–2 | | 0–1 .
BIAS::glfElementBuffer elements_
void SetShaderProgram(const glfShaderProgram *shaderProgram)
Sets the shader program.
void SetSize(int width, int height)
Sets the size of the viewport in pixel coordinates.
void SetProjectionMatrix(const glfMatrix *matrix)
Sets the projection matrix.
void SetRenderTarget(BIAS::glfRenderTarget *rt)
void ReleaseTextures(unsigned int fromIndex)
Releases texture including the matrix associated with the argument index.
void SetElementBuffer(const glfElementBuffer *elementBuffer)
Sets the element buffer.
void InitVertexTransformation_()
bool externalUniformsChanged_
BIAS::glfMatrix ModelViewMatrix_
void SetTextures(const std::vector< BIAS::glfTexture2D * > &inputTextures)
Adds textures in their respective index order and assigns them the default names img<index> in the sh...
std::map< std::string, float > uniformsFloat_
BIAS::glfViewport viewport_
void SetSamplerNames(const std::vector< std::string > &samplerNames)
Interface for render targets.
BIAS::glfShader fragmentShader_
BIAS::glfVertexBuffer vertices_
std::vector< std::string > samplerNames_