Jump to content

Particle Emitters Visible when Not in Line of Sight


Haydenmango
 Share

Recommended Posts

So I run into this issue quite often. I create a particle emitter and it won't start playing(or at least won't be shown playing) until I look at the particle entity.

 

For example if I place a 'rain' emitter above my players head(out of vision unless you look directly upward) it will not show until I look directly at it.

 

Is there anyway I can make particle emitters visible without looking at them before hand?

 

--edit-- also if you have a particle emitter following your character close to the camera (in my case a torch with a fire emitter) if you move to fast and the particles end up behind your camera (because they aren't spawning fast enough) they will stop showing until you look back to where they stopped showing.

So what happens is -

1 you have a torch with fire emitter,

2 you start to run,

3 the fire emitter particles don't spawn fast enough to keep up and end up behind the camera

4 the fire emitter particles stop spawning

5 if you keep running in the same direction the fire emitter will never show itself again. if you turn back to where the fire emitter stopped showing it returns to its position and shows itself again.

 

let me know if there is a workaround please, it would be much appreciated!

Not sure if this is really a problem but I decided to make a video showing the 'issue'.

 

https://www.youtube.com/watch?v=4__EL9S4M4s

  • Upvote 1
Link to comment
Share on other sites

Particle emitters don't update when they are offscreen. This is an optimization. If you can imagine a level with 100 torches, it definitely makes sense to only updates the ones that are actually visible. However, it results in exactly the behavior you show here. The sad music in your video makes the problem even more promounced! blink.png

 

This is really a design question. One obvious solution is to add a setting to control whether the emitter is always updated, or only updated when visible. But I wonder if there is a better way. Maybe the maximum possible AABB of the emitter could be used, based on its current settings?

 

These are the kinds of questions that make designing a game engine very interesting.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Well, there are definitely instances where you want the emitter to continue when off-screen. Two simple examples of this are missile exhaust trails and aircraft engine condensation trails. You'd want these types of emitters to ALWAYS emit no matter what so that you get the nice, long, trails that you'd expect without gaps, or the trail starting over when they came back in view.

 

Typically, as you suggest, you have a setting that allows you to state if an emitter functions when off screen. Personally, I'd find this implementation to be satisfactory with the assumption the default value would be as the system functions now....

 

Just my two-cents wink.png

  • Upvote 2

--"There is no spoon"

Link to comment
Share on other sites

I had a feeling this was the just the way the engine worked. The way it works now should definitely be the default but if there was a choice in the editor to turn on/off permanent visibility on emitters that would be very useful as I just can't seem to find a way to work around this. If turn emitter permanent visibility on/off could be changed through scripts that would be even more ideal!

 

Anyways thanks for the replies and I guess I should have posted this in the suggestion box. :P

Link to comment
Share on other sites

I'm probably just to noob to figure it out but I am having trouble increasing an emitters AABB. I can increase the AABB of a box easily by using the script examples in the documentation but it doesn't seem to translate to emitters.

If you have the time do you think you could throw me a little example of how this would work Shadmar?

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...