Skip to content
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

[qtAliceVision] Add new image viewer with Blinn-Phong model #72

Open
wants to merge 16 commits into
base: dev/qt6.6
Choose a base branch
from

Conversation

gregoire-dl
Copy link
Member

@gregoire-dl gregoire-dl commented Jun 19, 2024

Description

Add a new image viewer (Albedo + Normal) with Blinn-Phong model, the PhongImageViewer.
With customizable shader parameters and light direction.

A normal map with two light directions using the new viewer in Meshroom.

Features list

  • First implementation of the new PhongImageViewer.
  • Add support for base color and texture opacity in PhongImageViewer shader.
  • Fix some errors with FloatImageViewer especially when reactivated.

Implementation remarks

This PR is based on the Qt6 migration branch: https://github.com/alicevision/QtAliceVision/tree/dev/qt6.6
Linked to Meshroom PR: alicevision/Meshroom#2444

In particular, the shaders for the point cloud display are updated to be
compatible with the Rhi backend.
…ility

The shaders for the FloatImageViewer are removed from C++ files and
compiled as a dedicated component. The ShaderImageViewer file is fully
removed. The code from the FloatImageViewer and the FloatTexture are
updated to reflect the changes from the Qt3D API.
When images in the PanoramaViewer are hovered, their gamma is increased
to highlight them and make it obvious to the user which image is currently
being seen.

This commit fixes an issue that occurred when the mouse was moving away
from the image it was hovering: the added gamma was never removed, meaning
that, by hovering one image enough times, said image would become totally
white. The highlighting effect now correctly increases and decreases the
hovered image's gamma level, including when the user clicks to edit the
panorama.
cbentejac and others added 10 commits October 11, 2024 18:01
… shader

Clamp negative values in the FloatImageViewer fragment shader before
performing the successive `pow`. The result of `pow` is undefined when
it is provided negative values. On Linux platforms, it still gives the
expected result, but on Windows this leads to issues.
Using sequence player by default may cause errors when `FloatImageViewer` is reactivated.
Source texture should always be initialized to avoid errors (texture binding) when no image is loaded, especially when `FloatImageViewer` is reactivated.
Allows to load and display image (albedo and normal) with a given light direction.
Shading is done using Blinn-Phong reflection model.
`std::powf` fails to compile with gcc which is not compliant with C++17
when it comes to libstdc++.

Additionally, static casts are performed to fix warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants