mirror of
https://github.com/overte-org/overte.git
synced 2025-07-29 07:50:30 +02:00
Merge pull request #5007 from SamGondelman/master
Fixed avatar billboards not displaying
This commit is contained in:
commit
b676036895
2 changed files with 16 additions and 9 deletions
|
@ -3104,6 +3104,12 @@ QImage Application::renderAvatarBillboard() {
|
||||||
auto primaryFramebuffer = DependencyManager::get<TextureCache>()->getPrimaryFramebuffer();
|
auto primaryFramebuffer = DependencyManager::get<TextureCache>()->getPrimaryFramebuffer();
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, gpu::GLBackend::getFramebufferID(primaryFramebuffer));
|
glBindFramebuffer(GL_FRAMEBUFFER, gpu::GLBackend::getFramebufferID(primaryFramebuffer));
|
||||||
|
|
||||||
|
// clear the alpha channel so the background is transparent
|
||||||
|
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
|
||||||
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
|
||||||
|
|
||||||
// the "glow" here causes an alpha of one
|
// the "glow" here causes an alpha of one
|
||||||
Glower glower;
|
Glower glower;
|
||||||
|
|
||||||
|
@ -3114,6 +3120,7 @@ QImage Application::renderAvatarBillboard() {
|
||||||
|
|
||||||
QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32);
|
QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32);
|
||||||
glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits());
|
glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits());
|
||||||
|
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||||
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
|
|
||||||
|
@ -3160,7 +3167,7 @@ const ViewFrustum* Application::getDisplayViewFrustum() const {
|
||||||
return &_displayViewFrustum;
|
return &_displayViewFrustum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs::RenderSide renderSide) {
|
void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, bool billboard, RenderArgs::RenderSide renderSide) {
|
||||||
activeRenderingThread = QThread::currentThread();
|
activeRenderingThread = QThread::currentThread();
|
||||||
PROFILE_RANGE(__FUNCTION__);
|
PROFILE_RANGE(__FUNCTION__);
|
||||||
PerformanceTimer perfTimer("display");
|
PerformanceTimer perfTimer("display");
|
||||||
|
@ -3376,7 +3383,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs
|
||||||
false, selfAvatarOnly);
|
false, selfAvatarOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (!billboard) {
|
||||||
DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());
|
DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());
|
||||||
auto skyStage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
|
auto skyStage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
|
||||||
DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(skyStage->getSunLight()->getDirection(), skyStage->getSunLight()->getColor(), skyStage->getSunLight()->getIntensity(), skyStage->getSunLight()->getAmbientIntensity());
|
DependencyManager::get<DeferredLightingEffect>()->setGlobalLight(skyStage->getSunLight()->getDirection(), skyStage->getSunLight()->getColor(), skyStage->getSunLight()->getIntensity(), skyStage->getSunLight()->getAmbientIntensity());
|
||||||
|
@ -3579,7 +3586,7 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) {
|
||||||
|
|
||||||
// render rear mirror view
|
// render rear mirror view
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
displaySide(_mirrorCamera, true);
|
displaySide(_mirrorCamera, true, billboard);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
if (!billboard) {
|
if (!billboard) {
|
||||||
|
|
|
@ -270,7 +270,7 @@ public:
|
||||||
|
|
||||||
QImage renderAvatarBillboard();
|
QImage renderAvatarBillboard();
|
||||||
|
|
||||||
void displaySide(Camera& whichCamera, bool selfAvatarOnly = false, RenderArgs::RenderSide renderSide = RenderArgs::MONO);
|
void displaySide(Camera& whichCamera, bool selfAvatarOnly = false, bool billboard = false, RenderArgs::RenderSide renderSide = RenderArgs::MONO);
|
||||||
|
|
||||||
/// Stores the current modelview matrix as the untranslated view matrix to use for transforms and the supplied vector as
|
/// Stores the current modelview matrix as the untranslated view matrix to use for transforms and the supplied vector as
|
||||||
/// the view matrix translation.
|
/// the view matrix translation.
|
||||||
|
|
Loading…
Reference in a new issue