Drawing stencil skybox walls?

This post is probably gonna seem dumb to most of you. Anyways…

I’m currently making an infinite map in GMod but I need to draw the skybox in another way than from the map itself. Is it possible to draw a textured box around the players eyes that only the world is seen through or something similar that could work?

Please pay attention to my question and not the fact I’m trying to make an infinite map.

EDIT: I used render.DrawSphere to draw a sphere with a million in radius around the player. Works perfectly. :slight_smile:

EDIT 2: I just realized entities get stuck if thrown past 16400 units… :confused:
Any way of fixing this? (Map itself is unlimited with no borders and the player can travel up to a million units away with no problem)

What you should do is override

GM:PreDrawSkyBox. Untested:
[lua]-- if you’re doing this in a gamemode you can use GM, otherwise you have to run this in an Initialize and use GAMEMODE instead

function GM:PreDrawSkybox()
– Draw whatever you want, no need to worry about depth or anything
return true – prevent the engine from drawing the default skybox
The reason I recommend overriding the gamemode function and not using

hook.Add is that returning true in hook.Add will prevent any other hook from running, while doing it in the GM/GAMEMODE function will not.