mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 06:49:41 +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
|
// compute the size from the billboard camera parameters and scale
|
||||||
float size = getBillboardSize();
|
float size = getBillboardSize();
|
||||||
|
|
||||||
gpu::Batch& batch = *renderArgs->_batch;
|
|
||||||
batch._glEnable(GL_TEXTURE_2D);
|
|
||||||
batch._glBindTexture(GL_TEXTURE_2D, _billboardTexture->getID());
|
|
||||||
|
|
||||||
Transform transform;
|
Transform transform;
|
||||||
transform.setTranslation(_position);
|
transform.setTranslation(_position);
|
||||||
transform.setRotation(rotation);
|
transform.setRotation(rotation);
|
||||||
|
@ -626,11 +622,11 @@ void Avatar::renderBillboard(RenderArgs* renderArgs) {
|
||||||
glm::vec2 texCoordTopLeft(0.0f, 0.0f);
|
glm::vec2 texCoordTopLeft(0.0f, 0.0f);
|
||||||
glm::vec2 texCoordBottomRight(1.0f, 1.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<DeferredLightingEffect>()->bindSimpleProgram(batch, true);
|
||||||
DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight,
|
DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight,
|
||||||
glm::vec4(1.0f, 1.0f, 1.0f, 1.0f));
|
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 {
|
float Avatar::getBillboardSize() const {
|
||||||
|
|
Loading…
Reference in a new issue