source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

Standard shaders have tons of problems

Open InevitablyDivinity opened this issue 4 years ago • 4 comments

The materialsystem does not allow stdshader_dx9 to be overridden. Not all standard shaders in the SDK compile, and many of the standard shaders are even missing. All of these problems make graphics programming within the SDK a difficult task if you wish to base off any of the existing shaders.

InevitablyDivinity avatar Oct 14 '20 11:10 InevitablyDivinity

There's interface for materials overriding. Using that interface you can tell the engine that instead of LightmappedGeneric (for ex.) it must use MYOWN_LightmappedGeneric (for ex., again). Check g-string's repository for replmats.cpp

RusJJ avatar Oct 18 '20 16:10 RusJJ

I'm aware of the materialsystem pass-through, but I'm not particularly happy with that solution, as I'm not sure about the performance impact it may have when loading/pre-caching materials. It would be nicer if the SDK just allowed us to override stdshader_dx9 in the first place, as the feature only exists for TF2 presumably.

InevitablyDivinity avatar Oct 18 '20 22:10 InevitablyDivinity

On top of this, the 2007 SDK at least supplies all the shaders it had, and with a valid list of shaders to compile. It even had all of them appropriately named with the SDK_ prefix so you could at least modify the standard shaders from the get-go.

InevitablyDivinity avatar Oct 18 '20 22:10 InevitablyDivinity

Precaching wont use shader settings. Performance impact: yeah, sure. Need to test, but i dont think its to big.

RusJJ avatar Oct 19 '20 04:10 RusJJ