mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-25 08:50:46 +01:00
Smart material shelf tiles and hover previews render the real material, applied with materials::apply to the baked preview orb and composited by the compositor, lit in a dark studio of soft boxes. MaskPreview becomes OrbPreview (masks and materials share one bake and one worker). Tiles show a loading icon until their preview arrives; the web takes one worker request per frame. preview::material keeps plain materials only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
610 B
Rust
17 lines
610 B
Rust
//! One pixel of a smart material preview (see [`crate::orb_preview::OrbPreview::material`])
|
|
|
|
use texturecraft_geom::glam::Vec3;
|
|
|
|
use crate::preview::Sample;
|
|
|
|
/// The material values seen at a preview pixel, with what a display needs to light the shape
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
pub struct MaterialPreviewPixel {
|
|
/// Linear material values, averaged over the pixel
|
|
pub sample: Sample,
|
|
/// Surface normal in view space (+X right, +Y up, +Z towards the viewer)
|
|
pub normal: Vec3,
|
|
/// Fraction of the pixel the shape covers (0..=1, anti-aliased outline)
|
|
pub coverage: f32,
|
|
}
|