scene_blend in material behaves differently from setSceneBlending

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Shem
Kobold
Posts: 26
Joined: Fri Feb 16, 2018 9:32 am

scene_blend in material behaves differently from setSceneBlending

Post by Shem »

Hi all,

After many, many hours I have finally tracked down what to me appears like a bug in Ogre 1.10.
Using:
scene_blend src_alpha one_minus_src_alpha

In a material file results in a different blend from:
pPass->setSceneBlending(SBF_SOURCE_ALPHA, SBF_ONE_MINUS_SOURCE_ALPHA);

In the code. The one in the code ignores the dest alpha and the one in the file does not.

Let me know if this is recreated elsewhere or if it's an indication that I'm doing something incorrectly.

Hope this helps someone.
Shem

paroj
OGRE Team Member
OGRE Team Member
Posts: 1124
Joined: Sun Mar 30, 2014 2:51 pm
x 407
Contact:

Re: scene_blend in material behaves differently from setSceneBlending

Post by paroj »

I cannot confirm this in the code. It should behave exactly the same:
https://github.com/OGRECave/ogre/blob/v ... 1264-L1267

Shem
Kobold
Posts: 26
Joined: Fri Feb 16, 2018 9:32 am

Re: scene_blend in material behaves differently from setSceneBlending

Post by Shem »

OK. I tested and u are off course correct. The blend values are the same.
So I dug in a bit more and this is what I found. The material I was using was a clone of the material loaded from file.
If I set the scene blending on the original material (in code) before I clone it, it works fine. Doing the same thing on the clone, I see the problem I reported.
So, question is, is it me who is using the cloned material incorrectly or is it a bug in Ogre?

p.s. The clone is being loaded (Mat->load()) after I set the blending values. I also tried to load before.

paroj
OGRE Team Member
OGRE Team Member
Posts: 1124
Joined: Sun Mar 30, 2014 2:51 pm
x 407
Contact:

Re: scene_blend in material behaves differently from setSceneBlending

Post by paroj »

are you using the RTSS? If so, you need to watch out for the right technique. (use mat->getBestTechnique())

Shem
Kobold
Posts: 26
Joined: Fri Feb 16, 2018 9:32 am

Re: scene_blend in material behaves differently from setSceneBlending

Post by Shem »

Yes, I am using mat->getBestTechnique() everywhere in my code.

BTW, Thanks for making the time to help Pavel.
Shem

Post Reply