Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-packing fails to consider textures in conditional VMT statements #282

Open
piqey opened this issue Oct 23, 2024 · 2 comments
Open

Auto-packing fails to consider textures in conditional VMT statements #282

piqey opened this issue Oct 23, 2024 · 2 comments
Labels
done Fixed/implemented for next release enhancement

Comments

@piqey
Copy link

piqey commented Oct 23, 2024

I have a VMT that reads as follows:

"VertexLitGeneric"
{
//	$basetexture		"piqey/thebel/skybox/thebel_skybox/roof"	// This is loaded by another VMT in the project, that's why you'll see it still get packed in the compile log below
	$basetexture		"piqey/thebel/skybox/thebel_skybox/roof_lightmappable"
	$surfaceprop		"concrete"

	"ldr?$lightmap"		"piqey/thebel/skybox/thebel_skybox/roof_lightmap"
	"hdr?$lightmap"		"piqey/thebel/skybox/thebel_skybox/roof_lightmap_hdr"
}

However, as you can see from the following compile log excerpt, the $lightmaps specified by the ldr? and hdr? conditional statements were not packed by the postcompiler:

[...]
 | materials\piqey\thebel\skybox\thebel_skybox\pillars_normal.vtf
 | materials\piqey\thebel\skybox\thebel_skybox\roof.(vmt/vtf)
 | materials\piqey\thebel\skybox\thebel_skybox\roof_lightmappable.vtf
 | materials\piqey\thebel\skybox\thebel_skybox\roof_side.(vmt/vtf)
 | materials\skybox\piqey\blackbk.vmt
[...]

I could include in-game screenshots but I think that's somewhat unnecessary as it's just... not there. A missing texture. If you want it, here is the full compile log (I only ran vbsp.exe and postcompiler.exe to keep it concise).

Just a side note, I know the textures work fine. I've been using them for about a week now, and it was only today that I unmounted all my content to test the auto-packing and noticed postcompiler.exe wasn't doing its job on those particular textures.

@piqey piqey changed the title Auto-packing fails to consider conditional VMT statements Auto-packing fails to consider textures in conditional VMT statements Oct 23, 2024
@TeamSpen210
Copy link
Owner

Yep, currently srctools' VMT parser (and therefore HammerAddons) doesn't handle flags specially, so it just thinks this is a property named ldr?$lightmap. When writing the parser I wasn't sure how to decode these, if you needed to know the list of flags up-front to detect, etc. I didn't think it was too important given how old Source is - it's not that likely anyone is going to have a DX8-only card or something today.

I probably should implement support though. As a workaround, you can place comp_pack entities to tell the autopacker directly about these textures.

@piqey
Copy link
Author

piqey commented Oct 24, 2024

Yep, currently srctools' VMT parser (and therefore HammerAddons) doesn't handle flags specially, so it just thinks this is a property named ldr?$lightmap. When writing the parser I wasn't sure how to decode these, if you needed to know the list of flags up-front to detect, etc. I didn't think it was too important given how old Source is - it's not that likely anyone is going to have a DX8-only card or something today.

I probably should implement support though. As a workaround, you can place comp_pack entities to tell the autopacker directly about these textures.

Yes, that's how I'm going to work around it for now. Have been doing something similar for custom sounds in soundscapes. Just thought I'd file an issue while I was at it.

@TeamSpen210 TeamSpen210 reopened this Nov 2, 2024
@TeamSpen210 TeamSpen210 added the done Fixed/implemented for next release label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Fixed/implemented for next release enhancement
Projects
None yet
Development

No branches or pull requests

2 participants