lxFirebal69xl Posted November 22, 2016 Share Posted November 22, 2016 I've been looking into making specific objects highlight when the player gets close to them. So far the closest thing I found is an old shader called edgeglow, but I have no clue how I would apply that to a model. This picture is kind of what I'm going for, but not as intensive, more just the actual outline of the entities. Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 23, 2016 Share Posted November 23, 2016 A quick and dirty way is to make a copy of the object, scale it slightly larger, and flip its normals. Script.highlight = Model:Load("Models/crates/crate_large.mdl", Asset.Unmanaged) function Script:Start() self.highlight:SetScale(1.01,1.01,1.01) self.hmat = Material:Create() self.hmat:SetColor(0,1,0,1) self.hmat:SetSortMode(true) self.highlight:SetMaterial(self.hmat) self.surface = self.highlight:GetSurface(0) self.surface:FlipNormals() self.highlight:SetPosition(self.entity:GetPosition()) self.highlight:SetParent(self.entity) end A more complicated way involves rendering to another buffer/world, performing an edge-detection/cartoon post process shader on the scene, and then drawing the results to your main world. Edit--Doing the quick and dirty way looks pretty decent once you set the zsort to true on the flipped material. 3 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted November 23, 2016 Share Posted November 23, 2016 You know you could use the edge detection routine to write values into the emission texture, and that wouldn't require any special fancy setup. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
shadmar Posted November 23, 2016 Share Posted November 23, 2016 A model fresnel shader will also do this, but since it uses normals, stuff like boxes and other very low poly stuff wil look not so good. A quick and dirty way is to make a copy of the object, scale it slightly larger, and flip its normals. this is neat and requires no special stuff. 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.