Subtract Effect Bug?

Post your own tutorials, guides and demos.

Post » Wed Oct 27, 2010 5:34 am

Hey folks,

I've hit a few snags with the 'Subtract' (PS 0 version) effect.

First, the effect has a different output in the level editor and in the actual .exe. Inside the level editor the effect renders appropriately - sprites with the 'Subtract' effect darken other sprites. In the .exe, the effect is rendered as if it was set to 'Additive' - sprites lighten other sprites.

Screenshot of this in action: Here

Secondly, the 'Subtract' effect changes how sprite opacity is handled inside/outside of the level editor. Inside the level editor, sprites with the 'Subtract' effect are rendered semi-transparent, even if their opacity = 100%. Outside of the level editor sprites with opacity = 100% are correctly rendered fully opaque.

Screenshot of this in action: Screenshot of this in action: Here

I've also attached a simple .cap file to demonstrate the effect.

If anyone sees anything obvious I'm doing wrong feel free to ridicule me. :]
B
1
G
2
Posts: 2
Reputation: 629

Post » Wed Oct 27, 2010 11:25 am

Looking at Subtract.fx change this line:
[code:245lul4c]DestBlend = INVSRCCOLOR;[/code:245lul4c]
to this:
[code:245lul4c]
DestBlend = SRCCOLOR;[/code:245lul4c]
Then it will work correctly.
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Thu Oct 28, 2010 7:09 am

Good stuff! That seems to have solved the blending issue. Opacity is still a bit weird but nothing I can't work around.
B
1
G
2
Posts: 2
Reputation: 629

Post » Sun Oct 31, 2010 4:41 pm

Rojo, you should fix the .fx for the next version of construct if you haven't already.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests