mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 05:57:08 +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:
@@ -15,6 +15,8 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "model/AnimModel.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "rendering/renderer.h"
|
||||
#include "model/MdlMngr.h"
|
||||
#include "simulation/simulation.h"
|
||||
@@ -569,6 +571,9 @@ void TAnimModel::update_instanceable_flag() {
|
||||
// gfx.instancedlights: the lights go with the matrix of each instance (instance_light_bits()), and the instanced walk
|
||||
// animates each instance (RaAnimate) and prepares the model with all the parts of the lights shown (RaPrepareInstanced)
|
||||
if( ( iNumLights != 0 ) && ( false == Global.gfx_instancedlights ) ) { ++s_rejected_lights; return; }
|
||||
// light colours of its own (lightcolors of the node) go onto the shared submodels as the instance is prepared (RaPrepare),
|
||||
// which the instances of a bucket don't each get: such an instance is drawn on its own
|
||||
if( std::ranges::any_of( m_lightcolors, []( glm::vec3 const &Colour ) { return Colour.r >= 0.f; } ) ) { ++s_rejected_lights; return; }
|
||||
if( !m_animlist.empty() ) { ++s_rejected_animlist; return; }
|
||||
if( submodel_tree_blocks_instancing( pModel->Root ) ) { ++s_rejected_animated_submodel; return; }
|
||||
m_instanceable = true;
|
||||
|
||||
Reference in New Issue
Block a user