-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#865-upgrade-three-js #1002
#865-upgrade-three-js #1002
Conversation
Thanks - a long overdue chore, and much appreciated! Some initial test results (Windows 10 Firefox 119.0.1)
That looks like a long list but those are all the problems I could find looking through different representation types, and I think most boil down to either parameterizing lights (as per the discussion you linked) or the impostor code. Thanks again for tackling this! |
Thanks @fredludlow for the testing! |
838e1ce
to
0899733
Compare
Excellent:
In the showcase/electrostatic-apbs example the dot representation looks fine to me with/without forceTransparent? Do you mean the point repr? (I mentioned it previously as I don't use it and haven't taken time to understand its options in details, but I can't reproduce the issue from your image - could you post the representation parameters that give that?)
I'm a bit out of my depth to comment on this. There's all the work @garyo did in #808 to enable
I'd vote for making a v3, dropping it, and putting it back later if anyone misses it. |
I'm still around, sorry I've moved on to other things and haven't kept up with three.js much recently -- but would be happy to review color workflows with you. |
Thanks @fredludlow and @garyo ! Sounds like we have a plan! Here is a detailed view for the issue with the points representation. We can see that every dot is drawn in an opaque white square |
Sorry @ppillot - I couldn't reproduce those white squares on my machine, but it's probably me not doing the right thing, is that from one of the examples, or have you got some specific settings for the representation that do this? (Or does it always happen for you with point representation?) |
@fredludlow this was observed with the representations/lines example I think that the issue stems from the The point representation uses a texture which is a square where the pixels have a decreasing alpha channel value from the square center. The alpha test discards the pixels where the alpha value is below 1.0 (when set to the maximum value in the slider), which results in a disc of radius 1. |
Only BufferGeometry is supported. Every BufferGeometry helper (e.g. BoxBufferGeometry) has been renamed to shorter name (e.g. BoxGeometry)
As it leverages many deprecated methods
replace with copy() + invert()
critical and high vulnerabilities were caused by dependencies related with Jest
Previous code was setting `_position` to an empty array. This was causing some bugs where the _position array was not filled with the proper values and remained empty.
`ALPHATEST` was previously used as a flag and a value in three.js `alphatest_fragment` chunk. It was superseded by the `USE_ALPHATEST` flag and the `alphaTest` value passed as a uniform. The declaration of the `alphaTest` uniform is made in the `alphatest_pars_fragment` chunk.
A SpotLight must have its distance set in real world coordinates. This was resulting in very dark scenes, where the position of the light or its intensity must take into account the bounding box. Directional Lights do not require this settings. They light the scene in a uniform manner from afar.
3.14 is the value recommanded in Three.js documentation when converting colorspaces Ambient intensity of 1 is the default.
By default the outputColorSpace is set to rgb. Internal colors are set to linear rgb space. `compositeMaterial` derives from custom ShaderMaterial. Correct color depends on the `colorspace_fragment` chunk beign executed in the corresponding fragment shader.
original value was 0.2. Recommended multiplicator is PI and 0.63 seems to give comparable results with the previous version.
The pattern here is that when a color is set as a string or an hex number, it requires conversion from RGB to linear. On contrary, if a color is set via a Color object, it is assumed that this one is already encoded in linear color space.
Because we are now using Three.js defaults
ColorMakers are called when creating BufferArrays to populate the `color` uniform. 4 methods can be applied (atomColorToArray, bondColorToArray, volumeColorToArray, positionColorToArray). Each of these, calls a related method (e.g. `atomColor`) to get a color that is defined in RGB Colorspace, encoded as an integer between 0 and 2**24. This color is then converted to a tuple of 3 values which are passed along all the other vertices colors to the shaders codes as a uniform. Prior code was using a decorator to convert the output color of each coloring function, to linear space and then to hex. This hex value was then later processed to be split and normalized in the array buffer. The change here makes the linearization at the last step, after the normalization which should avoid clamping due to the double conversion that was happening previously
A banding effect was due to a loss of precision when copying the texture between render targets as linear encoding requires more precision.
It seems the relative units might have changed between the camera and the point of focus. Pushing the fog near plane further back, seems to visually match with previous version results.
c26827e
to
b09d478
Compare
Closed this branch as the issue with antialiasing could not be fixed. Superseded by PR #1037 |
#865 Upgrade three.js to latest released version.
A legacy flag is used for the lighting mode.
Ideally this should be fixed by using the latests properties required for lighting
(like distance and decay)
and also migrating the code to use a linear colorspace internally.
This PR requires testing (like checking that all the examples do pass while comparing with the previous version)
Note that the .ply parser has been removed for convenience as it uses many deprecated three.js features (like Face). I am not sure it's worth the effort to reimplement it. It's a common 3D format, maybe it can be useful for some debugging? Note that there are alternate implementations of such a parser that exist for three.js.