fog

Help Contents graphix fog
clearcolor pushmatrix

graphix.fog :enable :near :far :density :color


Definition:

to graphix.fog :enable :near :far :density :color

	to ondrawimage 
		output dll.graphix.fog 
	end
end

enable: (boolean) for enabling the fog it must be "true

near, far: (numbers) that show at what distance to start and to stop the fog effect (apparently near means the far point, far means the near point.) you can adjust them in this way: select a big range like this:

	fog "true 100 1 ....... 
then change the far parameter (it is called 'near') until you see that the far end of your object is fogged. then change the near parameter (called 'far) untill you see the front end of your object is fogged.

density: (number) is the density of the fog.

color: (rgb) is the color of the fog.

Usage:

make "onbeforedraw.clearcolor clearcolor 0 0 0
make "onbeforedraw.fog fog "true 33 20 0.3 rgb 0 0 0

clearcolor defines the background color of the opengl sceene. It must be the same as is the fog color (you can try what's going on if they differ)
	make "onbeforedraw.fog fog "true 75 65 0.1 rgb 0 0 0
75 means that every pixel which is 75 units away from the viewer will be entirely fogged (i.e. rgb 0 0 0).

65 means that every pixel which is 65 units or less away from the viewer will have its original color.

So all pixels at distances from 65 to 75 will have a collor between their original and the fog color

Examples:

References:

clearcolor pushmatrix