RTT problem. #2424
Unanswered
Rukawahe
asked this question in
Support Q&A
RTT problem.
#2424
Replies: 1 comment
-
Are you re-using the same camera objects for both your RTT pass and your post-processing pass? I think you need to use two separate cameras; one for the RTT pass with a perspective camera, and a second camera with an orthographic matrix for your post-processing pass. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,ALL.
In osgEarth, I use RTT technology to achieve the post-processing Bloom effect. I'm using quad as the display node. Here's the code:
if (type == DEFERRED_PASS)
{
// Deferred pass is absolutely facing the XOY plane in the range of [0, 1]
camera->setAllowEventFocus(false);
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera->setProjectionMatrix(osg::Matrix::ortho2D(0.0, 1.0, 0.0, 1.0));
camera->setViewMatrix(osg::Matrix::identity());
camera->addChild(createScreenQuad(1.0, 1.0));
}
else
{
// Forward pass will follow the scene navigation result
camera->setReferenceFrame(osg::Transform::RELATIVE_RF);
}
The results are as follows:
This is fine for small scenes, but when I add a lot of 3DTiles data (including buildings), the frame rate keeps going down. At the beginning, I set the maxScreenSpace of 3DTiles to 16.0, which means that the building surface doesn't need to be very clear, but when BLoom is turned on, the building becomes clearer and clearer, resulting in more and more nodes in the scene and a lower frame rate.
When I look at the TDTiles .cpp source code, I see that computeScreenSpaceError is calculated differently. When 3DTiles are loaded normally, the computeScreenSpaceError calculation seems to be done under the perspective matrix, and when I use Bloom, I find that every frame is done in the orthographic matrix. This is what causes the returned values to be different.
My doubts are:
1、When calculating computeScreenSpaceError, does the calculation in the case of orthogonal matrices have to be changed?
2、Is there a problem with the way my camera is set up?
Beta Was this translation helpful? Give feedback.
All reactions