Open folgerhu opened 9 years ago
@yangws please take a look at it.
i try to fix this bug by set cameramask, Camera* visitCamera = Camera::getVisitingCameraEx(); Camera::setVisitingCamera(_activeCamera); _rendTexture->setKeepMatrix(true); _rendTexture->setCameraMask(0x2);
_modelDrawNode->visit();
_rendTexture->end();
_rendTexture->saveToFile(fileNanme);
Director::getInstance()->getRenderer()->render();
Camera::setVisitingCamera(visitCamera);
it can work for draw3d. but for sprite3d, it is failed, there is no 3dmodel displayed in picture file . i find it is caused by meshcammand. if not use meshcammand and use custom render command like this: CustomCommand &cc = std::get<2>(effect); cc.func = CC_CALLBACK_0(MyEffect3D::draw, std::get<1>(effect), transform); renderer->addCommand(&cc); it can work. how to fixed this bug?
I fix this. it cause by commend type. need to add somefunction. set rendertexture begin and end commend type to 3D
Cocos 2d-x v3.6
The saved image is black.