i’m not even sure what to call this i’ve seen a lot of names for this bokeh lens flare , Dirt effect ?
anyone got a tutorial how to do this in unity pro ? i don’t want ready to use and worthless packages! real tutorials or atleast give me an idea how to do this ?
plz response this is important for me!!
That is a pretty broad question but yes the effect is called bokeh and the BF effect simulates light glare on the camera. To get a similar effect you’ll need a simple semi-transparent GUI Texture and some very basic script.
-
Using Photoshop start by creating your GUI Texture with the bokeh effect. A series of semi-transparent, slightly blurred circles work well. Ensure they’re set with a transparency and save your final image with an alpha channel.
-
In Unity place your GUI Texture in the scene and apply a transparency shader. You should see the bokeh texture on screen and be able to see through it.
-
With script we want the bokeh to only show when a light source is in view. You could do this by placing a script on the GUI Texture which checks for items with a specific tag. If “tag” is visible, turn on bokeh. Alternatively you could attach your script to the light itself, so when visible the GUI Texture is enabled. Example:
function OnBecameVisible() {
guiTexture.enabled = true;
}function OnBecameInVisible() {
guiTexture.enabled = false;
}
You can create a simple similar looking effect by placing a plane in front of the camera, which contains a texture with desired ‘dirt’, then you could use a particle shader such as multiply altough that would give a very static effect. There are youtube tutorials how to get better results with this technique.