Jump to content
The Dark Mod Forums

Rain particle problem


Sotha

Recommended Posts

There is something weird going on with rain particles.

 

When I look up, rain looks ok. When I steadily lower my view towards the ground the particles mystically disappear at a certain viewing angle. Then the particles reappear below certain point and disappear again when almost looking at the ground. Is this a known bug or am I doing something wrong? The rain is emitted by a patch with texture textures/darkmod/weather/rain_light

 

Here is a picture where I lower my view: r_showtris is enabled for easy particle visibility.

7227845.png

See how the rain is totally gone in the 4th and last image.

 

Moving the rain patch towards the ground alters the angle where the particles disappear. To get a situation where the rain does not disappear at all, I had to bring the patch so low that the player can easily see that the rain does not come far from the sky. This must be bug, right? The rain particles fall quite a distance, but to avoid particle disappearance at some viewing angles the rain emitting patch has to be awfully low.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I think this problem is not limited to rain particles. If I remember correctly I also spotted this misbehavior with some other particles. Something of a similar weirdness-factor is the sky turning to awkward colors at certain angles.

Link to comment
Share on other sites

The smaller you split up your rain patches the easier it is for them to get culled by the view frustum, once your rain patch is out of view it stops drawing the particles too.

I think using emitters is the better way to go. I did tests and the performance is better, they don't get culled and they keep the correct rain density. The problem is you have to place one every 100 units so I was going to make new versions that are larger so you don't need to place as many.

Link to comment
Share on other sites

I can't say this for a fact, but this issue may be related to the way we have to reorient the camera to take a snapshot of the lightgem every so often to get our readings. This part of Doom 3 is closed source, so waaaaay back when Sparhawk worked on this...he had to do some...sleuthing to figure out how to access the camera to get the snapshot. There was a lot of experimenting to avoid particle flickering and other anomalies, this may be one of them. Unfortunately, we probably won't be able to do anything about it until the game is open sourced.

Link to comment
Share on other sites

The smaller you split up your rain patches the easier it is for them to get culled by the view frustum, once your rain patch is out of view it stops drawing the particles too.

I think using emitters is the better way to go. I did tests and the performance is better, they don't get culled and they keep the correct rain density. The problem is you have to place one every 100 units so I was going to make new versions that are larger so you don't need to place as many.

 

Mysterious. For me it works the other way around:

Weather textured patche particles are visible even if the patch itself is not visible. There are only those magic angles when the particles disappear.

With func_emitter all the particles vanish as soon as the emitter entity has left the players view, so the functionality is even worse.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Wonder if it would help to turn the patches into a func_static and somehow forcing larger bounds on the entity.

Just a wild guess tho.

 

My patches are currently func_statics with spawnargs

dist_check_period 0.5

dist_check_xy 1

hide_distance 500

 

These are used so that the patches are hidden when the player goes far enough in order to save performance.

Do note that these do not do anything at present since LOD system was broken in v1.03.

 

I just wonder if v1.02 had this certain-angle-disappearing-particles-issue. I did a lot of tests with rain on v1.02 when I built the rain patches and tested that the hide_distances are just perfect. I do NOT remember that the particles disappeared mysteriously. It might be that maybe the problem was introduced by v1.03? But I cannot be certain since I can't go back 1.02 and test. :(

 

EDIT: Oh and I tested a rain brush instead of rain patch. No dice.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I just wonder if v1.02 had this certain-angle-disappearing-particles-issue. I did a lot of tests with rain on v1.02 when I built the rain patches and tested that the hide_distances are just perfect. I do NOT remember that the particles disappeared mysteriously. It might be that maybe the problem was introduced by v1.03? But I cannot be certain since I can't go back 1.02 and test. :(

 

EDIT: Oh and I tested a rain brush instead of rain patch. No dice.

 

Good question, but since the LOD is completely ignored in v1.03 it might be. Would you be willing to test a patched TDM game file with only that thing fixed?

 

(Sorry, time here has been very limited, why is it that everone wants suddenly to be social just because it is the end of the year?)

"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

Good question, but since the LOD is completely ignored in v1.03 it might be. Would you be willing to test a patched TDM game file with only that thing fixed?

 

It depends. If it is only rename old file, copy new file in, try, delete new file, rename old file back kind of test, then sure no problems. If it involves complicated whole TDM tweaking, then probably not.

 

(Sorry, time here has been very limited, why is it that everone wants suddenly to be social just because it is the end of the year?)

 

Maybe holidays? People have lots of extra time. At least I do before the end of this week.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

It depends. If it is only rename old file, copy new file in, try, delete new file, rename old file back kind of test, then sure no problems. If it involves complicated whole TDM tweaking, then probably not.

 

It would just involve a replacement of tdm_game01.pk4 or 02 if you are on linux. Are you on windows?

 

Maybe holidays? People have lots of extra time. At least I do before the end of this week.

 

Yes, but then they want to me to spent *my* time with them and I up with *zero* time for myself. Something doesn't sound right about this to me :)

"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

