mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 15:59:57 +02:00
Use setUniformTexture
This commit is contained in:
parent
31e565868d
commit
141d8fa055
1 changed files with 3 additions and 7 deletions
|
@ -612,10 +612,6 @@ void Avatar::renderBillboard(RenderArgs* renderArgs) {
|
|||
// compute the size from the billboard camera parameters and scale
|
||||
float size = getBillboardSize();
|
||||
|
||||
gpu::Batch& batch = *renderArgs->_batch;
|
||||
batch._glEnable(GL_TEXTURE_2D);
|
||||
batch._glBindTexture(GL_TEXTURE_2D, _billboardTexture->getID());
|
||||
|
||||
Transform transform;
|
||||
transform.setTranslation(_position);
|
||||
transform.setRotation(rotation);
|
||||
|
@ -625,12 +621,12 @@ void Avatar::renderBillboard(RenderArgs* renderArgs) {
|
|||
glm::vec2 bottomRight(1.0f, 1.0f);
|
||||
glm::vec2 texCoordTopLeft(0.0f, 0.0f);
|
||||
glm::vec2 texCoordBottomRight(1.0f, 1.0f);
|
||||
|
||||
|
||||
gpu::Batch& batch = *renderArgs->_batch;
|
||||
batch.setUniformTexture(0, _billboardTexture->getGPUTexture());
|
||||
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(batch, true);
|
||||
DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight,
|
||||
glm::vec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
batch._glBindTexture(GL_TEXTURE_2D, 0);
|
||||
batch._glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
float Avatar::getBillboardSize() const {
|
||||
|
|
Loading…
Reference in a new issue