mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +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) {
|
||||
if (args) {
|
||||
glPushMatrix();
|
||||
if (overlay->getAnchor() == Overlay::MY_AVATAR) {
|
||||
glPushMatrix();
|
||||
MyAvatar* avatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||
glm::quat myAvatarRotation = avatar->getOrientation();
|
||||
glm::vec3 myAvatarPosition = avatar->getPosition();
|
||||
|
@ -78,9 +78,11 @@ namespace render {
|
|||
glTranslatef(myAvatarPosition.x, myAvatarPosition.y, myAvatarPosition.z);
|
||||
glRotatef(angle, axis.x, axis.y, axis.z);
|
||||
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) {
|
||||
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