iVision - iPod Commercial Effect (stencil buffer test)


This release is kindof rough - it’s just a test of the new stencil rendering made available to GMod by Jinto. All NPCs and players are drawn black, props and static models are drawn white, and everything else is solid pink, green, blue, or orange (yes, that’s FOUR colors!). It’s meant more as an example of what the stencil buffer can do. I’m actually not sure if I used it right though, so feedback from anybody who knows more about the stencil library (like Jinto since he wrote it hint hint) would be appreciated. To install, just drop ivision.lua into your garrysmod/lua/postprocess directory.


and in case anybody was wondering, I made that combine soldier dance by setting him on fire. :smiley:


For another example of stencil buffers in action, check out Jinto’s L4D player glow effect: http://www.facepunch.com/showpost.php?p=18535481&postcount=300

:buddy: Cool!

So wait, is there a toggle command or anything? Or is it just a script the runs automatically?

It looks really nice, I’ll test it out later. Have a Pallet.

You can check/uncheck it like the bloom effect under the post-process menu.

Huh. Neato. Wait, does this cost a lot to use?

I set it up so the engine does most of the work, but it does draw every player and NPC twice, so it might be a little laggier if you have lots of NPCs and players in the level. Otherwise it’s pretty cheap. On my laptop I get a 10 fps hit when it’s turned on (bloom is a 20 fps hit).


If you want to buy it though, you’ll have to sell your dignity to Steve Jobs.

Apple products…

:O, this is exactly what i started writing last night. Seems you beat me to it good sir.

Awesome! I love this!:buddy:

Is there any way it can be made to also have ragdolls be black? I would like to do poses with this effect but the fact that it is NPC’s only makes it sort of useless in that aspect.

I don’t mean to ninja but basing myself on the code I think you could add this at around line 69 of the script :

	for _, ent in pairs( ents.FindByClass( "prop_ragdoll" ) ) do
		if ent:IsValid() and util.IsValidModel( ent:GetModel() or "" ) then

Absolutely brilliant.

Pretty neat, I need to learn how all of these new render functions work.

Now that’s a cool post process!

Neat and simple. This is really cool, and creative.

The ballad of black mesa II?
Very Cool effect.

You should make it so your gun is black too, I need it.

I need to see my GUN!

Holy crap that’s neat.

Do the ragdolls become black though?

It would be nice if there was some sort of basic gui, or even concommands, that would allow you to configure what colours different entities show up as.