I’ve been working on a fog particle for the past day or so, and it looks fine as far as texture and such, problem is, the particles look the same even at a distance.
What I need it to do is fade into the distance (the further away you get, the lest likely you are to see it, aka the more transparent it is.
Problem is, while I know I should be able to do this with a shader (either by shader+script to change it based on distance, or just as a shader, I’m not even 10% sure how shaders work really)
So, I need some help XD.
I’ve downloaded the built-in shaders script package, and I have the original particle additive soft shader that I am currently using.
Shader "Particles/Additive (Soft)" {
Properties {
_MainTex ("Particle Texture", 2D) = "white" {}
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
Blend One OneMinusSrcColor
ColorMask RGB
Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) }
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
// ---- Dual texture cards
SubShader {
Pass {
SetTexture [_MainTex] {
combine texture * primary
}
SetTexture [_MainTex] {
combine previous * previous alpha, previous
}
}
}
// ---- Single texture cards (does not do particle colors)
SubShader {
Pass {
SetTexture [_MainTex] {
combine texture * texture alpha, texture
}
}
}
}
}
So how do I add something like alpha transparency that can be changed by a javascript or c# script.?