ColorMask applied to clear operations in OpenGL

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Timo
Posts: 7
Joined: Fri Jan 29, 2010 9:37 am

ColorMask applied to clear operations in OpenGL

Post by Timo »

For example if you have a material set with colormask ECP_ALPHA, and you call beginScene(), setRenderTarget() etc, which by default clear the buffer, they will only clear the alpha channel.

Perhaps this is desired behavior, but even if you set a new material with colormask ECP_ALL before the call to beginScene() the new material is not used for that. It's only applied when something is actually rendered.

Code: Select all

while(dev->run()) {
	drv->beginScene(); //only clears alpha channel

	...

	SMaterial mat;
	mat.ColorMask = ECP_ALPHA;
	drv->setMaterial(mat);

	renderSomething();

	mat.ColorMask = ECP_ALL;  //this colormask isn't used for beginScene
	drv->setMaterial(mat);

	drv->endScene();
}
This happens in 1.6.1 and based on a quick look at the source code in 1.7 too.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, interesting. I thought I tested that before. But I guess I need to check the latest code.
Post Reply