[effect] Opacity

Share your Construct 2 effect files

Post » Mon Dec 12, 2016 9:10 pm

@digitalsoapbox

Just included tint inside this shader this do exactly the same fx (opacity+tint) at the same time; tint+opacity combined in one shader;
Can you download and test this one again ?
Btw i have 60fps with chrome in my 3d starsfield example;
http://gigatron3k.free.fr/html5/C2/FX/opacity.rar
B
69
S
24
G
29
Posts: 829
Reputation: 22,751

Post » Mon Dec 12, 2016 9:27 pm

Gigatron wrote:@digitalsoapbox

Just included tint inside this shader this do exactly the same fx (opacity+tint) at the same time; tint+opacity combined in one shader;
Can you download and test this one again ?
Btw i have 60fps with chrome in my 3d starsfield example;
http://gigatron3k.free.fr/html5/C2/FX/opacity.rar


Yes, works perfectly. Is there something in the default tint shader messing up the behavior of your opacity shader?
B
88
S
47
G
25
Posts: 535
Reputation: 21,802

Post » Mon Dec 12, 2016 9:46 pm

Really.. Tint is very basic shader just modulate red,green,blue component of texture.. the opacity is easy too;
The only difference when you combine 2 shaders in the project this mean 2 program or 2 shader program running at the same time.. this can cause framrate drop...
B
69
S
24
G
29
Posts: 829
Reputation: 22,751

Post » Mon Dec 12, 2016 10:08 pm

That makes sense. Thanks for the info. I still wonder why the results are so different. Maybe C2's renderer composites the results separately? Seems like a bug in the way shaders are handled. Or if not a bug an oversight, because this could potentially affect any object that uses more than one shader: tint + additive, blur + noise, etc.
B
88
S
47
G
25
Posts: 535
Reputation: 21,802

Post » Tue Dec 13, 2016 12:41 am

@Gigatron

Just noticed it seems to be ignoring the sprite's alpha channel - try your demo against a blue background.
B
88
S
47
G
25
Posts: 535
Reputation: 21,802

Post » Tue Dec 13, 2016 11:54 am

digitalsoapbox wrote:@Gigatron

Just noticed it seems to be ignoring the sprite's alpha channel - try your demo against a blue background.


I forgot something sure , alpha channel ... but try to download again please ...
B
69
S
24
G
29
Posts: 829
Reputation: 22,751

Post » Tue Dec 13, 2016 5:00 pm

Gigatron wrote:
digitalsoapbox wrote:@Gigatron

Just noticed it seems to be ignoring the sprite's alpha channel - try your demo against a blue background.


I forgot something sure , alpha channel ... but try to download again please ...


Seems to be okay now. Will play with it a big more. Can you make the tint use a range of 0-100 like the standard tint effect, rather than 0-1?
B
88
S
47
G
25
Posts: 535
Reputation: 21,802

Post » Tue Dec 13, 2016 5:21 pm

@digitalsoapbox
Ok .. percent instead of float in xml file ;
http://gigatron3k.free.fr/html5/C2/FX/opacity.rar
B
69
S
24
G
29
Posts: 829
Reputation: 22,751

Post » Tue Dec 13, 2016 7:32 pm

Gigatron wrote:@digitalsoapbox
Ok .. percent instead of float in xml file ;
http://gigatron3k.free.fr/html5/C2/FX/opacity.rar


Thanks. Is Opacity from 0 to 1 or 0-100? The default value is 1 but in your example .capx it's set to 100, so I just want to make sure.
B
88
S
47
G
25
Posts: 535
Reputation: 21,802

Post » Tue Dec 13, 2016 8:42 pm

digitalsoapbox wrote:
Gigatron wrote:@digitalsoapbox
Ok .. percent instead of float in xml file ;
http://gigatron3k.free.fr/html5/C2/FX/opacity.rar


Thanks. Is Opacity from 0 to 1 or 0-100? The default value is 1 but in your example .capx it's set to 100, so I just want to make sure.

In fact the value is between 0-1 but the display is multiplied by 100... this is why we use percent instead of float.
Opacity in display is 0-100 , yes.
B
69
S
24
G
29
Posts: 829
Reputation: 22,751

Previous

Return to Effects

Who is online

Users browsing this forum: No registered users and 0 guests