| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
ColorModulate alone left the forced material white. Also set the shader's
$color and $color2 vars (IMaterialVar SetVecValue 3-float) and restore them to
white after the draw. Log which fallback material was selected.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Hook IVModelRender::DrawModelExecute (VEngineModel016 slot 19) and force
models/debug/debugwhite for NPC models, identified by
ModelRenderInfo_t::entity_index.
- Two passes: MATERIAL_VAR_IGNOREZ through walls, then normal depth, with
IMaterial::ColorModulate for the configured colour; restore the shared
material's flag/colour afterwards.
- Material lookup via the IMaterialSystem list, FindMaterial fallback.
- New Chams feature/card with Through walls and colour; [chams] config.
- Remove the temporary ammo/projectile/fuse diagnostics.
|
| |
|
|
|
| |
Props render correctly with all seven DrawModel arguments forwarded; the
per-draw model/client/origin log is no longer needed.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
DrawModel takes (this, results, info, boneToWorld, flexWeights,
flexDelayedWeights, const Vector &modelOrigin, flags). The hook dropped
modelOrigin, so flags landed in its slot and the real flags were read from
caller stack garbage. studiorender.so 0x83ad0 reads 0x20(%ebp) as the
modelOrigin pointer and 0x24(%ebp) as the flags; passing both restores the
engine's normal draw.
This is the cause of the intermittent (~50%) checkerboard/error-material
props: the draw was being issued with a garbage flag word.
|
| |
|
|
|
|
|
| |
Drop the temporary DrawModel/SetColor logs now that the prop tint works, and
document the IStudioRender hook layout, the short model-name format used for
prop detection, the SetColor-before-DrawModel ordering, and why prop
materials cannot be tinted directly.
|
| |
|
|
|
|
|
| |
The engine calls SetColorModulation(1,1,1) immediately before DrawModel, so
the in-draw flag never sees it. Set the prop colour at the start of the prop
DrawModel hook instead (colour only, not alpha), and stop applying
ColorModulate to prop materials so only one mechanism touches props.
|
| |
|
|
|
|
|
|
|
| |
The forced SetColorModulation/SetAlphaModulation calls before DrawModel are
what turned matched props into the error material and destabilised the
material system. Mirror Amalgam instead: set a "drawing a prop" flag around
the original draw and only substitute the colour when the engine itself calls
SetColorModulation during that draw. Log those calls for the first few draws
to see whether the engine applies modulation inside DrawModel at all.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Hooking IStudioRender's draw/setter slots made matched props render the error
material and then crashed the material system ("debug/modelstats has bad
reference count 0 when being bound"). Keep the hook code for reference but do
not install it.
Fix the m_clrRender netvar resolution: the walk picked an embedded table entry
at offset 0, so the earlier entity writes stomped entity vtables. Only accept
offsets inside C_BaseEntity (0x20..0x2000), then write the prop colour there
for models/props entities. Restore white when disabled.
|
| |
|
|
|
|
|
|
| |
studiohdr_t::name is not "models/props/...". In this build it is the short
model name with Windows separators, e.g. "props_junk\wood_crate002a.mdl"
(the models/ prefix is stripped). Normalise the prefix/separators and match
props/, props\ and props_ (excluding the distant props_skybox set), so the
studio hooks actually recognise prop draws.
|
| |
|
|
|
|
|
| |
Log the first crate materials the tint pass modifies and the first DrawModel/
DrawModelArray calls with their model names, to see whether the crates are
brush materials that were never reached, materials loaded after the tint was
applied, or a studio draw path that is still missed.
|
| |
|
|
|
|
|
|
|
|
|
| |
m_clrRender resolved to offset 0 in this build; writing it stomped entity
vtables instead of tinting anything. Remove that path.
The static-prop logging showed DrawModelStaticProp is never called for these
props, so hook the other studio draw entries as well: DrawModel (29) for
entity models and DrawModelArray (46, the instanced static-prop path). Both
read the model name from DrawModelInfo_t::m_pStudioHdr and force the prop
colour for models/props* draws.
|
| |
|
|
|
|
|
|
|
| |
Static props commonly use brush-style props/... materials
(props/woodcrate001a is LightmappedGeneric), so the models/props-only filter
missed them. Include the props/ prefix.
Also log the first static prop studio draws and a 500-draw summary so we can
see whether the engine draws props through DrawModelStaticProp at all.
|
|
|
Most of the crates are prop_static, which have no client entity, so writing
m_clrRender only reached the three dynamic ones. Hook the StudioRender
interface (VStudioRender025) on the interface object's vtable: substitute the
prop colour in SetColorModulation/SetAlphaModulation while
DrawModelStaticProp is drawing a models/props model, and set the modulation
explicitly before the original draw in case the engine sets it just before the
call.
Vtable indices verified by disassembling CStudioRenderContext: 27 = three
float stores from the argument pointer, 28 = one float, 30 = the
DrawModelInfo_t-drawing entry with three arguments (the 2013 SDK header lists
these slots five positions earlier in this build).
|