[fixed] Why is this render state changed twice ?

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
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

[fixed] Why is this render state changed twice ?

Post by Sylence »

I read some code of the engine's internals and I came across the Material Renderes of the DirectX9 renderer.

In CD3D9MaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER there is the following code:

Code: Select all

virtual void OnSetMaterial( ... )
{
   // ...
   pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);

   pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
   // ...
}
Can anyone explain to me why the state is first disabled and then enabled again?
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Nice find, that looks redundant. I'll move this to bug reports :)
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Guess it was a copy'n'paste error from the non-transparent material. Fixed now.
Post Reply