Skip to content

Commit 325983b

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
2 parents 50f7d6f + cc2300b commit 325983b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cocos2d/CCEffectContrast.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ -(void)buildFragmentFunctions
5454
CCEffectFunctionInput *input = [[CCEffectFunctionInput alloc] initWithType:@"vec4" name:@"inputValue" initialSnippet:CCEffectDefaultInitialInputSnippet snippet:CCEffectDefaultInputSnippet];
5555

5656
NSString* effectBody = CC_GLSL(
57-
return vec4(((inputValue.rgb - vec3(0.5)) * vec3(u_contrast) + vec3(0.5)), inputValue.a);
57+
vec3 offset = vec3(0.5) * inputValue.a;
58+
return vec4(((inputValue.rgb - offset) * vec3(u_contrast) + offset), inputValue.a);
5859
);
5960

6061
CCEffectFunction* fragmentFunction = [[CCEffectFunction alloc] initWithName:@"contrastEffect" body:effectBody inputs:@[input] returnType:@"vec4"];

0 commit comments

Comments
 (0)