|
|
Low FPS layered Fog - As done with The kID game
#60376
12/10/05 22:38
12/10/05 22:38
|
Joined: Oct 2002
Posts: 2,256 Oz
Locoweed
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 2,256
Oz
|
I am back, and thus, another contribution. I am going to show and explain the techniques I used in making The kID game's volumetric fog, as well as, the d3d fog in conjunction with it. I could just paste the script here, but give me a few days and I will explain why I did things the way I did it and give some input on how to change the code depending how your camera operates, i.e., fps, orbit camera, ect, because, how your camera operates makes a big difference in how the layered fog should work to keep the FPS down and yet keep it looking good. I would put how one should handle layered fog into 3 catogories. 1) First Person or Chase Camera. (layered fog based on player pan only, could also be camera pan based actually) 2) Third Person Camera, where camera pan and player pan are not always the same. (layered fog based on camera pan and player pan. The hardest, as in The kID) 3) Orbit or Free Camera, where camera view is not linked with player pan at all. (layered fog based on camera pan only) I will explain the unique handling of low fps layered fog in each instance. Who knows, it might even be fun,  Loco PS, hope that makes some sense, if not, it will later.
Professional A8.30 Spoils of War - East Coast Games
|
|
|
Re: Low FPS layered Fog - As done with The kID game
[Re: Locoweed]
#60377
12/10/05 23:34
12/10/05 23:34
|
Joined: Oct 2002
Posts: 2,256 Oz
Locoweed
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 2,256
Oz
|
Let’s first consider what layered fog actually is, it is a bunch of sprites rendered at a certain general location facing a certain direction. Each sprite lasting a certain duration. The problem we most generally run into is that we create too many sprites for the layered fog, thus totally killing our FPS. We need to find the equilibrium of good visuals while not dropping our FPS to ridiculously low levels. Hmmm.. it's underway, 
Professional A8.30 Spoils of War - East Coast Games
|
|
|
Re: Low FPS layered Fog - As done with The kID game
[Re: Locoweed]
#60378
12/11/05 19:39
12/11/05 19:39
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
great  i've been trying to figure out how you did it all along (i was beta tester, untill i forgot my login codes for your forums, and thus not being able to login, nor did i get to contact you anymore XD, different story though). i am eagerly waiting to see how you did the codes  as a small request, could you make one non pdf as well, my pc for some reason cant handle acrobat reader, and screws up real bad with it installed  lotsa thanks! regards,
|
|
|
Re: Low FPS layered Fog - As done with The kID game
[Re: Helghast]
#60379
12/12/05 00:40
12/12/05 00:40
|
Joined: Oct 2002
Posts: 2,256 Oz
Locoweed
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 2,256
Oz
|
k, Dennis, I will try a non-pdf version too. It took me along time to get it working decently without a heavy FPS drag. Actually, it was very tough under the game circumstances with FPS being pushed to the limit already.
Loco
Professional A8.30 Spoils of War - East Coast Games
|
|
|
Re: Low FPS layered Fog - As done with The kID game
[Re: XNASorcerer]
#60381
12/12/05 02:27
12/12/05 02:27
|
Joined: Oct 2002
Posts: 2,256 Oz
Locoweed
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 2,256
Oz
|
I was considering asking for some simple example code of each of the possible camera situations that might occur, like, FPS, Third Person, etc. Because most of my code has too much extra stuff in it, but I just found Poly Starter Pack , I think I can get all the various fog situations in with that example code. There will be FPS, 3rd person cam where cam lags behind player pan, and also static cam, where camera pan has nothing to do with player pan. I think I can get all layered fog examples represented with that code and it's not real complicated if I remember right. So if you want to get a head start on what code I wil be using as an example, that will be it. It's woot, fun code anyway.  Cough, cough. So I will be working with that and have examples or the different camera modes done soon. Loco
Professional A8.30 Spoils of War - East Coast Games
|
|
|
Re: Low FPS layered Fog - As done with The kID gam
[Re: Pappenheimer]
#60384
12/12/05 23:05
12/12/05 23:05
|
Joined: Oct 2002
Posts: 2,256 Oz
Locoweed
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 2,256
Oz
|
Sure Matt, It is just some low FPS drag volumetric fog that blows with wind. It's a bit hard to see what it actually is doing with a screenie, but here is an example. Loco
Professional A8.30 Spoils of War - East Coast Games
|
|
|
Re: Low FPS layered Fog - As done with The kID gam
[Re: Locoweed]
#60385
12/14/05 21:51
12/14/05 21:51
|
Joined: Oct 2002
Posts: 2,256 Oz
Locoweed
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 2,256
Oz
|
Ok, I have started ont this, I have along ways to and will eventually explain what variables to change to make it work more the way you want, but this is the starting point, the fog.wdl is tha script you should most be concerned with. There alot of variables invloved to get it tweaked for your situation, this is just the first example, I will eventually explain how to make it work more like you want it to be. Like most code. it will just be a guide, but I will try to explain what variables to change to make it work with your situations as well as some of the techniques I found crucial for keeping it from dropping FPS drastically. You can always add more layers and change stuff up like delay time between fog layers showing up, I will do my best to explain the concept here soon. I hope everyone finds this contribution enjoyable and useful. I would first just recommend standing in one place and get a grip on what is happenning with the fog, then later when I explain the changes for your specific game sutuation, it might make more sense. Just stand still and don't move player and watch the fog to start with. Observe how it flows, heh, like anyone will do that, programmers are already looking at code, lol. There are 14 layers of fog, 2 of those 14 layers are set to bright. 1/2 of the layers of fog are stationary, the other 1/2 moves with wind. Hmm., I think. The fog alternates from a near layer to a far layer, so if we have 14 layers, the fog effects might go like this, layer 1, layer 7 layer 2, layer 8, layer 3 , layer 9, to keep the fog effect looking good, not layered 1,2,3,4, etc.. Doesn't really matter if you have 50 layers of fog being spawned every 1/2 second, I am just giving you a good base to start with, just remember the better looking layered fog you have, the less FPS you have, I would use this code as a base. It's definately a good starting point. I worked along time on getting a decent layered fog that was FPS cool, believe me. Layered Fog Start Loco
Professional A8.30 Spoils of War - East Coast Games
|
|
|
|