I still have a 1.02 install. If you have a test map I could try it in both 1.02 and 1.03 to see the difference from the same place/angle.

 

Hey, this is great, and does not take Tel's time! (yeah, I'm on windows) I'll make a testmap as soon as I have DR time.. This will happen later today.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Okay, here is a simple test map.

 

  • The first room has the rain patch high: there is a long angle range when looking downwards when the particles disappear
  • The second room has the patch at medium height: there is a short angle range without particles
  • The third has the patch at low height: there is no particle disappearance at all.

http://www.mediafire...65yfq6u17o9n4aa

 

I am really interested to hear the results of your test.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I wanted to know some numbers: how many units roughly the rain patch must above ground to avoid weird angle disappearance?

 

7232799.png

 

The rain falls roughly 480 units (max fall distance). When the player is closer than 192 units to the patch, the disappearance issue is gone. This shows that the disappearance makes rain patches somewhat ineffective: the particles fall a long distance, but glitch-free usage requires very low placement of the rain patch.

 

Let's hope LOD enabled this is fixed.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Yep. No need to test in 1.03. I see this problem immediately in 1.02 so it's not an update change.

 

This is an interesting find because in Den I necessarily had a lot of patches at low heights over roofs etc. so basically I just fiddled around until I got it all working reasonably. But in Storm I noticed it was difficult here and there the rain wasn't showing how it ought and again I just bodged it best I could.

Link to comment
Share on other sites

Yep. No need to test in 1.03. I see this problem immediately in 1.02 so it's not an update change.

 

This is an interesting find because in Den I necessarily had a lot of patches at low heights over roofs etc. so basically I just fiddled around until I got it all working reasonably. But in Storm I noticed it was difficult here and there the rain wasn't showing how it ought and again I just bodged it best I could.

 

Drat. If the particle max fall distance was increased threefold, could it also increase the no-particles-at-certain-angles threshold also threefold?

 

particle tdm_rain_light {
{
	count 	200
	material			textures/particles/drop2
	time				1.000
	cycles				0.000
	bunching			1.000
	distribution		rect 50.000 50.000 32.000 
	direction			cone "0.000" 
	orientation			aimed 1.000 0.050 
	speed	 "-300.000" to "300.000"
	size	 "0.500" 
	aspect	 "1.000" 
	randomDistribution				1
	boundsExpansion				0.000
	fadeIn				1.000
	fadeOut				1.000
	fadeIndex				1.000
	color 				0.040 0.040 0.050 1.000
	fadeColor 			0.039 0.043 0.047 1.000
	offset 				0.000 0.000 -20.000
	gravity 			world 500.000
}
}

 

Anyone happen to know which one of these properties control the maximum fall distance?

 

EDIT: solved. I increased the time to 3.0.

Now the rain falls very far down, much more than with time 1 setting. But the particles still disappear at the same level, so this approach is useless.

I think this has something to do with player-to-patch distance.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Could it be the orientation of the particles? Is the player looking at them edge-on at certain angles?

 

I do not think so. Remember, the rain does not disappear if the player is close enough to the emitting rain patch. Doesn't this exclude the possibility of edge-on invisibility?

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

 

particle tdm_rain_light {

{

count 200

material textures/particles/drop2

time 1.000

cycles 0.000

bunching 1.000

distribution rect 50.000 50.000 32.000

direction cone "0.000"

orientation aimed 1.000 0.050

speed "-500.000"

size "0.500"

aspect "1.000"

randomDistribution 1

boundsExpansion 0.000

fadeIn 1.000

fadeOut 1.000

fadeIndex 1.000

color 0.040 0.040 0.050 1.000

fadeColor 0.039 0.043 0.047 1.000

offset 0.000 0.000 240

gravity 0

}

}

 

 

Change the gravity to 0, speed to -500 and the z offset to 240. Now the patch is in the middle of the rain instead of the very top, this makes it harder for the patch to go off screen while looking at the raindrops.

And since it is the speed of the particles making them fall and not gravity you can angle them for wind effects.

post-3470-129380815595_thumb.jpg

Link to comment
Share on other sites

Change the gravity to 0, speed to -500 and the z offset to 240. Now the patch is in the middle of the rain instead of the very top, this makes it harder for the patch to go off screen while looking at the raindrops.

And since it is the speed of the particles making them fall and not gravity you can angle them for wind effects.

 

Hey this is good!

 

Results for this setup:

7235788.png

Upwards disbelief means that above this level it is easy for the player to spot the rain isn't coming far from the sky when looking upwards.

 

This setup is good enough for my purposes, a map on mostly xy plane. However, if a vertical mission wants to use rain it might require stacking of these patches at definate intervals, which may be difficult to make look good.

 

But this solves my problems and it increases useable range from 192 units to 288 units. It may be that by clever increase of particle lifetimes and the offset the useable range can be increased even further. I am also very interested in the wind effects.

 

Thank you very much for your help!! :)

 

EDIT: I quickly tested setting boundsexpansion to 2, but I didn't see any effect.

Clipper

-The mapper's best friend.

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.
      · 0 replies
    • 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...