Please read through this and test it before attempting a per pixel method.....
Part one.
------------------------------------------------------------------------------------
In the attemp to create a new fog / haze /smoke for a pluging im working on / FFX for some effects I had added in I just recently. I was playing around with a matrix for some angle calculations ( GO HERE FOR THE ANGLES HOW TO ) it struck me that there was an easy uniform way to create fog/smoke which was more realistic than what is currently availalbe in hl1.
First you will need some origins you can either grab the origin from a player_entity // map.ini // entity // ect..
Code:
v_origin[3]
//..""Ie: get_user_origin(id, v_origin, 3)""..
needs to be a non float number
Now we will decide on a
box/rectangle type, a
circle type,or a
sphere type.
We need to define the size of our area now use a matrix.
We'll decide.
for mediumsprites
Code:
size = 30// like 1 players side by side back to back
size = 60// like 2 players side by side back to back
size = 90// like 3 players side by side back to back
ect.
New Float:f_m_fogfield[32][3][size]
Code:
Define x_size
Define y_size
Define z_size
-----------------------------------------------------------------------------------
Now lets define the number of sprites we will create
(lower number less quality / more performance)
This is how many sprites per area ""( xyz ) = total area ""
Lets say our area
size is 100
and we have a perfect
box
now we need a good sprite...
Good sprite is the key... I will provide a few samples.
We will say about 70 sprites.. // the amount
the sprite will need to be lets say..
medium = 6
Code:
amount = (( fogfieldsize * 2 + height / ( height )) / z_layers == amt )
amount =(( 100 * 2 + 20 ) / height) / 4 == 55
So 55 sprites
..
For circle the whole format changes
Next : Creating your matrix