cnr-isti-vclab / nexus

Nexus is a c++/javascript library for creation and visualization of a batched multiresolution mesh
GNU General Public License v3.0
216 stars 87 forks source link

Detailed Textures #36

Closed dmercel closed 4 years ago

dmercel commented 5 years ago

Hi there,

I have only just started trying Nexus and for geometry it seems to be working really well. However, I am trying to convert files with high resolution textures and the final .nxs files, whilst textured, do not seem to have a very good resolution for the texture itself. I have tried various settings, for number of faces per patch and texture quality, but it doesn't seem to make much difference to the output.

I was wondering if you could describe a general workflow for models with high resolution textures in order that I can understand this better. The example models on your website seem to have fairly good texturing compared to what I am getting.
I would also like to understand what the limit is likely to be when texturing, to understand what kind of loss of quality I might expect to get when converting files.

Many thanks.

ponchio commented 5 years ago

The problem might be related to the error function that dictates the level of detail chosen for the view point.

It might be that the euristic I have chosen doesn't work well with models with a diffferent geometry/texture ratio.

It might also be some problem with the GPU RAM (depending on the texture parametrization).

Could you send me a sample to ponchio@gmail.com, so that I can investigate the problem?

Federico

P.S. The goal would be to be pretty independent of the workflow and models characteristics save for pathological cases, but evidently I am failing...

birdinforest commented 5 years ago

Hi Ponchio,

I get similar issue about high resolution textures. By using the the latest released nxsbuild tool on windows system, all textures are lost after conversion. I managed to clone and build the latest code(On MacOS Mojave), textures after conversion are messed.

By the way, models' original format is glTF, I use latest assimp build to convert them to obj.

I will send a sample to you later via email. Please advice me how to make it work on Nexus. Thanks a lot.

Derek

ponchio commented 5 years ago

Hi Derek, the problem is that Nexus does not work well with CAD models. The 2 reason are:

1) A good, reliable simplification algorithm for CAD models is not available. Simplification is the core of Nexus and quadrics based algorithm works for detalied scanned/sfm meshes, and badly for modelled meshes.

2) Textures in CAD models are extremely fragmented. The current algorithm in Nexus is not able to simplify the geometry preserving the textures. (Work in progress!)

Livan89 commented 5 years ago

Hi ponchio.

I have the same problem. After processing a model with a .ply format, the geometry looks great, but the texture shows a loss of sharpness and visual quality. The visual loss is not definitive but it is appreciable. The executables I'm using are nxsbuild and nxsedit

ponchio commented 5 years ago

Could you provide me a sample? and possibly a couple of screenshots?

Livan89 commented 5 years ago

Nexus

The details are small, but some are remarkable and show a decrease in quality. Thank you very much for responding, I appreciate coming comments and suggestions.

ponchio commented 5 years ago

Most probably the error function which dictates the resolution of the rendering is too optimistic. You might try to lower the targetError (might impact on performances).

presenter.setNexusTargetFps(0); presenter.setNexusTargetError(5); //or something lower

You need to download the latest nexus.js (https://github.com/cnr-isti-vclab/nexus/blob/master/html/js/nexus.js), because I fixed a bug about those functions.

Alternatively the fragmentation of the parametrization, or the ratio between geometry resolution and texture resolution could be the source of the problem. Might be solved by reducing the size of the patches (nxbuild -f 5000 ...) Hard to tell without a sample, though.

Livan89 commented 5 years ago

Perfect. Thank you.

The texture atlas that I have, before processing it in Nexus, I reduce it. Do you think that this can influence the final visual quality?

On the other hand, the -q (texture quality) parameter can influence? I also use the nxsedit.

I have already downloaded the new version and I am doing tests. Thank you very much for the help, your comments are helping me.

ponchio commented 5 years ago

-q options just control the jpeg quality of the textures in the .nxs, especially useful when importing from png images.

Of course reducing the atlas will impact the final quality, just check the texture for what you can expect. The highest resolution of the nxs model should be faithful to the input model, provided the RAM, GPU RAM, targetError, fps and view-point parameters allows the renderer to reach the final level.

Livan89 commented 5 years ago

Hi. I have been doing tests adjusting the parameter -f to 5000 and a very slight improvement is perceived, it is difficult to perceive differences when everything is in dependence of the visual perception. :(

Do you think that the use of nxsedit can influence the visual result? At least what is happening to me?

Thank you and sorry for the repeated inconvenience.

ponchio commented 5 years ago

You could use nxsview, where you can easily adjust the parameters (ram, error etc) and get some info on the visualization (numnber ot triangle rendered, error etc). Nxsedit (in your case compression) should not affect quality in the least....

Federico

On Thu, May 23, 2019 at 12:21 PM Livan89 notifications@github.com wrote:

Hi. I have been doing tests adjusting the parameter -f to 5000 and a very slight improvement is perceived, it is difficult to perceive differences when everything is in dependence of the visual perception. :(

Do you think that the use of nxsedit can influence the visual result? At least what is happening to me?

Thank you and sorry for the repeated inconvenience.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cnr-isti-vclab/nexus/issues/36?email_source=notifications&email_token=AAUDV27F2KPWUQYYATZGLWLPWZV3HA5CNFSM4GRBAKEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWBYYGQ#issuecomment-495160346, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUDV2YCQ6TJUMQD7H7ZQDDPWZV3HANCNFSM4GRBAKEA .