No farplane fog...

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

No farplane fog...

Post by Bjarne BZR »

I'm doing a winter map with low visibility. I've used farpalne before without problems, but now it does not work.

Farplane looks as if its working because the LOD terrain is clipped, its just that there is no fog effect at all :cry:

This is the fog scripting:

Code: Select all

$world farplane_color "0.5 0.5 0.6"
level.fogplane = 2000
$world farplane level.fogplane
The map currently only contains a big chunk of LOD-terrain and a skybox with the sky/m5l2 texture. Any ideas?
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Its something with the sky texture... because it works when I use common/skycaulk on the skybox.

But i dont WANT to use common/skycaulk! :cry:
Admin .MAP Forums
Image
Head above heels.
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

I found that several of the mission/level sky textures don't work well, if at all. Strange why. I actually would guess that they are some sort of placeholder that isn't really 'in-game' as I don't remember that many varied skys and many are hard to tell apart from others in the same mission group/name sequence.

Have you ever had luck matching any stock sky colors to your farplane? I've tried in hopes that you wouldn't have to use the sky caulk all the time to boost FPS, but all my attempts fail. The colors seem to match in the editor and PSP, but when you load up the map they're not even close. Just curious, as I'm pretty much ONLY using caulk/sky now.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

m4l0

Post by tltrude »

Yours would probably work if you used "$world farplane (level.fogplane)". This is from the m4l0 map:

Code: Select all

level waittill prespawn
	local.tempstring = "0.25 0.15 0.1"
	level.farplane = 25000
	level.farplanecolor = local.tempstring
You don't need the temp string stuff, unless you are going to change the farplanecolor during the game. Scripting farplane will overwrite what is set for worldspawn in the map.

Here is a thread I did that makes the farplane move in and back out when you throw a switch:

Code: Select all

farplane_on:

	$farplane_trigger waittill trigger
	$farplane_switch anim move
	$farplane_switch playsound lighthouse_lever
	$farplane_switch anim waittill animdone
	$bulb1_off hide
	$bulb1_on show
	$farplane_corona show
	$world farplane_color (.42 .42 .42)
	wait .1
	$world farplane 3900
	wait .1
	$world farplane 3800
	wait .1
	$world farplane 3700
	wait .1
	$world farplane 3600
	wait .1
	$world farplane 3500
	wait .1
	$world farplane 3400
	wait .1
	$world farplane 3300
	wait .1
	$world farplane 3200
	wait .1
	$world farplane 3100
	wait .1
	$world farplane 3000
	wait .1
	$world farplane 2900
	wait .1
	$world farplane 2800
	wait .1
	$world farplane 2700
	wait .1
	$world farplane 2600
	wait .1
	$world farplane 2500
	wait .1
	$world farplane 2400
	wait .1
	$world farplane 2300
	wait .1
	$world farplane 2200
	wait .1
	$world farplane 2100
	wait .1
	$world farplane 2000
	thread farplane_off
end

farplane_off:

	$farplane_trigger waittill trigger
	$farplane_switch anim idle
	$farplane_switch playsound lighthouse_lever
	$farplane_switch anim waittill animdone
	$bulb1_on hide
	$bulb1_off show
	$farplane_corona hide
	wait .1
	$world farplane 2100
	wait .1
	$world farplane 2200
	wait .1
	$world farplane 2300
	wait .1
	$world farplane 2400
	wait .1
	$world farplane 2500
	wait .1
	$world farplane 2600
	wait .1
	$world farplane 2700
	wait .1
	$world farplane 2800
	wait .1
	$world farplane 2900
	wait .1
	$world farplane 3000
	wait .1
	$world farplane 3100
	wait .1
	$world farplane 3200
	wait .1
	$world farplane 3300
	wait .1
	$world farplane 3400
	wait .1
	$world farplane 3500
	wait .1
	$world farplane 3600
	wait .1
	$world farplane 3700
	wait .1
	$world farplane 3800
	wait .1
	$world farplane 3900
	wait .1
	$world farplane 10000
	thread farplane_on
end
Hope that helps!
Tom Trude,

Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

