Jump to content
The Dark Mod Forums

particle fog made easier


ungoliant

Recommended Posts

this is an interesting way to easily set up some nice even particle fog over a large or small area without using a single entity.

 

create a new material shader thus:

 

textures/darkmod/weather/fog
{
deform particle2 tdm_dustfog3
qer_editorimage //_black or choose some other editor image.
nonsolid
noshadows
{ //needed to emit particles
	blend filter
	map 	_white
}
}

 

create a patch and drag it low to the ground over the area you want. texture it with the new fog texture. done.

 

here is an example i made using NHAT politics graveyard. The other fog effects/lights were removed.

 

fogrh.jpg

 

once you've got the shader set up, its insanely simple to use, but be a little careful as too many particles of course can detriment performance.

 

edit: almost forgot, make sure your patch is facing upwards or I think the fog will likely be below ground.

 

for thicker fog, duplicate the patch, or replace particle2 keyword with particle.

Edited by ungoliant
Link to comment
Share on other sites

Thats the same technique we use for rain, but it can have problems.

 

Anyway, func_emitters now can have multiple particles, too. Whats missing is the SEED system (which you could use to generate them randomly) to combine them into one func_emitter. So there is more than one way.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

ungoliant did you use more than one patch? if i create a bigger patch for a "big" (900x700) area it is a very very very....thick fog and also my (high end) pc is getting down...

 

EDIT: ahh get it. my patch was subdivided and for every quad i get one fog...so with 100 fogs that was a bit overpowered^^

 

by the way is there a way to create more particleeff on one screen without getting down in perf so drastical ? if i have f e 20 fogs i have a fr of 30, without >60...and if i look to modern games...

is the problem the engine or is there a way for pushing?

Edited by Johannes Burock
Link to comment
Share on other sites

by the way is there a way to create more particleeff on one screen without getting down in perf so drastical ? if i have f e 20 fogs i have a fr of 30, without >60...and if i look to modern games...

is the problem the engine or is there a way for pushing?

 

sorry, let me make sure i'm getting this right. you are generating 20 fog particles in one area, with a framerate of 30, and without any fog, you get 60+ framerate?

 

hmm i am not exactly sure what goes into particle performance issues. but perhaps its possible that a particle like dustfog3 could be made into a larger particle effect, and thus use less particles total in the map, and maybe this would do the trick...

 

edit: JB, also, try disabling v-sync and run it again. that could be a quick fix. anytime you are measuring performance its much easier to keep vsync off because it doesn't clamp the framerate.

Edited by ungoliant
Link to comment
Share on other sites

sorry, let me make sure i'm getting this right. you are generating 20 fog particles in one area, with a framerate of 30, and without any fog, you get 60+ framerate?

 

hmm i am not exactly sure what goes into particle performance issues. but perhaps its possible that a particle like dustfog3 could be made into a larger particle effect, and thus use less particles total in the map, and maybe this would do the trick...

 

edit: JB, also, try disabling v-sync and run it again. that could be a quick fix. anytime you are measuring performance its much easier to keep vsync off because it doesn't clamp the framerate.

 

after disabling vs its about 4 / 6 fps better...but crysis 2 is running well on my sys. What is the problem here.

Here u have a example pic, i player around with SEED and fogs:

 

post-3575-130109078159_thumb.jpg

 

 

9x fog from ungoliants tex in a big patch

4x fog from ungoliants tex in small patches

3x dustfog as emitter

1x fog fgrom a lightfog

2x non dynamic lights

 

 

and when the fogs are away its running >60 fps

Link to comment
Share on other sites

if you are stacking fog particles on top of eachother the performance knock can be really big, especially in a large area. try not to overlap them too much. In the graveyard area i only used a single patch of fairly evenly spaced fog. The performance hit knocked down framerate by about 5.

 

edit: looks great btw! :wub:

Edited by ungoliant
Link to comment
Share on other sites

after disabling vs its about 4 / 6 fps better...but crysis 2 is running well on my sys. What is the problem here.

Here u have a example pic, i player around with SEED and fogs:

 

post-3575-130109078159_thumb.jpg

 

 

9x fog from ungoliants tex in a big patch

4x fog from ungoliants tex in small patches

3x dustfog as emitter

1x fog fgrom a lightfog

2x non dynamic lights

 

 

and when the fogs are away its running >60 fps

 

Some general remarks:

 

* a foglight is a light (duh! :) and *everything* it hits is rendered one more time (for the fog). So if you have ambient + fog light + some other light => 3 times rendered, compared to ambient + some other light => 2 times rendered. That can make quite a difference. So you might want to eliminate the foglight

* if you keep the foglight, I can give you details how to make it a "rolling 3D looking" fog. It uses the same performance, but looks better, and can save you some particles.

* each patch (texture) that spawns particles is a certain overhead, it is better to have 1 patch that spawns 20 particles vs. 2 patches with 10 each

* if you want more dense fog, it is better to change the texture instead of stacking them

* Also, instead of having 3x dustfog as emitter, use one emitter and multiple particles (I am not sure, but that might need v1.05). 3 entities with 1 particle are worse than one entity with 3 particles. Even better is one particle which just is bigger and emits simply 3 times as many particle sprites.

 

Btw, looks very nice! I really need to make more grass models :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Some general remarks:

 

* a foglight is a light (duh! :) and *everything* it hits is rendered one more time (for the fog). So if you have ambient + fog light + some other light => 3 times rendered, compared to ambient + some other light => 2 times rendered. That can make quite a difference. So you might want to eliminate the foglight

* if you keep the foglight, I can give you details how to make it a "rolling 3D looking" fog. It uses the same performance, but looks better, and can save you some particles.

* each patch (texture) that spawns particles is a certain overhead, it is better to have 1 patch that spawns 20 particles vs. 2 patches with 10 each

* if you want more dense fog, it is better to change the texture instead of stacking them

* Also, instead of having 3x dustfog as emitter, use one emitter and multiple particles (I am not sure, but that might need v1.05). 3 entities with 1 particle are worse than one entity with 3 particles. Even better is one particle which just is bigger and emits simply 3 times as many particle sprites.

 

Btw, looks very nice! I really need to make more grass models :)

 

 

 

 

the thinking in having 4 patches with fog was: 1 for the main fog and the other 3 for little parts with more dense fog...so the fog looks not so constant and so more realistic...

 

detailos for rolling fog is interesting...what can u tell?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 1 reply
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...