mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-20 06:20:50 +01:00
Rendering mode traces displaced geometry when the display has displacement on, so path-traced renders show the viewport's silhouettes and the displaced surface shadows itself. - render::displace: the viewport's dense subdivision of the mesh, each vertex moved along its normal by its set's height (box-filtered to the mip the vertex shader samples) times the height strength, at the viewport's scale (world length per UV / 16) - trace_geometry gives the GPU and CPU tracers the displaced mesh and BVH; Rendering mode, texturecraft-cli render --samples and MCP viewport_render use it - Rendering mode keeps the traced geometry until the mesh, a set's content or a height strength changes (display tweaks don't rebuild it) - subdivide::vertices shared by the renderer's mesh upload and displacement - test: a uniform height lifts the dense plane by height x strength x world per UV / 16
31 lines
1.4 KiB
Rust
31 lines
1.4 KiB
Rust
//! # texturecraft-render
|
||
//!
|
||
//! The wgpu viewport renderer: metal/roughness or specular/glossiness PBR with image-based
|
||
//! lighting (procedural environments or imported HDR images, prefiltered on the CPU in [`ibl`]),
|
||
//! height-to-normal, optional parallax occlusion, 4× MSAA plus idle temporal accumulation, channel / mesh-map / UV
|
||
//! checker debug views, the 2D UV view, a linear HDR scene with a post pass (exposure, Linear /
|
||
//! ACES tone mapping, bloom, sharpen, vignette, grain), key-light shadow maps, a 3D wireframe
|
||
//! overlay, and a [`headless`] device for renders
|
||
//! without a window. No UI toolkit dependency; the egui shell drives it through
|
||
//! [`Renderer::prepare`] and [`Renderer::blit`]. Fragment passes only, so it runs on WebGPU and
|
||
//! WebGL2 too. Rendering mode's path tracer runs on the CPU ([`trace`]) or, where compute shaders
|
||
//! exist (not WebGL2), on the GPU ([`gpu_trace`]).
|
||
#![forbid(unsafe_code)]
|
||
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
|
||
|
||
pub mod displace;
|
||
#[cfg(not(target_arch = "wasm32"))]
|
||
pub mod gpu_bake;
|
||
pub mod gpu_trace;
|
||
#[cfg(not(target_arch = "wasm32"))]
|
||
pub mod headless;
|
||
pub mod ibl;
|
||
pub mod mesh_maps;
|
||
pub mod readback;
|
||
pub mod renderer;
|
||
mod subdivide;
|
||
pub mod trace;
|
||
|
||
pub use renderer::{COLOR_FORMAT, Frame, MSAA, Renderer, Shade, ViewKind, aux_size, uv_view_scale};
|
||
pub use wgpu;
|