|
0 registered members (),
16,302
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
fog in an "empty" level
#242396
12/22/08 21:05
12/22/08 21:05
|
Joined: Oct 2008
Posts: 67
Crypton
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2008
Posts: 67
|
What I mean by that is: Can I create visible fog in an empty level (level_load("");)? In level there are right now only a plane and a skybox entities. I'd like to see fog from a distance. When I change camera position I can only see the difference due to fog on plane model. Any idea how to solve it?
#include <acknex.h>
#include <default.c>
/////////////////////////////////////////////
ENTITY* tegelane;
ENTITY* sky;
function main()
{
video_mode = 7;
level_load(""); //Loome tühja maailma
sky = ent_createlayer("skycube+6.tga",SKY | CUBE | VISIBLE,1); //Loome taevapildi
tegelane = ent_create("mig.mdl", vector(0,0,0), NULL);
//wait(1);
//c_setminmax(tegelane);
wait(2);
while (tegelane == NULL) wait(1); //Ootame kuni tegelane on loodud
camera.fog_start = 100; //.8 * camera.clip_far; // fog starts at 80% of clip range
camera.fog_end = 500; // total foggy at 90% of clip range
fog_color = 3;
camera.x = tegelane.x - 267;
camera.y = tegelane.y;
camera.z = tegelane.z + 112;
camera.tilt = -10;
}
Last edited by Crypton; 12/22/08 21:06.
New into Gamestudio and eager to learn it.. Stuff and games done in 2D: LINK
|
|
|
Re: fog in an "empty" level
[Re: Crypton]
#242485
12/23/08 13:49
12/23/08 13:49
|
Joined: Oct 2008
Posts: 67
Crypton
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2008
Posts: 67
|
Well I've got an idea. "Back in the days" when I learned Blitz3D there was an option to inverse model's mesh in runtime. So I scaled the sphere up, inversed it's mesh and applied fog that was visible! Creating sky that had a limited vision. I didn't find any instruction that I could do it in A7. I tried to do a box in WED big enough so that could react to fog, but then i can't see the skybox, and box must be very big too and might take way too much memory. It isn't very convenient. (I'm making somekind of plane game)
New into Gamestudio and eager to learn it.. Stuff and games done in 2D: LINK
|
|
|
Re: fog in an "empty" level
[Re: Crypton]
#242790
12/25/08 17:51
12/25/08 17:51
|
Joined: Oct 2008
Posts: 67
Crypton
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2008
Posts: 67
|
New into Gamestudio and eager to learn it.. Stuff and games done in 2D: LINK
|
|
|
Re: fog in an "empty" level
[Re: Tobias]
#242801
12/25/08 18:57
12/25/08 18:57
|
Joined: Oct 2008
Posts: 67
Crypton
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2008
Posts: 67
|
well yes that seems to be the case BUT, how can I create fog so that I can see the sky too ? I'm doing a little airplain game (for learning Lite C), so I'm in the air and I'd like to see some fog in the distance where other planes are coming towards me.
New into Gamestudio and eager to learn it.. Stuff and games done in 2D: LINK
|
|
|
Re: fog in an "empty" level
[Re: Crypton]
#243940
01/01/09 20:11
01/01/09 20:11
|
Joined: Oct 2008
Posts: 67
Crypton
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2008
Posts: 67
|
difficult topic :P?
any way doing it?
New into Gamestudio and eager to learn it.. Stuff and games done in 2D: LINK
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|
|
|