Unity Asset - Zones, Fields, and Shields (Unity Pro & Free)

Zones, Fields, and Shields is a Unity asset designed to be a affordable solution for many needs like force fields, capture zones, damage telegraphs, trigger volumes, FX, and much more. The asset package contains four shaders. 2 shaders utilize depth render textures in Unity Pro to dynamically generate intersection lines and 2 shaders Fake that effect in a limited way but can be used in Unity free.

 

 

If  dynamically generated intersection lines are important to you, make sure you understand how to activate depth render textures in unity pro before you buy.

 

These shaders were made with and can be edited in Shader Forge  

 

This Asset Package Includes

- 4 shaders

- 20 textures

- 2 demo levels (Free & Pro)

- 22 example materials

- 22 example prefabs

 

I am the only one working on and responding to questions about this asset. Your patience is appreciated! :)

 

FAQ at the bottom of this page

ZFS - Unity Pro Documentation

 

ZFS_3D_Pro - Parameter Definitions & Notes

 

Notes

This shader is meant for use on 3d Objects in Unity Pro. The primary reason that Pro is required is because the shader utilizes camera depth render textures to generate dynamic lines wherever the camera sees mesh within edge detection distance of the mesh that has the shader applied. You can read more about camera depth and how to activate it HERE .

 

Shader Controls

Brightness - Takes the current values and multiplies them by the given value. This happens after everything else.

 

Intensity- Takes the current values and multiplies them by the given value. Afterwards it is clamped between .05 and .95 then run through the gradient color remap. The effect of doing this can push your values more to the right or to the left of the gradient you decide to use.  If you use solid color the effect will be much less noticeable.

 

Pan Speed - The speed at which the texture moves along is v coordinate.

 

Gradient Or Solid Color - This toggle controls if the shader re maps its black and white values to the gradient color texture or multiplies it by the solid color.

 

Gradient Color - This texture is used to re color the shader. it takes the black and white values then colors them accordingly. Darker values on the left and lighter values on the right. The way this is set up only requires this texture be 1 pixel in height and I recommend somewhere between 256 and 512 in width. only used if gradient or solid color is turned on.

 

Solid Color - Multiplies the final result of the shader by the specified color. Only is used if gradient or solid color is turned off.

 

Texture - The image used to add detail to the shader.

 

Gradient Texture Decay - Think of this texture as a whole bunch of gradients stacked on top of each other. Each pixel row representing a gradient of its own. This gradient is used to re map the values of the shader to be more or less visible in along certain ranges of values. Keep in mind that the shader is set up to only use one pixel row of this at a time. Which pixel row is dictated by the decay slider.  If you really want a unique look to your shaders this is the texture slot to do some experimentation with.

 

Decay - This slider decides which pixel row of the gradient texture decay to use.

 

Fresnel - This toggle will fade out geometry faces that are facing towards the camera out and keep one that are facing outwards. This allows you to add texture to a shader but still easily be able to see whats inside. If you want the shader to be solid throughout turn off this switch.

 

Make Same As Fresnel -  In general just keep this toggle at the same value as the fresnel toggle for best results. If your feeling frisky go ahead and experiment with them being opposite. Results may vary.

 

Fresnel Exponent - This controls how extreme the fresnel will be in your shader. Higher values push the glow more towards the edge while lower values allow the texture to bleed into the core.

 

Edge Detection - This enables or disables the dynamic edges that take advantage of the depth render textures. Essentially this works by searching distances behind each pixel of the object this shader is on to the next object behind it. Then it applies a gradient of 0 to 1 depending on how close the pixel is inside of the range of 0 to whatever value you put in the edge detection distance box. REQUIRES UNITY PRO & DEPTH RENDER TEXTURES

 

Edge Detection Distance - The distance the shader will search behind each pixel for a mesh behind it. REQUIRES UNITY PRO & DEPTH RENDER TEXTURES

 

Gradient Edge Detection - This texture is used to remap the values of the gradient given to us by the depth render texture. The result allows us to give any kind of visual quality to the edge as we want. Hard, soft, wavy, anything you like. REQUIRES UNITY PRO & DEPTH RENDER TEXTURES

 

Soft Texture - Enable this  if you want your texture to appear softer. Note that the gradient texture decay used in this example to the right is designed to have edges so use the alternative one that came in the asset bundle. A great example of a case to use this is the top left flat plane shader that is blue and yellow.

ZFS_Flat_Pro - Parameter Definitions & Notes

 

Notes 

