Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
fog in an "empty" level #242396
12/22/08 21:05
12/22/08 21:05
Joined: Oct 2008
Posts: 67
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

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?

Code:
#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
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

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
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

Joined: Oct 2008
Posts: 67
Help still needed.


New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK
Re: fog in an "empty" level [Re: Crypton] #242791
12/25/08 18:12
12/25/08 18:12
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
For activating fog you need two things

set a fog color (fog_color = 3;)

and set the color values of that fog color

vec_set(d3d_fogcolor3,vector(...));

You will see the fog only on the entities in the level, not on the sky because sky is unaffected by fog.

Re: fog in an "empty" level [Re: Tobias] #242801
12/25/08 18:57
12/25/08 18:57
Joined: Oct 2008
Posts: 67
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

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
C
Crypton Offline OP
Junior Member
Crypton  Offline OP
Junior Member
C

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

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1