We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b4fd3f5 + 5553f06 commit cc2300bCopy full SHA for cc2300b
cocos2d/CCEffectContrast.m
@@ -54,7 +54,8 @@ -(void)buildFragmentFunctions
54
CCEffectFunctionInput *input = [[CCEffectFunctionInput alloc] initWithType:@"vec4" name:@"inputValue" initialSnippet:CCEffectDefaultInitialInputSnippet snippet:CCEffectDefaultInputSnippet];
55
56
NSString* effectBody = CC_GLSL(
57
- return vec4(((inputValue.rgb - vec3(0.5)) * vec3(u_contrast) + vec3(0.5)), inputValue.a);
+ vec3 offset = vec3(0.5) * inputValue.a;
58
+ return vec4(((inputValue.rgb - offset) * vec3(u_contrast) + offset), inputValue.a);
59
);
60
61
CCEffectFunction* fragmentFunction = [[CCEffectFunction alloc] initWithName:@"contrastEffect" body:effectBody inputs:@[input] returnType:@"vec4"];
0 commit comments