summaryrefslogtreecommitdiffstats
path: root/src/bones.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
3 daysChams: real additive material, addref cached materialssalmonik2-50/+37
Testing on :99 showed ADDITIVE on debugtranslucentsinglecolor did nothing and alpha lost the colour, because that VMT has no $translucent and the engine bound an unreferenced material. Use debug/debugtranslucentmodelhulls (VMT has $additive 1 + $color) for Additive/Fullbright, and addref every preloaded material so the engine stops warning "bad reference count 0" and applies $color/ColorModulate. Verified: Solid is flat blue, Additive is a translucent coloured glow, Fullbright is a white additive glow, White is opaque white. Also drop the viewmodel additive base (the solid material is opaque, so it made an opaque blob) and never call FindMaterial inside DrawModelExecute. Document that the alpha control is stored but has no effect until a custom $translucent model VMT is added.
3 daysChams: make Fullbright a white-hot additive glowsalmonik2-12/+3
Fullbright was additive with the chosen colour lifted only 25% toward white, which on a dark scene looked almost identical to Solid/Flat. Force white for the Fullbright colour so the additive pass reads as a distinctly brighter, white-hot glow; the faint translucent base still gives it a silhouette on bright backgrounds.
3 daysChams: per-colour alpha and a softer viewmodel additive basesalmonik5-66/+178
- Colour picker gains an optional alpha bar (checkerboard preview, #RRGGBBAA readout); add_color_alpha is used for the chams colours. Chams colours are now r,g,b,a and chams_apply sets $alpha plus MATERIAL_VAR_TRANSLUCENT when alpha < 255. Config stores vis_a / inv_a / vm a. - The additive viewmodel base is now a faint translucent tint (alpha/8) instead of an opaque fill, so additive/Fullbright stay see-through and the viewmodel no longer becomes a solid blob. Fullbright whitening reduced to 25% so blue stays blue instead of turning lavender.
3 daysChams: keep additive viewmodel visible on bright backgroundssalmonik2-0/+17
Viewmodels are collated as RENDER_GROUP_VIEW_MODEL_OPAQUE, so an additive forced material can vanish against a bright sky/wall (additive adds nothing to an already-bright surface). Draw a dim opaque solid base before the additive viewmodel pass so the first-person model always has a visible silhouette; the additive layer still provides the glow.
3 daysChams: use the model solid shader for flat, drop vgui/whitesalmonik2-23/+12
vgui/white is an UnlitGeneric with $vertexcolor/$vertexalpha, no basetexture and no $model, so it renders nothing on model vertices; Flat was invisible on the viewmodel and would be invisible on NPCs too. Flat now uses the solid model shader with the FLAT flag. Remove the vgui/white probe.
3 daysChams: fix the flat viewmodel, glow outline and fullbright stylessalmonik2-15/+39
- Flat uses the solid model shader with the FLAT flag on the viewmodel; vgui/white does not draw skinned models and made the hands vanish. - Glow outline draws its wireframe contour with ZNEARER and a brightened colour, so the solid base no longer hides the contour. - Fullbright is now additive + self-illuminated with the colour lifted toward white, so it reads differently from Solid and Additive glow.
3 daysChams: per-relationship, visible/invisible styles and viewmodelsalmonik6-105/+228
- Hostile/neutral/friendly each have independent visible and through-wall settings: enable, style and colour. Viewmodel has its own enable/style/colour. - Styles: Flat, Wireframe, Additive, Solid, White, Fullbright, Glow outline. Additive uses the model solid material + ADDITIVE flag (the VGUI additive was invisible on NPCs). White/fullbright are solid-based, so the viewmodel no longer disappears/checkerboards. Glow outline adds a wireframe contour pass for depth. - Config: [chams] active/bind, [chams_hostile|neutral|friendly] vis/inv settings, [chams_vm]. GUI sections for each group.
3 daysChams: apply model-safe styles to the viewmodelsalmonik1-5/+11
The viewmodel was always solid. Use the selected style material for the model-debug styles (wireframe/solid/white/fullbright); Flat and Additive use the solid model shader with the same flags because their VGUI materials do not draw skinned models.
3 daysChams: use the loaded VGUI whites for flat and additivesalmonik2-8/+10
models/debug/debugwhite is EP2-only and additivevertexcolorvertexalpha is not loadable in the base game. Preload vgui/white for Flat and vgui/white_additive for Additive; the other debug styles were already found. The viewmodel keeps the solid model shader.
3 daysChams: preload style materials outside the model drawsalmonik4-29/+53
FindMaterial inside DrawModelExecute did not load the style VMTs, so every style fell back to the solid material. Preload the six style materials from outer_draw (throttled) and have the render hook use the cached pointers only. world_find_material now returns only the exact requested material; the caller falls back to the solid style. Add a vgui/white probe and per-style preload logs.
3 daysChams: style flags on the resident debug materialsalmonik2-31/+43
The base game only has debug/debugtranslucentsinglecolor resident, so the other debug VMTs silently fell back to it and every style looked flat. Use that material for every style and apply material flags instead: FLAT, WIREFRAME, ADDITIVE, and FLAT|SELFILLUM for fullbright; white forces the colour. Flags are cleared after the draw.
3 daysChams: model-safe styles and a dedicated viewmodel materialsalmonik5-15/+32
VGUI/white materials do not draw skinned models, so every viewmodel style except the model debug one made the hands/weapon disappear. Use model debug materials for all styles: wireframe, additive vertex colour, translucent single colour, translucent vertex colour, MRM fullbright. The viewmodel always uses debug/debugtranslucentsinglecolor. A missing style now falls back to that material instead of vgui/white.
3 daysChams: exact material styles, GUI dropdown, viewmodel hookupsalmonik3-44/+180
- world_find_material now tries the exact requested style first (resident, then FindMaterial) before falling back to debugwhite/vgui white. The old candidate scan returned vgui/white for every style, so all materials looked flat. - Add a real CK_DROPDOWN control (overlay list, outside-click close, config save) and use it for the Chams material selector. - Chams viewmodel toggle included in config/UI.
3 daysChams: material styles and viewmodel supportsalmonik6-30/+89
- Material selector 0..4: debugwhite, debug wireframe (ignorez), vgui white_additive, debugtranslucentsinglecolor, vgui/white; cached per index with a debugwhite fallback. - Add "Viewmodel (hands/weapon)" toggle; viewmodel entities (class contains viewmodel or model path /v_...) get a normal-depth chams pass. - [chams] gains viewmodel= and material=.
3 daysChams: quiet material lookup, accept any fallback by namesalmonik2-11/+11
FindMaterial diagnostics are no longer logged per attempt; the chosen material is logged once. Accept any candidate name returned by FindMaterial, not just debugwhite.
3 daysChams: tint through $color/$color2 and log the chosen materialsalmonik3-11/+31
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.
3 daysChams: material fallbacks and FindMaterial diagnosticssalmonik1-10/+31
models/debug/debugwhite is not resident and FindMaterial did not return it. Log each FindMaterial attempt and fall back to debugwhite2/3, vgui/white, debug/debugtranslucentsinglecolor and the ignorez debug wireframe material so chams can still render.
3 daysAdd chamssalmonik10-73/+224
- 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.
4 daysItems: skip the CNetworkArray length header for m_iAmmo/m_hMyWeaponssalmonik2-3/+12
The datamap offset points at the array length header, so every ammo count was read one type early. That made the RPG slot read the buckshot count (30) and permanently exceed the 3-rocket cap, which is why RPG pickups never showed and grenades/AR2/weapon ammo never hid. Read the elements 4 bytes after the field offset.
4 daysItems/projectiles: ammo diagnostics, dispensers, launched RPGsalmonik1-7/+35
- Exempt chargers and ammo/supply crates from the fullness filter; reusable dispensers stay visible at max ammo/health. - Log the local ammo current/max table once and the first 24 ammo filter decisions, so the RPG/grenade/weapon cases can be diagnosed. - Classify the launched w_missile as an RPG projectile (class not item/ weapon) and exclude the w_missile_closed ammo pickup from projectile ESP.
4 daysItems: read ammo and inventory from the server arrayssalmonik4-12/+73
The client m_iAmmo/m_hMyWeapons recv props still do not resolve, but the listen server has the same CBaseCombatCharacter arrays in its datamap. Resolve m_iAmmo and m_hMyWeapons there: - reserve ammo comes from server_player_ammo() when the client array is missing, so full-ammo filtering works (RPG rockets at 3); - the owned-weapon mask is filled from the server m_hMyWeapons[48] handles, so fallen weapons count as ammo before the player equips them. Widen the datamap field-size filter to 512 for the 192-byte handle array.
4 daysNetvars: catch array element props and log the walksalmonik1-28/+58
- Match m_iAmmo/m_hMyWeapons by name prefix so element props such as m_iAmmo[0] are accepted. - Handle them before the nested-table recursion, since RecvPropArray3 may put the element descriptor in m_pDataTable. - Allow name strings outside client.so (engine/server too), and log the first 16 array props plus the first 8 unreadable prop names so the remaining resolution failure is visible in the normal log.
4 daysNetvars: handle RecvPropArray3 array propssalmonik1-3/+27
m_iAmmo and m_hMyWeapons were not resolving (both -1). Array props keep their element descriptor in m_pArrayProp and its offset can hold the array base; the walker was also treating a non-null m_pDataTable on an array as a nested table and skipping the name match. Process array props by name, use the element offset when present, and log the first 16 array props under HL2H_DEBUG.
4 daysItems: hide full ammo pickups; robust close-target projectionsalmonik4-36/+233
- Resolve m_iAmmo and m_hMyWeapons arrays from the client recv tables. - "Only if usable" now compares m_iAmmo[type] against sk_max_* (stock caps as fallback: RPG rockets 3, AR2 60, ...). Full ammo hides the pickup, including RPG rockets and fallen weapons converted to ammo. - Inventory now comes from m_hMyWeapons directly, so fallen weapons are ammo before the player equips the matching weapon. - Projection: fall back to local math when ScreenPosition claims "behind" for a point with positive view depth, and build NPC boxes from vertical samples so feet behind the near plane no longer drop the whole target. Log the first 8 near-target projection failures for diagnosis.
4 daysClip transition and radius lines at the near planesalmonik2-20/+89
Transition-box edges and projectile radius rings were only drawn when both endpoints projected. An edge with one corner behind the camera vanished, so a half-visible box or ring showed nothing. Add a segment projector that clips at the near plane in view space, then clips the 2D result to the screen bounds, and use it for both.
4 daysFix overlay-vanishing projections; ammo rule via held weaponssalmonik2-33/+77
- world_to_screen now rejects NaN/inf and absurd projections. A point on the view axis (directly below the feet) could produce NaN and corrupt the ISurface clip state, hiding the whole ESP for that frame. - Draw projectile radius rings even when the projectile centre is off-screen or behind the camera. - Owner netvars are -1 on this client, so the "owned weapon -> ammo" rule now accumulates the weapon types the player has actually held (active weapon, server fallback), reset when the local entity changes.
4 daysItems: fallen owned weapons count as ammo; fuse diagnosticssalmonik3-8/+122
- World weapons of a type already in the local player's inventory are retagged as ammo ("SMG ammo", ...). Inventory scan only counts weapons owned by the local player index, so NPC weapons do not trigger it. - Projectile fuse: log det/cur/base/raw server value, and fall back to a 3-second first-sighting countdown when m_flDetonateTime or engine time is unavailable.
4 daysAdd usable item filter, projectile ESP and gravity-gun meleesalmonik8-35/+429
- Items: "Only if usable" hides health tags at full health and armor at full suit. Health ceiling is the server player's m_iMaxHealth; armor uses the server m_ArmorValue against HL2's 100 cap. Fails open when unreadable. - Projectiles: new Visuals feature/card for thrown grenades, RPG rockets, helicopter bombs and AR2 balls. Fuse from server m_flDetonateTime vs engine time; radius from m_DmgRadius with per-type fallback; optional 24-segment radius ring and FRAG timer label. - Melee: the killbot now handles the gravity gun as well; only VULNERABLE targets, 1200-unit range, primary attack to launch the held object, and no aim-punch compensation because the launch uses EyeVectors. - Server/netvars: m_ArmorValue, m_flDetonateTime, m_DmgRadius.
4 daysRemove gamma slider; keep HDR brightnesssalmonik5-72/+19
Wayland/XWayland discards window gamma ramps, so mat_monitorgamma could not work on the development setup. Drop the slider, config key and readback. Keep the in-engine HDR tonemap brightness and document that Fullbright turns tonemapping off.
4 daysAdd HDR tonemap brightness slidersalmonik5-17/+52
The engine applies mat_monitorgamma (SDL receives changing ramp midpoints), but Wayland/XWayland compositors discard the window gamma ramp, so the gamma slider has no visible effect there. Add an in-engine brightness control that does not depend on the window system: mat_force_tonemap_scale, exposed as "HDR brightness" (x10, 0 = automatic). Drop the temporary SDL gamma ramp diagnostic.
4 daysGamma: clamp slider to the engine's 2.6 cap, defer readbacksalmonik4-13/+46
The engine clamps mat_monitorgamma at 2.6, so the 2.8..3.0 end of the slider did nothing. Read the value back one tick later (ClientCmd is queued) and interpose SDL_SetWindowGammaRamp to see whether the engine pushes a ramp at all.
4 daysTransitions: per-trigger targets and 3D wireframe; FOV range fixessalmonik5-57/+82
- Each changelevel trigger now shows its own target map. The trigger whose target is the map we came from is marked "<- map"; the forward one is "-> map". No more appending one global previous-map line to every box. - Draw the volume as a projected 8-corner / 12-edge wireframe with the tag above its highest visible corner instead of a screen-space rectangle. - Camera FOV is 40..140 (stock 75) and viewmodel FOV 20..120 (stock 54); 0 is no longer allowed and old configs using 0 migrate to the stock value. - Log the mat_monitorgamma readback via ICvar so we can tell whether the command is rejected or the OS/compositor ignores the gamma ramp.
4 daysAdd ESP, aim, view and movement batchsalmonik9-68/+815
- ESP: alert state (IDLE/ALERT/COMBAT/SCRIPT), enemy weapon labels, hostile/ neutral/friendly colour pickers, off-screen direction arrows, and trigger_changelevel volumes with next/previous map labels. - Aim: silent aim reuses the Aimbot FOV, vischeck and bone settings; add optional aim-punch compensation for aimbot, silent aim, triggerbot and melee (server bullets add m_vecPunchAngle to the usercmd angles). - View: always-on Camera / display card with camera FOV (writes the client m_iDefaultFOV netvar), viewmodel FOV and monitor gamma (client cvars). - Movement: Jump assist card with auto crouch-jump and edge jump (point ground probe 0.12 s ahead). - Spread: Engine spread override toggle gates the direct RandomFloat zeroing; off leaves only the seed search. - Server: entity count/base/classname helpers, trigger_changelevel map name and world bounds via IServerUnknown/ICollideable. - Netvars: m_vecPunchAngle and m_iDefaultFOV.
4 daysNo spread: detect pellet draws from the FireBullets seed callsalmonik2-8/+29
The ApplySpread random draws are not guaranteed to run in the player's frame (the compiler can outline them), so the frame-based shooter check missed and the shotgun kept its seed-minimised spread. The player's FireBullets RandomSeed call now arms a short 8-draw window; the next RandomFloat draws return 0. Keep the frame check as the other path. Remove the diagnostics used to find this.
4 daysNo spread: zero pellet offsets inside FireBulletssalmonik2-0/+72
Picking the best of 256 pending seeds still leaves the shotgun's 8/12 pellets a few degrees apart. CShotManipulator::ApplySpread is inlined into CBaseEntity::FireBullets and draws x/y through the global CUniformRandomStream; hook its RandomFloat slot and return 0 when the calling frame's shooter is the local server player. This collapses every pellet onto the shot direction while NPC fire and client prediction keep their randomness.
4 daysFix No spread on the hl2_complete server buildsalmonik5-20/+157
The server RandomSeed GOT slot was hardcoded to 0xce1348, measured on the older bin/server.so. The anniversary branch loads hl2_complete/bin/server.so, whose R_386_JMP_SLOT for RandomSeed is 0xce5348, so the patch hit unrelated writable data and no spread silently did nothing. - Read the relocation from the loaded module's ELF (module_jump_slot) instead of hardcoding, with the two known offsets as fallback. - Override whenever the RandomSeed caller's `this` is the local server player (CBaseEntity::FireBullets) instead of matching a hardcoded return-address range that also moved between builds. - m_takedamage is a char (FIELD_CHARACTER) in the 2013 SDK; resolve it as such and read a byte, so the IMMUNE damage tag actually works.
4 daysStudio: drop the prop draw diagnosticsalmonik1-7/+0
Props render correctly with all seven DrawModel arguments forwarded; the per-draw model/client/origin log is no longer needed.
4 daysESP: render damage tags as small left-side labelssalmonik4-7/+47
Draw ARM/VULN/IMM on the left edge of the box with a 10px font and a black 1px shadow, instead of full-size text above the name. The small font is a second HFont created next to the 16px body font. CONTEXT: document the DrawModel argument fix and the tag styling.
4 daysProps: forward DrawModel's modelOrigin argumentsalmonik1-3/+16
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.
4 daysESP: classify NPC damage immunity/armour/vulnerabilitysalmonik6-8/+118
- Resolve server m_takedamage (DAMAGE_NO/DAMAGE_EVENTS_ONLY = immune). - Classify gunship/strider/dropship as ARMORED (OnTakeDamage only accepts DMG_BLAST; only the RPG passes), and headcrab/antlion/manhack as VULN (gravity gun / physics impact). - ESP draws ARMORED/VULN/IMMUNE tags above the name (new "Damage tags" toggle, [esp] dmg). - Aimbot, silent aim, triggerbot and melee skip immune targets and armoured targets unless the active weapon is the RPG.
4 daysProps: remove studio diagnostics; document the prop tint pathsalmonik2-25/+21
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.
4 daysProps: force colour inside prop DrawModel; no prop material tintsalmonik2-8/+11
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.
4 daysProps: install the studio hooks againsalmonik1-0/+2
The entity-path rewrite of prop_tint_update dropped studio_props_init(), so the minimal IStudioRender hooks were never installed (no studio: log lines). Call it while the prop tint is enabled.
4 daysProps: only substitute colour during studio draws (no forced set)salmonik1-19/+11
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.
4 daysProps: disable StudioRender hooks, fix m_clrRender offsetsalmonik3-6/+60
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.
4 daysProps: match the studio model name formatsalmonik1-1/+12
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.
4 daysDiagnose prop tinting: log prop materials and studio draw model namessalmonik2-3/+15
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.
4 daysProps: tint through DrawModel/DrawModelArray; drop m_clrRender writessalmonik2-56/+55
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.
4 daysWorld tint: include props/ materials; log static studio drawssalmonik2-2/+18
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.
4 daysWorld tint: tint map-static props through IStudioRendersalmonik4-1/+182
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).