Hi there,
I'm new here and maybe the problem that I discribe is allready resolved in another thread...
Okay, my problem:
I want to use 3 Textures in my shader and these textures I want to mix them but I don't know what I have to do to get this working.
Here is my code so far (c++):
void AClass::init(unsigned int wndWidth, unsigned int wndHeight)
{
if (!mOffScreenTarget.create(wndWidth, wndHeight))
return;
mOffScreenTarget.setSmooth(true);
mSchriftTex.loadFromFile("IntroGrafiken\\Logo.png");
mSchriftSprite.setTexture(mSchriftTex);
mRauschenSoftTex.loadFromFile("IntroGrafiken\\Rauschen.png");
mRauschenSoftSprite.setTexture(mRauschenSoftTex);
mRauschenHardTex.loadFromFile("IntroGrafiken\\20_rauschen.gif");
mRauschenHardSprite.setTexture(mRauschenHardTex);
mShader.loadFromFile("IntroShader\\IntroShader.vert","IntroShader\\IntroShader.frag");
mShader.setParameter("schriftZugTextureSampler", mSchriftTex);
mShader.setParameter("rauschSoftTextureSampler", mRauschenSoftTex);
mShader.setParameter("rauscheHardTextureSampler", mRauschenHardTex);
}
and my draw-function:
sf::RenderStates state = sf::RenderStates::Default;
state.shader = &mShader;
mOffScreenTarget.clear(sf::Color::White);
mOffScreenTarget.draw(mSchriftSprite, state);
mOffScreenTarget.draw(mRauschenHardSprite, state);
mOffScreenTarget.draw(mRauschenSoftSprite, state);
mOffScreenTarget.display();
window.draw(sf::Sprite(mOffScreenTarget.getTexture()));
But this don't work. With this code all Sprites get drawn simple. But I want to mix them.
The shader code works I think...but I don't know what I have to do to get what I want!!!
Okay, I hope so you understand what I want and I hope my english isn't soo bad^^
Maybe you can post here some code...cause that says often more to me
Best regards
JoseMan