Blending textures from different passes

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

Blending textures from different passes

Post by Shem » Mon Jul 01, 2019 7:09 am

Hi all, sorry for the noob question. It's been a while since I last wrote some Ogre code.
So, I currently have a material with 1 pass per texture, so that I can apply shaders to each texture separately (maybe there's a smarter way of doing that). The problem is, blending these textures with one another doesn't produce the desired result: the top one's alpha should use the bottom one's alpha (color blending works fine). I've tried all sorts of scene blending calls (these textures are not in the same pass so I couldn't use texture blending). I can achieve the correct result if they are all in the same pass but then I can't apply shaders individually.

Thanks in advance
Shem

P.S.
I haven't added code or material because I'm currently stuck in the auto shop waiting for my car to be fixed and I can't see the code

I'm using win10 OGL 3+ Ogre version 1.10 Quadro K4000
0 x

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

Re: Blending textures from different passes

Post by Shem » Mon Jul 01, 2019 11:19 am

Oops, I think I just found a fix.

I used:
setSeparateSceneBlending(SBF_SOURCE_ALPHA, SBF_DEST_ALPHA, SBF_ZERO, SBF_ONE);

For each pass after the bottom one.

Hope this helps others
Shem
0 x

Post Reply