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

ENH: Add support for PBR material properties in material property widgets #1022

Merged
merged 1 commit into from
Feb 1, 2022

Conversation

lassoan
Copy link
Member

@lassoan lassoan commented Jan 31, 2022

ctkMaterialPropertyWidget can now edit material properties for both non-PBR (Phong, Gouraud) and PBR interpolation.
PBR material properties are diffuse (shared with non-PBR modes) and metallic and roughness (matching names used in VTK and glTF).
An interpolation mode selector is added (hidden by default for backward compatibility) to allow easy switching between interpolation modes.

ctkVTKSurfaceMaterialPropertyWidget is updated to get/set associated properties in VTK.

ctkMaterialPropertyPreviewLabel is updated so that it can display both PBR and non-PBR material settings. Preview of PBR settings is a rough approximation.

Example of PBR rendering in 3D Slicer:

image

@lassoan lassoan requested a review from pieper January 31, 2022 19:15
@lassoan lassoan self-assigned this Jan 31, 2022
…gets

ctkMaterialPropertyWidget can now edit material properties for both non-PBR (Phong, Gouraud) and PBR interpolation.
PBR material properties are `diffuse` (shared with non-PBR modes) and `metallic` and `roughness` (matching names used in VTK and glTF).
An interpolation mode selector is added (hidden by default for backward compatibility) to allow easy switching between interpolation modes.

ctkVTKSurfaceMaterialPropertyWidget is updated to get/set associated properties in VTK.

ctkMaterialPropertyPreviewLabel is updated so that it can display both PBR and non-PBR material settings. Preview of PBR settings is a rough approximation.
@lassoan lassoan force-pushed the pbr-material-properties branch from 8d3af09 to 1907195 Compare January 31, 2022 20:41
Copy link
Member

@pieper pieper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks! 👍

ambient = 0;
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this preview does much good anyway - at least in Slicer you almost always have the live update of your model visible which is better than a sphere anyway. I'm pretty sure this code is a holdover from an old dialog, maybe even ported from Tcl.

@lassoan lassoan merged commit 7b48c48 into commontk:master Feb 1, 2022
@lassoan lassoan deleted the pbr-material-properties branch February 1, 2022 01:11
@lassoan
Copy link
Member Author

lassoan commented Feb 1, 2022

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants