mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-06 03:10:13 +02:00
trying to solve the rendering of overlay3d
This commit is contained in:
parent
5c547037f2
commit
d703748ec3
2 changed files with 9 additions and 5 deletions
|
@ -66,8 +66,8 @@ namespace render {
|
||||||
}
|
}
|
||||||
template <> void payloadRender(const Overlay::Pointer& overlay, RenderArgs* args) {
|
template <> void payloadRender(const Overlay::Pointer& overlay, RenderArgs* args) {
|
||||||
if (args) {
|
if (args) {
|
||||||
glPushMatrix();
|
|
||||||
if (overlay->getAnchor() == Overlay::MY_AVATAR) {
|
if (overlay->getAnchor() == Overlay::MY_AVATAR) {
|
||||||
|
glPushMatrix();
|
||||||
MyAvatar* avatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
MyAvatar* avatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||||
glm::quat myAvatarRotation = avatar->getOrientation();
|
glm::quat myAvatarRotation = avatar->getOrientation();
|
||||||
glm::vec3 myAvatarPosition = avatar->getPosition();
|
glm::vec3 myAvatarPosition = avatar->getPosition();
|
||||||
|
@ -78,9 +78,11 @@ namespace render {
|
||||||
glTranslatef(myAvatarPosition.x, myAvatarPosition.y, myAvatarPosition.z);
|
glTranslatef(myAvatarPosition.x, myAvatarPosition.y, myAvatarPosition.z);
|
||||||
glRotatef(angle, axis.x, axis.y, axis.z);
|
glRotatef(angle, axis.x, axis.y, axis.z);
|
||||||
glScalef(myAvatarScale, myAvatarScale, myAvatarScale);
|
glScalef(myAvatarScale, myAvatarScale, myAvatarScale);
|
||||||
|
overlay->render(args);
|
||||||
|
glPopMatrix();
|
||||||
|
} else {
|
||||||
|
overlay->render(args);
|
||||||
}
|
}
|
||||||
overlay->render(args);
|
|
||||||
glPopMatrix();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,9 @@ varying vec4 varColor;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 diffuse = texture2D(diffuseMap, varTexcoord.st);
|
vec4 diffuse = texture2D(diffuseMap, varTexcoord.st);
|
||||||
|
if (diffuse.a < 0.5) {
|
||||||
|
discard;
|
||||||
|
}
|
||||||
|
|
||||||
gl_FragColor = vec4(varColor * diffuse);
|
gl_FragColor = vec4(varColor.rgb * (1 - diffuse.a) + diffuse.a * diffuse.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue