• Stencils to cut holes in things
    9 replies, posted
How do I get this, basically? [img]http://uppix.net/5/1/e/7d6ed149aa1f8a156fdf837951d83.jpg[/img]
[QUOTE=amkoc;37277483]How do I get this, basically? [img]http://uppix.net/5/1/e/7d6ed149aa1f8a156fdf837951d83.jpg[/img][/QUOTE] Photoshop?
[QUOTE=brandonj4;37277689]Photoshop?[/QUOTE] No, _Killburn [URL="http://www.facepunch.com/showthread.php?t=794887&p=19535140&viewfull=1#post19535140"]posted[/URL] that photo in WAYWO.
[QUOTE=zzaacckk;37277738]No, _Killburn [URL="http://www.facepunch.com/showthread.php?t=794887&p=19535140&viewfull=1#post19535140"]posted[/URL] that photo in WAYWO.[/QUOTE] I was being sarcastic. Also, you would use the render library for this. [highlight](User was banned for this post ("Not helpful" - Gran PC))[/highlight]
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. [url]http://facepunch.com/showthread.php?t=1202822[/url] I can't believe garrysmod is able to do this type of stuff now. Wow
[URL="http://www.facepunch.com/member.php?u=43804"]Ralle105[/URL] made a really good [URL="http://www.facepunch.com/threads/878986"]tutorial[/URL] on stencils, you should check it out.
[QUOTE=zzaacckk;37278779][URL="http://www.facepunch.com/member.php?u=43804"]Ralle105[/URL] made a really good [URL="http://www.facepunch.com/threads/878986"]tutorial[/URL] on stencils, you should check it out.[/QUOTE] 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. [img_thumb]http://cloud.steampowered.com/ugc/596979049402475552/0038ED6187826B48F10C1756C3F69DEE73B6E457/[/img_thumb] [code]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[/code] You can draw pretty much whatever you want inside DrawInterior(). [img_thumb]http://cloud.steampowered.com/ugc/596979049402585430/CBEA139959EA70DB3709C6126FE614AA06650B86/[/img_thumb]
[QUOTE=Jinto;37280318]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. [/QUOTE] Actually, completely different project! But I love you!
Sorry, you need to Log In to post a reply to this thread.