How do I get this, basically?
Photoshop?
I was being sarcastic. Also, you would use the render library for this.
(User was banned for this post ("Not helpful" - Gran PC))
Sarcasm doesn’t help OP. Nor does a reference to a library. If you can’t supply the information he’s looking for, you shouldn’t make such awful posts.
I think this is related. I don’t think it is possible to do a clip plane on the world though. Or a stencil test for that matter.
http://forum.facepunch.com/showthread.php?t=1202822
I can’t believe garrysmod is able to do this type of stuff now. Wow
I did, it’s nice but it doesn’t say much more than the wiki did.
I’m guessing this is related to the question you asked me in PM? I sat down and wrote you a template for the effect you asked me about.
You just need to fill in DrawOverlay() and DrawInterior() with whatever you want to draw.
function ENT:DrawMask( size )
local pos = self:GetPos();
local up = self:GetUp();
local right = self:GetRight();
local segments = 12;
render.SetColorMaterial();
mesh.Begin( MATERIAL_POLYGON, segments );
for i = 0, segments - 1 do
local rot = math.pi * 2 * ( i / segments );
local sin = math.sin( rot ) * size;
local cos = math.cos( rot ) * size;
mesh.Position( pos + ( up * sin ) + ( right * cos ) );
mesh.AdvanceVertex();
end
mesh.End();
end
function ENT:DrawInterior()
end
function ENT:DrawOverlay()
end
function ENT:Draw()
render.ClearStencil();
render.SetStencilEnable( true );
render.SetStencilCompareFunction( STENCIL_ALWAYS );
render.SetStencilPassOperation( STENCIL_REPLACE );
render.SetStencilFailOperation( STENCIL_KEEP );
render.SetStencilZFailOperation( STENCIL_KEEP );
render.SetStencilWriteMask( 1 );
render.SetStencilTestMask( 1 );
render.SetStencilReferenceValue( 1 );
self:DrawMask( 48 );
render.SetStencilCompareFunction( STENCIL_EQUAL );
-- clear the inside of our mask so we have a nice clean slate to draw in.
render.ClearBuffersObeyStencil( 0, 0, 0, 0, true );
self:DrawInterior();
render.SetStencilEnable( false );
self:DrawOverlay();
end
You can draw pretty much whatever you want inside DrawInterior().
Actually, completely different project!
But I love you!