env_sun refuses to display

The title says it all. This entity just won’t render in the sky despite my taking several actions in a vain attempt to get it working. Below is it’s properties box:

I added in a custom skybox as well, so I’ll include the .vmt settings for it below (the .vmt is practically identical for each side of the skybox texture). I had to set ignorez to 0, because that caused the skybox to render above my map for some reason, which obviously wasn’t ideal.


"UnlitGeneric"
{
	"$baseTexture" "skybox/assaultBK"
	"$nofog" 1
	$ignorez 0
}


In your skybox materials, try re-enabling $ignorez and changing UnlitGeneric to Sky.

Doing that resulted in the texture suddenly turning into the ever hated purple and black checkerboard, as well as making it appear over all brush geometry, including displacements, leaving only models visible. Here is what the edited .vmt files look like:


"Sky"
{
	"$baseTexture" "skybox/assaultBK"
	"$nofog" 1
	$ignorez 1
}


EDIT: I explored some skybox textures from other games and noticed that “sky” portion was lowercase. I edited the .vmts accordingly, but got the same results.

Did you see any errors in the in-game console after you did that? Does the env_sun work with stock skyboxes?

It does not work with the few default skyboxes I have access to, but none of them seem likely to be configured to work with env_sun. The console also makes no reference to env_sun or the skybox. I’m working with Portal 2, which never bothered to use this entity. It makes me wonder if this entity is broken in that game (as I highly doubt that it was ever used).

I would still love to get it working, though, if it’s possible.

In portal 2 you need to use UnlitGeneric for the skybox shader.

Valve broke a lot of features in the portal 2 branch. But you shouldn’t use “sky” as the shader name for it, otherwise it breaks the rendering of it.

Okay, thanks for the details. I can live without it. I might be able to make a work around with an env_sprite anyways, once I get a 3D skybox setup.