2012-01-24 9 views
4

나는 비 ccos2d-iphone 최신 베타 버전을 사용하고 있습니다.CCLiquid가 내 화면을 검은 색으로 렌더링합니다.

최근에 나는 이것을 찾았습니다 : http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:effects, 그리고 저는 게임에서 약간의 물 효과에 대해 CCLquid 나 CCWaves에 관심이있었습니다.

그러나 CCLiquid 액션을 내 CCSprite에 적용하면 스프라이트 자체를 제외한 모든 것이 검정색으로 렌더링됩니다. 정확히는 아닙니다. 액션의 진폭을 증가 시켰을 때 실제로는 실제로 CCSprite 아래에 생성 된 화면의 크기가 검은 색 배경임을 알게되었습니다 (그런 배경도 "흔들 렸습니다").

[[CCDirector sharedDirector] setDepthBufferFormat:kDepthBuffer16]; 

그러나 kDepthBuffer16 어쨌든 인식되지 않습니다 : 이것은 3D 액션 (적어도 어떤 3D 접미사)는 아니지만

, 나는 해당 페이지의 팁을 따라 내 위임에 넣어하기로 결정했다.

아이디어가 있으십니까?

편집 : 언급할만한 가치가있는 점은 내 스프라이트가 CCAnimate로 애니메이션되고 있다는 것입니다.

+0

나는 일반 바닐라 스프라이트, 애니메이션이없는 경우와 동일한 효과를 얻습니다. – YvesLeBorg

답변

2

버전 1.0.1에서는 나를 위해 고정되었습니다 (정적 이미지, 애니메이션 없음). AppDelegate (내 경우) :

- (void) applicationDidFinishLaunching:(UIApplication*)application 
{ 
    // Init the window 

    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    if(! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink]) { 
     [CCDirector setDirectorType:kCCDirectorTypeDefault]; 
    } 

    CCDirector *director = [CCDirector sharedDirector]; 

    // Init the View Controller 

    viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; 
    viewController.wantsFullScreenLayout = YES; 

    // Create the EAGLView manually 

    EAGLView* glView = [EAGLView viewWithFrame:[window bounds] 
            pixelFormat:kEAGLColorFormatRGBA8 
            depthFormat:GL_DEPTH_COMPONENT16_OES 
          preserveBackbuffer:NO 
            sharegroup:nil 
           multiSampling:NO 
           numberOfSamples:0]; 


    // attach the openglView to the director 

    [director setOpenGLView:glView]; 

    // ... etc here 

} 
관련 문제