Open flamefox opened 9 years ago
make a function and create a rendertextue
renderTexture = RenderTexture::create(100, 100, Texture2D::PixelFormat::RGBA8888); renderTexture->retain();
then use it at sprite3d
this->setVisible(true); renderTexture->setAutoDraw(false); auto renderer = cocos2d::Director::getInstance()->getRenderer(); //init the visibleCamera cocos2d::Director::getInstance()->getRunningScene()->InitVisCamera(this->getCameraMask()); renderTexture->beginWithClear(0.0f, 0.0f, 0.0f, 0.0f, 1.0f); this->visit(renderer, this->getNodeToWorldTransform(), 0); renderTexture->end(); //render it renderer->render(); cocos2d::Director::getInstance()->getRunningScene()->ClearVisCamera(); this->setVisible(false); return renderTexture->getSprite();
if I modify the code of meshcommand _is3d to false and set the
flags &= ~FLAGS_RENDER_AS_3D; meshCommand.set3D(false);
it show with no depthtest,
Bump)
The problem is still in 3.12.
I think your Sprite3D bug is similar to mine: Issue #16894. See this issue for the fix. I've also added an answer to this Stack Overflow question.
make a function and create a rendertextue
then use it at sprite3d
if I modify the code of meshcommand _is3d to false and set the
it show with no depthtest,