Merge pull request #14124 from SamGondelman/particle

Don't render particles without textures
This commit is contained in:
John Conklin II 2018-10-17 11:17:23 -07:00 committed by GitHub
commit 7b226aa559
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -320,7 +320,7 @@ void ParticleEffectEntityRenderer::stepSimulation() {
}
void ParticleEffectEntityRenderer::doRender(RenderArgs* args) {
if (!_visible) {
if (!_visible || !(_networkTexture && _networkTexture->isLoaded())) {
return;
}
@ -328,11 +328,7 @@ void ParticleEffectEntityRenderer::doRender(RenderArgs* args) {
stepSimulation();
gpu::Batch& batch = *args->_batch;
if (_networkTexture && _networkTexture->isLoaded()) {
batch.setResourceTexture(0, _networkTexture->getGPUTexture());
} else {
batch.setResourceTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture());
}
batch.setResourceTexture(0, _networkTexture->getGPUTexture());
Transform transform;
// The particles are in world space, so the transform is unused, except for the rotation, which we use