Toribash
Original Post
How to make a shader. All the different functions explained!
Please +rep for this, took lots of work to do.

(rgb=red green blue, bgr=blue green red)

STEP 1.
Open a shader file, read what each line does from my tutorial below, and edit numbers to suit your liking. then load the shader (/lws shadername.inc) and see what it looks like =p

background_color 1.10 1.00 1.00
~ If you make this dark it will darken whole landscape, if it's light it will lighten landscape. (rgb) it seems to determine fog colour too.

mirror_color 0.50 0.15 0.15
~ Reflections colour (rgb, except the colours are sometimes modified by

floor_color 0 1 0

~ Floor colour. (rgb)

sunshine_color 2 1.2 1.2
~ Light colour. (rgb)

ambient_color 0.4 0.4 0.4
~ Colour of the things that aren't getting any light. (dark areas =p) (rgb)

fog_distance 20
~ How far away the fog is (most of the time it's on horizon)

sharp_shadow 1
~ If you can see the tori's shadow. (if your shader is slow consider disabling this)
Originally Posted by Pirate
If sharp shadow is off the sun will be pixelated. If it is on, it will be a perfect cirlce and shaded well.


sky_on 1

~ If a sky hemisphere is drawn or not.

ambient_light_dir 0 0 1
~ (ty to pirate for figuring this function out) It seems to set how dark/light the shadows are.

sun_light_dir -23.5 -32.5 5

~ Where the sun is. (xyz axis)

sunbeam_color 0 0 1
~ The colours you find around the sun. (bgr)

sun_color 0 1 3
~ Colour of sun (bgr)

sky_color 0 0 1
~ Colour of sky (bgr)

polar_light_color -0.30 -0.20 -0.40
~ Polar lights look smexy, this is the colour of them. (brg)

polar_light_dir -0.69 0.69 0.21
~ This is the positon of the polar light. (xyz axis)

sky_blend_power 10.00
~ Play around with this, it seems to be how smoothly the different sky colours (the sun, normal colour and polar colour) mix togethor.

STEP 2. enjoy your shader and send me a copy! I want to see your shaders! (Don't send to me if you don't want your shader in a video, as if it's good I WILL use it)
Last edited by Jam0864; Dec 5, 2007 at 05:58 AM.