18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 22:25:23 +01:00

fix(render): EU07M review of #538: an instance with light colours of its own drawn alone, the light records locked only when stale

- An instance with lightcolors of its own isn't instanced: the colours go onto the shared submodels as the instance is
  prepared, which the instances of a bucket don't each get, so they all showed the colours of one of them.
- The walk takes the exclusive lock for the light records of a bucket only when they are stale in this frame
  (Refresh_Light_Records() checks again under it): the later passes of the frame no longer stop the other walkers.
- instance_cull.comp (both renderers) puts the word of the light parts into [0][3] after the product with the view, so a
  view with a translation can't stretch the first column of a lit instance.
- The spec: ls_Dark / ls_Home switch without the fade too, and the instances with light colours of their own.
This commit is contained in:
maj00r
2026-11-29 18:14:35 +01:00
parent 6cb66b8b35
commit 99bc0b125c
5 changed files with 22 additions and 5 deletions
+3 -2
View File
@@ -1034,8 +1034,9 @@ void scene_walk::Queue_Instances( scene::basic_cell const *Cell )
}
}
if( m_instancecullpass && bucket_has_lights( instancebucket ) ) {
// the culling of the gpu takes the light states of the instances from their records
gfx::walk_sync::change change;
// the culling of the gpu takes the light states of the instances from their records. only the first pass of the frame has
// them to refresh (Refresh_Light_Records() checks again under the lock), so the others don't stop the walkers for it
gfx::walk_sync::change change { instancebucket.lightsframe != m_framestamp };
Refresh_Light_Records( instancebucket );
}
if( buckettests && Bucket_Culled( instancebucket ) ) {