f3d-app / f3d

Fast and minimalist 3D viewer.
https://f3d.app
BSD 3-Clause "New" or "Revised" License
2.89k stars 207 forks source link

HDRI Lighting is not being applied. My mesh is just a simple white base material. #1408

Closed futuremotiondev closed 6 months ago

futuremotiondev commented 6 months ago

Describe the bug When I drag and drop a HDRI to the window after loading my mesh, the HDRI appears, but it doesn't affect the lighting in any way.

f3d_aOJ7KLtBIX

To Reproduce Steps to reproduce the behavior:

  1. Open the .obj file I've attached.
  2. Press H in F3D and enable both HDRI options.
  3. Drag an HDRI to the window to load it.
  4. Notice that the lighting has not changed nor does the mesh respond to the new HDRI.

Expected behavior I expected the lighting to be reflected in the rendered display.

System Information:

F3D Information Paste the content of f3d --version:

F3D 2.4.0

F3D - A fast and minimalist 3D viewer
Version: 2.4.0.
Build date: 2024-04-03 14:39:50.
Build system: Windows 64-bits.
Compiler: MSVC 19.38.33135.0.
External rendering module: ON.
Raytracing module: ON.
VTK version: 9.3.0-2200-g1312f8a726 (date: 20240312).
Copyright (C) 2019-2021 Kitware SAS.
Copyright (C) 2021-2024 Michael Migliore, Mathieu Westphal.
License BSD-3-Clause.
By Michael Migliore, Mathieu Westphal and Joachim Pouderoux.

Additional context Here's a screen recording:

https://github.com/f3d-app/f3d/assets/33441569/acf608e3-61b9-412d-a604-e9498bc1b681

futuremotiondev commented 6 months ago

Forgot to attach the model.

Concept 1.zip

snoyer commented 6 months ago

The .obj model uses a material (usemtl 01___Default) but no material library (would need a mtllib foobar.mtl command and corresponding foobar.mtl file). Does the exporter program provide an .mtl file?

HRDI lighting does make a difference when opening the model with the --geometry-only option

futuremotiondev commented 6 months ago

Nope, it's a direct export from Teya Conceptor and no .mtl is generated. I'll have to look in to either getting in touch with the developer or just using the --geometry-only option.

snoyer commented 6 months ago

Nope, it's a direct export from Teya Conceptor and no .mtl is generated. I'll have to look in to either getting in touch with the developer.

Their screenshots have textures and according to their FAQ they care about using the OBJ format for interoperability reasons. They'll likely be on board with making sure the export is actually valid (by adding the mtllib command in the .obj) and exporting the corresponding .mtl and texture files too.

Meakk commented 6 months ago

Duplicate of #533

mwestphal commented 6 months ago

Duplicate of #533

BTW @snoyer @futuremotiondev , this means that even with a material, HDRI will have no effect because OBJImporter does not support PBR materials sadly.

I hope we can fix #533 at some point

futuremotiondev commented 6 months ago

Is there a chance that F3D can just open automatically with the --geometry-only flag in the case a corresponding .mtl file isn't found?

snoyer commented 6 months ago

Is there a chance that F3D can just open automatically with the --geometry-only flag in the case a corresponding .mtl file isn't found?

F3D uses an external library to the the .obj parsing and it does load the model despite the missing material data so I don't know to what extent the app can tell something went wrong, which it would need to do in order to "retry" with --geometry-only.

If you could identify which of your models require that workaround by their filename you could implement that via the configuration files. Let's say you name your files something.teya.obj instead of something.obj when they come from Teya Conceptor, then, in your configuration file, you can add something like:

   "*.teya.obj": {
       "geometry-only": true
   }