level.fogplane is used by the weather.scr i think... or something... whaterver. I'll jast have to shop around for working skytextures then :?

Anybody know any good skytexture resources?
Here are one I know of:
http://www.teamhuh.net/raven/
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Anybody know why the fog wont come out? Is it something in the shader? Of the sky texture?
Admin .MAP Forums
Image
Head above heels.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

so your saying the fog will clip things at the clip plane, but there is no 'fog'? can you show a pic?




hey tltrude, couldnt u make those threads a little shorter like this?

Code: Select all

local.farplane = $world.farplane
while (local.farplane > 2000)
{
    wait 0.1
    $world.farplane = (local.farplane - 100)
    local.farplane = $world.farplane
}
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Alcoholic wrote:so your saying the fog will clip things at the clip plane, but there is no 'fog'? can you show a pic?
Yes: that is exactly what I'm saying. Well put.
And yes, here are some pictures:

The bad results with farplane set to 2000 ( or was it 3000? ):
Image

Same view with farplane set to 10000 ( Just to see what the LOD looks like "Over the hills and far away" ):
Image

The good results with the sky textured with common/skycaulk ( exept I want fog without using that boring texture ):
Image

Same view with farplane set to 10000:
Image

THE MAIN PROBLEM IS NOT THE FOG, ITS THAT I AM A MORON...
After making and seeing these pictures I realize that it actually works just fine... its just that the terribly short farplane clips the LOD in plain view of the player and the player can see straight down at the skybox... and as it is not really a fog, but a discoloring of far away faces: it looks absolutely crap ( but I'm afraid it is correct crap ).

By comparing the first and third picture, you'll se that the terrain is "fog-blended" correctly... its just that it looks crap when the sky is "clear".

:oops: :oops: :oops: and :oops: Sorry for wasting your valuable time by beeing stupid :cry:

And yes:
Alcoholic wrote:hey tltrude, couldnt u make those threads a little shorter like this?

Code: Select all

local.farplane = $world.farplane
while (local.farplane > 2000)
{
    wait 0.1
    $world.farplane = (local.farplane - 100)
    local.farplane = $world.farplane
}
I would use the looped version ( even if the result is exactly the same ).
Admin .MAP Forums
Image
Head above heels.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

farplane script

Post by tltrude »

It would be cool to have a seperate farplane testing script that mappers could use to find the right settings for their map. It would need keys set to adjust the color and distance. And, it should print the current values to the screen. It might end up being used by cheaters, though, to reduce the farplane fog.
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yeah matching fogs & skyboxes is always tricky. In my sp map I use a clear blue sky with some white clouds, but I still can't find a really suitable fog color. I use white fog but it looks silly near the blue sky :?
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

What about useing skychaulk on the walls of the sky box and a sky texture on the top . I wonder what that will look like ?
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

It will look like this:
Image

If you calibrate the fog color better and have a really high skybox... then maby you can get away with it... Ive got sunset colors on both fog and sunlight at the moment.
Admin .MAP Forums
Image
Head above heels.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Re: farplane script

Post by Alcoholic »

tltrude wrote:It would be cool to have a seperate farplane testing script that mappers could use to find the right settings for their map. It would need keys set to adjust the color and distance. And, it should print the current values to the screen. It might end up being used by cheaters, though, to reduce the farplane fog.
type 'pushmenu leveldesign' in your console during a map. theres a bar near the bottom left, and the farther it is to the right, the farther the fogplane is, the farther to the left, the closer, and if it's at the very left, it goes to your map defaults. to the right of that bar are some numbers u can type in to see what color the fogplane is.

just make a map with the sky you want, and try that tactic, and mess around with the colors until u find a good one.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I see that dosen't work I remembered that after I posted that it will look square . In the sample map for spearhead t2l1.map they use a simple patch mesh with a texture called t2fogplane it is a semitransparent texture a little like clouds . I looked for a shader for it but didn't find it in any of the shaders or I missed it , it may use tcscroll , or not . The mesh covers the whole map and they used skychaulk on the skybox . I know mohaa uses a tex called zorclouds maybe that will work or make a custom texture
Post Reply