How does env_SkyPaint / sky editor work?

I looked through the lua files for both the sky editor entity and the “env_SkyPaint” entity in the Garry’s Mod content, and I can’t find where the actual painting of the skybox happens. It just looks like all networking, panel building, variable defining, and other “set-up” sort of stuff. Anyone know how it works??

It is an engine entity and it uses a shader to paint the sky. You can’t access it.

Ok, but how does the sky-editor entity access it?

I think the entity does not do anything, instead the engine gathers its key values?

What I believe is happening is that sky shader gets the env_skypaint entity and gathers it’s values, but sky editor uses env_skypaint:Set* functions to manipulate the sky colors, etc through env_skypaint.

Both entities are actually lua scripted, so you can see their code in gmod files, in gamemodes.

This all means that you need to modify the map in order to make it work with the skypaint. If that’s what you looked for.

Totally wrong.

All you need to do is



RunConsoleCommand("sv_skyname", "painted")
local ent = ents.Create("env_skypaint")
ent:Spawn()


And BAM. You get new sky.