Friends of high-fidelity mappings ,
I left off with plain old texture mapping now working in a non-affine way, that is without any kinks in straight lines/features along the diagonals of trapezoidal quads. My last JSFiddle had temporarily stopped working because it referenced dat.gui.module.js
which in the meantime has been replaced by the three.js project team with lil-gui.module.min.js
. I updated the previous JSFiddle and it’s now working again. On that occasion I’m also hosting the texture maps I’m using in this JSFiddle on my own webspace, because I have better control over any CORS issues should they again arise.
Before I go on, I’d like to introduce my test 2k by 1k equirectangular map which I stitched together using PTGui Pro from single shots I took on a bike trip through the Swiss Alps (Klausenpass). For better reference, I added one-pixel wide vertical lines at the 0, 511, 1023 and 1535 pixel positions each:
Those of you who have played (or are going to play) with the previos JSFiddle and select „reflective“ material and a lathe count of 4 segments will see (or have seen) something like this:
The above is the view straight down the lathing axis (y), overlayed (Gimp) with a wireframe rendering of the same scene.
I was expecting the general reflection to be „broken“ along the diagonals of the trapezoidal quads, but I was not expecting the straight red lines to display a behaviour as erratic as the above.
Which led me to look at the way vertex normals are computed in a LatheGeometry, because reflections are based on the evaluation of normals. I did find room for improvement, filed a PR which got accepted and which is going to be part of r136. For the „what“, „why“ and „how“ please refer to the description of that PR (#22927). The change introduced with that PR is a prerequisite for the following.
This is what the above rendering looks like with that PR applied:
Please note, that I’ve dedicated an evolved version of the previous JSFiddle for the following, as I didn’t want to loose the history by overwriting the previous one. Also please note, that this first fix only affects the “meridian” lines of the trapezoidal quads, not the content of the triangles yet. That said: Here we go!
And again overlayed with the corresponding wireframe rendering:
This is still not pretty, but the perfectly straight rendering of the vertical red lines of the equirect map indicates that now I have a sound basis for further work. Which I have already done and which I will introduce to you tomorrow.
Thanks for your attention.
P.S.: The bleeding red-ish triangles seem to be the result of some filtering applied during texturing.