don't render particles without textures

This commit is contained in:
SamGondelman 2018-10-01 14:54:34 -07:00
parent 130e8dfbe9
commit 1ec481922c

View file

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