Open smcameron opened 4 years ago
Wonder if I could be hitting OpenGL's 32 texture per draw batch limit? Edit: I do not think this is likely.
While it is not entity allocation failure (all such allocations succeed), I do nevertheless see that o->entity is sometimes NULL within laserbeam_move() in snis_client.c
I think that shouldn't happen, and I don't know how it is happening.
I noticed it also has the same problem not rendering the laserbeams when the renderer is in wireframe mode, so this likely means it is not an issue with e.g. alpha blending.
One possibility: The server sends a laserbeam over before the client knows about the target or the shooter. In this case, the laserbeam's entity will be NULL, and it will not ever be set. I do not think this can account for what I'm seeing though.
I noticed that using pause/break key to bring up the graphics menu and switch on billboard outlines, the billboard outlines are not drawn when the problem is observed. This leads me to believe it's not a problem with the rendering code in graph_dev_opengl.c, but rather some problem causing the laserbeam objects to be skipped when rendering. NULL entities would be consistent with this, but I am not convinced that's the cause.
Things that I think it's not:
It's not the material alpha. It's not the laser duration. It's not the entity non-linear scaling. It's not the entity being NULL.
Hmm, I think it might be the target disappearing on the client so that in laserbeam_move() ...
if (oid < 0 || tid < 0) {
if (o->entity)
entity_set_mesh(o->entity, NULL);
return;
}
because, if on the server side, I make laserbeams inflict no damage, then I don't see the disappearing lasers symptom.
But this doesn't really make sense to me, because the two objects are clearly visible on the screen, and there should be a laserbeam between them, and sparks are emanating from the target. It's as if the target is already dead, but somehow still on the screen, without the laser ever appearing.
The problem may be seen more clearly with this patch, which extends laserbeam duration and increases a starbase's chance of firing the laser.
You can often see sparks emanating from ships being hit with laserbeams, but the laserbeams themselves are not rendered. It is not entity allocation failure, the enties for the laserbeam are allocated in init_laserbeam_data() in snis_client.c just fine.
Possibly something wrong with the triangle normals due to recent NaN fixes?