Archive: Surface fading


18th March 2003 11:47 UTC

Surface fading
I got a question.

How to make a surface fade in the distance?

I use the following code to make a surface:


d=d/((y*2.2+3)*2)


Now this works perfectly, but if i make the last 2 bigger (for example 5) it gets a little messy in the further parts of the surface.

Is there an easy way to make a sort of fade or smog in that distance? Any help would be greatly appreciated,

Thanks in advance,

Deamon

18th March 2003 12:01 UTC

You want to use alpha blending. Search the forums to figure out how.


18th March 2003 15:47 UTC

ok, I will. Thank you.


19th March 2003 05:29 UTC

finished?


19th March 2003 22:34 UTC

wtf are you talking about, shreyas....the thread was ended, don't drag it out


20th March 2003 10:44 UTC

ok, since something about movement is started, i wanted to ask a question, but didnt want to start a new thread for it, because it is probably stupid.
in static movment for polar coord d=0..1. then how does d=-d work.
does avs convert polar into rectangular coords?


20th March 2003 12:04 UTC

It reverses the distance from the center of the screen for each pixel. This effectively rotates it about the origin(I believe).


21st March 2003 08:37 UTC

so id d=-1 then does avs convert it into rect coords so:
x=sin(r)*d;
=sin(r)*-1
y=cos(r)*d;
=cos(r)*-1;
i think this will rotate the thing, otherwise how can distance be negative?


21st March 2003 15:57 UTC

Arg, my reply didn't post. :mad:

Imagine a series of lines all going through origin (d=0). Each point on the screen is identified a distance down the line. When d is negative, it goes down the line in the opposite direction.


21st March 2003 20:15 UTC

Shreyas: ALWAYS start a new thread if it's about something else. Adding stuff to non-related threads makes the forum harder to search.


22nd March 2003 05:10 UTC

ok, I will remember