secondlife / jira-archive

2 stars 0 forks source link

[BUG-10242] PSYS_SRC_MAX_AGE breaks when replacing a particle system without it #596

Open sl-service-account opened 9 years ago

sl-service-account commented 9 years ago

Steps to Reproduce

Testing a particle system

Actual Behavior

While working with a particle script, I found that the particles were failing to show up if the PSYS_SRC_MAX_AGE parameter was set to a non-zero value. After some investigation, I determined that the problem only occurs if the new particle system is replacing one that was already present. In my case, an invisible "billboard" particle system I was using as a texture preloader. The problem does not occur if there was no pre-existing particle system.

This script reproduces the issue: http://pastebin.com/qhRiqP0K

Clicking it alternates between the preloader and the actual particle system. To repro, compile the script and then click the prim you place it into, and no particles will appear. Right clicking it to force an update will cause the particle to appear.

With the PSYS_SRC_MAX_AGE parameter, the viewer uses a timer that causes the particle system to eventually stop emitting particles, once the set amount of seconds have passed. I believe the issue is being caused because that timer is running on particle systems without PSYS_SRC_MAX_AGE, and it is not being reset before applying a new particle system.

Expected Behavior

Particle system should play normally.

Other information

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-10242 | | Summary | PSYS_SRC_MAX_AGE breaks when replacing a particle system without it | | Type | Bug | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Reporter | Zauber Exonar (zauber.exonar) | | Created at | 2015-09-11T16:54:48Z | | Updated at | 2017-05-08T23:30:32Z | ``` { 'Business Unit': ['Platform'], 'Date of First Response': '2015-09-11T16:06:21.259-0500', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'System': 'SL Viewer', 'Target Viewer Version': 'viewer-development', 'What just happened?': 'While working with a particle script, I found that the particles were failing to show up if the PSYS_SRC_MAX_AGE parameter was set to a non-zero value. After some investigation, I determined that the problem only occurs if the new particle system is replacing one that was already present. In my case, an invisible "billboard" particle system I was using as a texture preloader. The problem does not occur if there was no pre-existing particle system.\r\n\r\nThis script reproduces the issue: http://pastebin.com/qhRiqP0K\r\n\r\nClicking it alternates between the preloader and the actual particle system. To repro, compile the script and then click the prim you place it into, and no particles will appear. Right clicking it to force an update will cause the particle to appear.\r\n\r\nWith the PSYS_SRC_MAX_AGE parameter, the viewer uses a timer that causes the particle system to eventually stop emitting particles, once the set amount of seconds have passed. I believe the issue is being caused because that timer is running on particle systems without PSYS_SRC_MAX_AGE, and it is not being reset before applying a new particle system.', 'What were you doing when it happened?': 'Testing a particle system', 'What were you expecting to happen instead?': 'Particle system should play normally.', } ```
sl-service-account commented 9 years ago

Whirly Fizzle commented at 2015-09-11T21:06:21Z

I'm not sure if I'm dong something wrong, but following your repro on both Second Life 3.8.3 (304115) Aug 4 2015 20:44:48 (Second Life Release) and Firestorm, I'm not seeing any particles emitting from the box even when right clicking it. Max particle count is 8192 & I am able to see other particle sources without any problem.

Second Life 3.8.3 (304115) Aug  4 2015 20:44:48 (Second Life Release)
Release Notes

You are at 113.4, 129.5, 21.2 in Testylvania Sandbox located at sim10481.agni.lindenlab.com (216.82.51.187:13017)
SLURL: http://maps.secondlife.com/secondlife/Testylvania%20Sandbox/113/130/21
(global coordinates 332,657.0, 306,306.0, 21.2)
Second Life RC BlueSteel 15.09.04.304858
Release Notes

CPU: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (3491.93 MHz)
Memory: 16268 MB
OS Version: Microsoft Windows 7 64-bit Service Pack 1 (Build 7601)
Graphics Card Vendor: NVIDIA Corporation
Graphics Card: GeForce GTX 750/PCIe/SSE2

Windows Graphics Driver Version: 10.18.0013.5582
OpenGL Version: 4.5.0 NVIDIA 355.82

libcurl Version: libcurl/7.38.0 OpenSSL/1.0.1h zlib/1.2.8
J2C Decoder Version: KDU v7.2
Audio Driver Version: FMOD Ex 4.44.31
Qt Webkit Version: 4.7.1 (version number hard-coded)
Voice Server Version: Vivox 4.6.0017.21209

Built with MSVC version 1800
Packets Lost: 188/28,446 (0.7%)
sl-service-account commented 9 years ago

Zauber Exonar commented at 2015-09-11T21:11:03Z

You may need to rotate it by 180 degrees on its Y axis, or raise it up a few meters. It's a cone effect with a large radius, with the particles drawn inward. I tried to correct that when I pasted the script, but apparently I set PSYS_SRC_ANGLE_END to PI instead of TWO_PI, so it is producing particles in a hemisphere beneath it if you have (I am assuming) put it into a cube with no rotation.

sl-service-account commented 9 years ago

Whirly Fizzle commented at 2015-09-11T21:21:37Z

Hmm strange. I still don't see any particles at all when right clicking the repro object. I did raise it up and rotated it and also changed PSYS_SRC_ANGLE_END to TWO_PI and still nothing.

If I just plop your particle system in touch_start (http://pastebin.com/z6Cqr4Zh) and click the box, I do see the particles as expected each time I click the box.

sl-service-account commented 9 years ago

Whirly Fizzle commented at 2015-09-12T03:31:39Z

I'm still failing to see any particles at all if I left click/touch the box and then right click. I see no particles if I just keep left clicking the box fairly slowly either.

However, if I left click the box twice very quickly, I always see the particles with no right click needed and the bug doesn't reproduce. Here is a gif showing 2 sets of 2 rapid left clicks and the particles displaying: https://gyazo.com/e48c33dbc50bc48a88dae44a1fdec215

sl-service-account commented 9 years ago

Kyle Linden commented at 2015-09-14T16:47:51Z

Hi Zauber,

Please provide a reproducible scenario or we will be unable to verify this report.

Thanks

sl-service-account commented 9 years ago

Zauber Exonar commented at 2015-09-14T17:07:31Z

The repro was apparently tainted by some changes to how Second Life handles particles. Now, it seems that particle systems using PSYS_SRC_MAX_AGE do not restart when an object update is received for the prim they are set on. I have adjusted the script so that it will properly reproduce the issue:

http://pastebin.com/C1yATX3w

Here are the repro steps: 1) Rez a cube and place the script into its contents. 2) Left-click it once. Nothing will happen. 3) Left-click it again. Now the particle system will display properly. (note: if you need to repro again, reset the script)

Expected behavior is that the particle system will display on the first left-click.

Also, I should adjust the description of the bug: PSYS_SRC_MAX_AGE breaks a particle system using it when it replaces an existing particle system that does not use PSYS_SRC_MAX_AGE.

This issue can be worked around by first clearing the particle system with a call to llParticleSystem([]) before applying a new one. In fact, that workaround itself may suggest an easy solution for the problem: when the viewer applies a particle system to a prim, first check if there is already one, and then clear it before applying.

Or if the viewer is already clearing the old system before applying a new one, perhaps there is a variable or two that is not getting cleared properly.

sl-service-account commented 9 years ago

Whirly Fizzle commented at 2015-09-14T18:09:33Z

Reproduces as described for me now on Second Life 3.8.3 (304115) Aug 4 2015 20:44:48 (Second Life Release). Same system info as above.