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
Gnoblar
Posts: 24
Joined: Fri Feb 16, 2018 9:32 am

scene_blend in material behaves differently from setSceneBlending

Post by Shem » Wed Jul 03, 2019 7:15 pm

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
0 x

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

Re: scene_blend in material behaves differently from setSceneBlending

Post by paroj » Wed Jul 03, 2019 11:36 pm

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

Shem
Gnoblar
Posts: 24
Joined: Fri Feb 16, 2018 9:32 am

Re: scene_blend in material behaves differently from setSceneBlending

Post by Shem » Thu Jul 04, 2019 11:44 am

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.
0 x

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

Re: scene_blend in material behaves differently from setSceneBlending

Post by paroj » Thu Jul 04, 2019 12:55 pm

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

Shem
Gnoblar
Posts: 24
Joined: Fri Feb 16, 2018 9:32 am

Re: scene_blend in material behaves differently from setSceneBlending

Post by Shem » Thu Jul 04, 2019 1:48 pm

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

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

Post Reply