• Render Target \ Texture \ RT Cams (Insurgency Scopes): Getting them to work properly?
    1 replies, posted
So I've been getting the old Insurgency: MC stuff onto a SWEP base, and in the process of doing so I realized that the sniper scopes display this [IMG]http://puu.sh/n6FTR.png[/IMG]. I've seen somebody get them to work in GMod before, but I wasn't sure how they went about doing it. Do I have to fiddle around with VMTs? Or is there something I have to do in my code? I do believe RT Cams were removed or something, but I have no idea if that's related to this issue. Any help would be greatly appreciated, I'd love to get these things in fully working order.
Well, the idea is as follows: Create a render target of a given square size. Change the $basetexture of the scope on your model to $basetexture of the rt. Before drawing the view model, set the render target to that one, create a viewport of the same size, and call render.RenderView, then restore the viewport and RT. It's really old code, [url=https://facepunch.com/showthread.php?t=1079050&p=29195790&viewfull=1#post29195790]but I used this back in 2011[/url] to make the ammo counter on the side of an avp pulse rifle model dynamic. If you desire a more modern example, Spy's Customizable Weapons ( and Firearms: Source pack, if I remember correctly ) features this on the scope attachments.
Sorry, you need to Log In to post a reply to this thread.