Skip to content

Using RenderTexture to create reflection make the render "choppy" (code included) #2279

Answered by rh101
rudiHammad asked this question in Q&A
Discussion options

You must be logged in to vote

Can you expand on this please? I'm trying to understand where and when the first and second render occur, as don't see why rendering is happening twice.

I just checked the code in your initial post again, and realised that you're not calling Director::getInstance()->getRenderer()->render(); after the renderTexture->end(); call. That would have been part of what I was referring to, but also the fact that your original code is calling scene->visit() again.

Each loop, the void Director::mainLoop(), as the name implies, runs in a loop. Inside this is a call to drawScene();, which calls _glView->renderScene(_runningScene, _renderer);. It does the following:

void GLView::renderScene(Scene* sc…

Replies: 3 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
12 replies
@rh101
Comment options

rh101 Dec 20, 2024
Collaborator

@rudiHammad
Comment options

@rudiHammad
Comment options

@rh101
Comment options

rh101 Dec 20, 2024
Collaborator

Answer selected by rudiHammad
@rudiHammad
Comment options

@rh101
Comment options

rh101 Dec 21, 2024
Collaborator

@rudiHammad
Comment options

@rh101
Comment options

rh101 Dec 21, 2024
Collaborator

Comment options

You must be logged in to vote
1 reply
@rudiHammad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants