File tree Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ -(void)setupGlowEffectNodeTest
105
105
glowEffectNode.positionType = CCPositionTypeNormalized;
106
106
glowEffectNode.position = ccp (0.1 , 0.5 );
107
107
[glowEffectNode addChild: sampleSprite];
108
- CCEffectGlow* glowEffect = [CCEffectGlow effectWithRadius :0 .01f ];
108
+ CCEffectGlow* glowEffect = [CCEffectGlow effectWithBlurStrength :0 .02f ];
109
109
[glowEffectNode addEffect: glowEffect];
110
110
111
111
CGSize size = CGSizeMake (1.0 , 1.0 );
Original file line number Diff line number Diff line change 11
11
#if CC_ENABLE_EXPERIMENTAL_EFFECTS
12
12
@interface CCEffectGlow : CCEffect
13
13
14
- @property (nonatomic ) float blurRadius ;
14
+ @property (nonatomic ) float blurStrength ;
15
15
16
- -(id )initWithBlurRadius : (float )blurRadius ;
17
- +(id )effectWithRadius : (float )blurRadius ;
16
+ -(id )initWithbBurStrength : (float )blurStrength ;
17
+ +(id )effectWithBlurStrength : (float )blurStrength ;
18
18
19
19
@end
20
20
#endif
Original file line number Diff line number Diff line change @@ -36,21 +36,20 @@ -(id)init
36
36
return self;
37
37
}
38
38
39
-
40
- -(id )initWithBlurRadius : (float )blurRadius
39
+ -(id )initWithbBurStrength : (float )blurStrength
41
40
{
42
41
if ((self = [self init ]))
43
42
{
44
- _blurRadius = blurRadius ;
43
+ _blurStrength = blurStrength ;
45
44
return self;
46
45
}
47
46
48
47
return self;
49
48
}
50
49
51
- +(id )effectWithRadius : (float )blurRadius ;
50
+ +(id )effectWithBlurStrength : (float )blurStrength
52
51
{
53
- return [[self alloc ] initWithBlurRadius: blurRadius ];
52
+ return [[self alloc ] initWithbBurStrength: blurStrength ];
54
53
}
55
54
56
55
-(void )buildFragmentFunctions
@@ -121,12 +120,12 @@ -(void)renderPassBegin:(CCEffectRenderPass*)renderPass defaultBlock:(void (^)())
121
120
if (renderPass.renderPassId == 0 )
122
121
{
123
122
renderPass.sprite .shaderUniforms [@" u_enableGlowMap" ] = [NSNumber numberWithFloat: 0 .0f ];
124
- renderPass.sprite .shaderUniforms [@" u_blurDirection" ] = [NSValue valueWithGLKVector2: GLKVector2Make (_blurRadius , 0 .0f )];
123
+ renderPass.sprite .shaderUniforms [@" u_blurDirection" ] = [NSValue valueWithGLKVector2: GLKVector2Make (_blurStrength , 0 .0f )];
125
124
}
126
125
else if (renderPass.renderPassId == 1 )
127
126
{
128
127
renderPass.sprite .shaderUniforms [@" u_enableGlowMap" ] = [NSNumber numberWithFloat: 0 .0f ];
129
- renderPass.sprite .shaderUniforms [@" u_blurDirection" ] = [NSValue valueWithGLKVector2: GLKVector2Make (0 .0f , _blurRadius )];
128
+ renderPass.sprite .shaderUniforms [@" u_blurDirection" ] = [NSValue valueWithGLKVector2: GLKVector2Make (0 .0f , _blurStrength )];
130
129
}
131
130
else if (renderPass.renderPassId == 2 )
132
131
{
You can’t perform that action at this time.
0 commit comments