Fix tools materials in Hammer Level Editor's fullbright mode #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves Facepunch/sbox-issues#9500 by adding specular to all tool materials.
This change enables specular on all tool materials using
generic.shader, ensuring the Fullbright path always has a non-zero specular term to work with. The result is that tool surfaces become readable again in Hammer's fullbright without altering how they behave in-game or after a map compile. Their material definitions are also updated to the currentgeneric.shaderlayout, replacing legacy texture bindings with the modern PBR slots.Hammer’s Fullbright mode uses
ToolsVis.hlsl.vColor.rgb = vAlbedo * flAmbientCubeFactor * flAmbientCubeAmount + flHeadlightSpec.xxx;Many tool materials currently have their
vAlbedo(LightSim_Albedo) effectively set to[0 0 0]. Since Albedo is zero, multiplying it by the ambient cube factor still gives zero:vColor.rgb = 0 + flHeadlightSpec.xxx;This means the ambient contribution is always black, and the only thing making these materials visible in Fullbright is the tiny baked-in
flHeadlightSpecterm. When specular is disabled on the material, even that small contribution disappears, causing the surface to render almost completely black in the viewport.This PR also updates their texture bindings. Many tool materials were still using legacy auto-generated bindings like
g_tColorandg_tNormal. Recompiling them under the modern shader layout switches them toTextureColor,TextureNormal, and the engine’s default PBR slots.