This shader is meant for use on Flat Objects in Unity Pro. The primary reason that Pro is required is because the shader utilizes camera depth render textures to generate dynamic lines wherever the camera sees mesh within edge detection distance of the mesh that has the shader applied. You can read more about camera depth and how to activate it HERE .

 

Shader Controls

Brightness - Takes the current values and multiplies them by the given value. This happens after everything else.

 

Intensity- Takes the current values and multiplies them by the given value. Afterwards it is clamped between .05 and .95 then run through the gradient color remap. The effect of doing this can push your values more to the right or to the left of the gradient you decide to use.  If you use solid color the effect will be much less noticeable.

 

Pan Speed - The speed at which the texture moves along is v coordinate.

 

Gradient Or Solid Color - This toggle controls if the shader re maps its black and white values to the gradient color texture or multiplies it by the solid color.

 

Gradient Color - This texture is used to re color the shader. it takes the black and white values then colors them accordingly. Darker values on the left and lighter values on the right. The way this is set up only requires this texture be 1 pixel in height and I recommend somewhere between 256 and 512 in width. only used if gradient or solid color is turned on.

 

Solid Color - Multiplies the final result of the shader by the specified color. Only is used if gradient or solid color is turned off.

 

Texture - The image used to add detail to the shader.

 

Gradient Texture Decay - Think of this texture as a whole bunch of gradients stacked on top of each other. Each pixel row representing a gradient of its own. This gradient is used to re map the values of the shader to be more or less visible in along certain ranges of values. Keep in mind that the shader is set up to only use one pixel row of this at a time. Which pixel row is dictated by the decay slider.  If you really want a unique look to your shaders this is the texture slot to do some experimentation with.

 

Decay - This slider decides which pixel row of the gradient texture decay to use.

 

Mask - This toggle will activate the mask texture to fade out specified parts of the mesh.

 

Make Same As Mask -  In general just keep this toggle at the same value as the mask toggle for best results. If your feeling frisky go ahead and experiment with them being opposite. Results may vary.

 

Mask Texture - This texture is used to map visibility along the UV's.

 

Edge Detection - This enables or disables the dynamic edges that take advantage of the depth render textures. Essentially this works by searching distances behind each pixel of the object this shader is on to the next object behind it. Then it applies a gradient of 0 to 1 depending on how close the pixel is inside of the range of 0 to whatever value you put in the edge detection distance box. REQUIRES UNITY PRO & DEPTH RENDER TEXTURES

 

Edge Detection Distance - The distance the shader will search behind each pixel for a mesh behind it. REQUIRES UNITY PRO & DEPTH RENDER TEXTURES

 

Gradient Edge Detection - This texture is used to remap the values of the gradient given to us by the depth render texture. The result allows us to give any kind of visual quality to the edge as we want. Hard, soft, wavy, anything you like. REQUIRES UNITY PRO & DEPTH RENDER TEXTURES

 

Soft Texture - Enable this  if you want your texture to appear softer. Note that the gradient texture decay used in this example to the right is designed to have edges so use the alternative one that came in the asset bundle. A great example of a case to use this is the top left flat plane shader that is blue and yellow.

ZFS - Unity Free Documentation

 

ZFS_3D_Free - Parameter Definitions & Notes

 

Notes

This shader is meant for use on 3d Objects in Unity Free or Pro. Please note that the fake edge detection on this shader is static and NOT dynamic. Meaning the coordinates for the fake edge must be set manually.

 

Shader Controls

Brightness - Takes the current values and multiplies them by the given value. This happens after everything else.

 

Intensity - Takes the current values and multiplies them by the given value. Afterwards it is clamped between .05 and .95 then run through the gradient color remap. The effect of doing this can push your values more to the right or to the left of the gradient you decide to use.  If you use solid color the effect will be much less noticeable.

 

Pan Speed - The speed at which the texture moves along is v coordinate.

 

Gradient Or Solid Color - This toggle controls if the shader re maps its black and white values to the gradient color texture or multiplies it by the solid color.

 

Gradient Color - This texture is used to re color the shader. it takes the black and white values then colors them accordingly. Darker values on the left and lighter values on the right. The way this is set up only requires this texture be 1 pixel in height and I recommend somewhere between 256 and 512 in width. only used if gradient or solid color is turned on.

 

Solid Color - Multiplies the final result of the shader by the specified color. Only is used if gradient or solid color is turned off.

 

Texture - The image used to add detail to the shader.

 

Gradient Texture Decay - Think of this texture as a whole bunch of gradients stacked on top of each other. Each pixel row representing a gradient of its own. This gradient is used to re map the values of the shader to be more or less visible in along certain ranges of values. Keep in mind that the shader is set up to only use one pixel row of this at a time. Which pixel row is dictated by the decay slider.  If you really want a unique look to your shaders this is the texture slot to do some experimentation with.

 

