minorua / Qgis2threejs

3D map visualization and web export plugin for QGIS
http://minorua.github.io/Qgis2threejs/docs/
GNU General Public License v2.0
514 stars 91 forks source link

Option to define texture filtering #75

Open fnorf opened 8 years ago

fnorf commented 8 years ago

I looked around but could not find an option to set the filtering of the textures, is there such feature? If not, I would like to hereby request it. ;)

It would allow close zooming to look less pixelated if that is desired.

http://threejs.org/examples/webgl_materials_texture_filters.html

mkunzBGC commented 8 years ago

What I find more problematic than zooming in is zooming out. Consider this example: https://oc.bgc.mpg.de/public.php?service=files&t=7c58a90ecd4b705d0514a51e2a9e5159 Open test.html and zoom out quite far (also helps if initially the model is not in the picture) and enable autorotation by pressing 'R'. There is a lot of noise in the forest areas because the three.js version used by Qgis2threejs v.1.4.2 just uses the nearest neighbour method for texture filtering.

This can be improved simply by switching to the latest version of three.js. To try it yourself, do the following:

  1. Copy all the files from the above link to a place where you have write access.
  2. Open 'test.html' and see the noisy filtering with the old three.js
  3. Rename 'threejs\three.min.js' to e.g. 'threejs\three.min.js.old'
  4. Rename 'threejs\three.min.js.new' to 'threejs\three.min.js'
  5. Reload 'test.html' in your browser and see the smooth filtering

It would be great if the current version of three.js would be used by the next release of Qgis2threejs.

DigDigDig commented 7 years ago

@tadaa3x , what build of Three.js did you update to? I just tried throwing the current version into my source files (r84) and hit errors upon building my DEM.

I did some testing and discovered that the problem manifests with DEM layers that are clipped to a polygon.

r74 throws these errors when run with a clipped DEM.

capture

The current, r84, build runs fine so long as the DEM is not clipped.

mkunzBGC commented 7 years ago

@DigDigDig I used r80 for my tests. In my case the layers were only clipped by the canvas.

The test files mentioned above are now available here.