phetsims / wave-interference

"Wave Interference" is an educational simulation in HTML5, by PhET Interactive Simulations.
MIT License
19 stars 5 forks source link

Light screen behavior has changed #421

Closed KatieWoe closed 5 years ago

KatieWoe commented 5 years ago

Test device Dell Operating System Win 10 Browser Chrome Problem description For https://github.com/phetsims/QA/issues/389 (both sims) I noticed that the screen on the light scenes seems to behave differently than in the published version. The screen gets much brighter, and takes longer to go dark when the light stops. It also looks a bit odd as it goes dark. If this is the new intended behavior, please close.

Visuals Old behavior https://drive.google.com/file/d/1ayu1VQbY85iivcCTmZhqcZV6TqpNghtS/view?usp=sharing New behavior https://drive.google.com/file/d/1l_Zq1hiueCQ3TIq0DptV56EmLl6gcPSj/view?usp=sharing Troubleshooting information:

!!!!! DO NOT EDIT !!!!! Name: ‪Waves Intro‬ URL: https://phet-dev.colorado.edu/html/waves-intro/1.0.0-dev.10/phet/waves-intro_en_phet.html Version: 1.0.0-dev.10 2019-07-30 22:20:16 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 Language: en-US Window: 1536x722 Pixel Ratio: 2.5/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 4096 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
samreid commented 5 years ago

I believe we intentionally changed the behavior as part of https://github.com/phetsims/wave-interference/issues/349, but I'll leave it open to see if @arouinfar concurs.

arouinfar commented 5 years ago

I believe the brighter screen was an intentional part of #349, but the decay time is pretty lengthy and seems unintentional to me. Can you look into it @samreid?

I remember at one of our more recent design meetings, @kathy-phet also mentioned the decay time as a general concern, perhaps because it was unintentionally lengthened?

samreid commented 5 years ago

In https://github.com/phetsims/wave-interference/issues/208 we settled on a history length of 90. Then when we increased the lattice size in https://github.com/phetsims/wave-interference/issues/315 we scaled it up by a factor of CALIBRATION_SCALE = 1.82 because we had to run the clock that much faster to get the same wave speed (due to the larger lattice). @arouinfar can you please review those issues and recommend how to proceed?

UPDATE: We don't necessarily have to use the same CALIBRATION factor for the light screen history length. Let me know if you want to try a different value for it.

arouinfar commented 5 years ago

@samreid I don't think the calibration scale should be applied to the history length. Can you decouple them, and restore the history length to 90?

samreid commented 5 years ago

I implemented the proposed strategy in the commit, @arouinfar can you please review on phettest and close if all is well?

arouinfar commented 5 years ago

@samreid thanks, the decay time is now the same between master & latest, but the decay itself looks a bit different.

These gifs show the time it takes from turning off the source to the screen going black. Both cases take the same amount of time (within experimental error). In master the decay appears more suddenly, and is more gradual in latest. Mostly likely, this is related to changes in boosting the screen brightness, and may be unavoidable. If that's so, feel free to leave as-is @samreid. However, if there is some straightforward/low-cost way of making the fade more gradual like it is in latest, it might be worth tackling.

Master

master

Latest Published

latest

samreid commented 5 years ago

I tested 3 factors to see which contributed to this change:

  1. The TemporalMask which drops the values to 0 instead of leaving them noisy
  2. The larger averaging window used in Waves screen and Waves Intro, described here https://github.com/phetsims/wave-interference/issues/349#issuecomment-480038776
  3. The nonlinear function that maps intensity to brightness, which is described in https://github.com/phetsims/wave-interference/issues/349#issuecomment-480413963 and below

I found the primary or only factor in this delayed dropoff is (3) the nonlinear function that maps intensity to brightness. When I removed the nonlinearity and adjusted the brightness by 2x, the decay happens gradually. With the nonlinearity, the decay happens suddenly because the nonlinearity is shaped like so:

image

That is, a gradual decrease in intensity leads to a sudden drop in brightness around intensity=0.5. However, when I remove the nonlinearity, all of the problems described in https://github.com/phetsims/wave-interference/issues/349#issuecomment-480413963 and below return.

@ariel-phet or @arouinfar can you please advise how to proceed?

samreid commented 5 years ago

Also, one more follow-up question--I noted the intensity point at intensity = 0.13, brightness = 0.7 looks a little low. I recommend bumping that up to 0.74 to round out the curve like so (if we are sticking with the nonlinear function):

image

@ariel-phet or @arouinfar sound OK?

ariel-phet commented 5 years ago

@samreid that sounds like a good strategy to try.

samreid commented 5 years ago

@samreid that sounds like a good strategy to try.

Which strategy are you referring to?

UPDATE: Clarifying to provide context. In https://github.com/phetsims/wave-interference/issues/421#issuecomment-519902350 I found that the nonlinearity in the mapping from intensity to brightness is responsible for the sudden dropoff. However, the nonlinearity was introduced specifically to solve other problems described in https://github.com/phetsims/wave-interference/issues/349#issuecomment-480413963.

arouinfar commented 5 years ago

I found the primary or only factor in this delayed dropoff is (3) the nonlinear function that maps intensity to brightness. When I removed the nonlinearity and adjusted the brightness by 2x, the decay happens gradually. With the nonlinearity, the decay happens suddenly because the nonlinearity is shaped like so:

Ah, thanks for investigating @samreid. The non-linearity was pretty essential in reducing the appearance of interference patterns in the screen for a single source. I think the decay behavior in https://github.com/phetsims/wave-interference/issues/421#issuecomment-519718479 is an acceptable trade-off. I certainly don't love it, but I dislike it a whole lot less than single-source interference patterns.

ariel-phet commented 5 years ago

@samreid you asked in https://github.com/phetsims/wave-interference/issues/421#issuecomment-519903944 if:

I recommend bumping that up to 0.74 to round out the curve like so (if we are sticking with the nonlinear function):

sounded OK, I was saying that seems worth trying.

samreid commented 5 years ago

Thanks, I rounded out the brightness vs intensity curve as described above. The change is subtle and may be difficult to identify during testing. I tested the behavior described in the top comment and it is basically the same.

It seems there is nothing left to do for this issue. Tagging @KatieWoe so she is aware of our (a) our decision to keep this behavior described in https://github.com/phetsims/wave-interference/issues/421#issuecomment-520285200 and (b) the minor change in the curve described in https://github.com/phetsims/wave-interference/issues/421#issuecomment-519903944.