Decay - This slider decides which pixel row of the gradient texture decay to use.

 

Fresnel - This toggle will fade out geometry faces that are facing towards the camera out and keep one that are facing outwards. This allows you to add texture to a shader but still easily be able to see whats inside. If you want the shader to be solid throughout turn off this switch.

 

Make Same As Fresnel -  In general just keep this toggle at the same value as the fresnel toggle for best results. If your feeling frisky go ahead and experiment with them being opposite. Results may vary.

 

Fresnel Exponent - This controls how extreme the fresnel will be in your shader. Higher values push the glow more towards the edge while lower values allow the texture to bleed into the core.

 

Edge Detection Fake - This switch either adds or removes the fake edging texture from gradient edge fake.

 

Gradient Edge Fake - This texture decides the look of the fake edging on the sphere. Use the Y offset value to move the edge up and down the example sphere.

 

Soft Texture - Enable this  if you want your texture to appear softer. Note that the gradient texture decay used in this example to the right is designed to have edges so use the alternative one that came in the asset bundle. A great example of a case to use this is the top left flat plane example that is blue and yellow.

 

ZFS_Flat_Free - Parameter Definitions & Notes

 

Notes

This shader is meant for use on Flat Objects in Unity Free or Pro. Please note that the fake edge detection on this shader is static and NOT dynamic. Meaning the coordinates for the fake edge must be set manually.

 

Shader Controls

Brightness - Takes the current values and multiplies them by the given value. This happens after everything else.

 

Intensity - Takes the current values and multiplies them by the given value. Afterwards it is clamped between .05 and .95 then run through the gradient color remap. The effect of doing this can push your values more to the right or to the left of the gradient you decide to use.  If you use solid color the effect will be much less noticeable.

 

Pan Speed - The speed at which the texture moves along is v coordinate.

 

Gradient Or Solid Color - This toggle controls if the shader re maps its black and white values to the gradient color texture or multiplies it by the solid color.

 

Gradient Color - This texture is used to re color the shader. it takes the black and white values then colors them accordingly. Darker values on the left and lighter values on the right. The way this is set up only requires this texture be 1 pixel in height and I recommend somewhere between 256 and 512 in width. only used if gradient or solid color is turned on.

 

Solid Color - Multiplies the final result of the shader by the specified color. Only is used if gradient or solid color is turned off.

 

Texture - The image used to add detail to the shader.

 

Gradient Texture Decay - Think of this texture as a whole bunch of gradients stacked on top of each other. Each pixel row representing a gradient of its own. This gradient is used to re map the values of the shader to be more or less visible in along certain ranges of values. Keep in mind that the shader is set up to only use one pixel row of this at a time. Which pixel row is dictated by the decay slider.  If you really want a unique look to your shaders this is the texture slot to do some experimentation with.

 

Decay - This slider decides which pixel row of the gradient texture decay to use.

 

Mask - This toggle will activate the mask texture to fade out specified parts of the mesh.

 

Make Same As Mask -  In general just keep this toggle at the same value as the mask toggle for best results. If your feeling frisky go ahead and experiment with them being opposite. Results may vary.

 

Mask Texture - This texture is used to map visibility along the UV's.

 

Edge Detection Fake - This switch either adds or removes the fake edging texture from edge fake texture.

 

Gradient Edge Fake - This texture decides the look of the fake edging on the plane.

 

 

Soft Texture - Enable this  if you want your texture to appear softer. Note that the gradient texture decay used in this example to the right is designed to have edges so use the alternative one that came in the asset bundle. A great example of a case to use this is the top left flat plane shader that is blue and yellow.

 

ZFS FAQ's

 

Q -  Is there any way to alleviate some of the pixelation/aliasing that is visible from close up on these shaders?

A - Yes and No.

(Yes) Most of this issue is due to texture sizes. Increasing texture sizes or increasing the number of times a texture is tiled on a mesh can greatly decrease this issue. Also note that the default decay texture is designed to be edgy so swapping it out for the alternate soft decay texture can help. Make sure to use whole numbers for the x value on 3D objects so you don't see the UV seams. If you want a shader that renders out a texture closer to that of the main texture simply disable the fresnel boxes and enable the soft texture option as seen in the top left flat plane example in the test levels.

(No) The tiny dots that are visible from close up along the inner edges of the texture are a problem I am having in Unity. Doing this technique in other engines doesn't usually have this issue. I was able to get rid of most of it by clamping the top end values at .95 but not everything could be gotten rid of.