Release v0.45.0#396
Merged
Merged
Conversation
d27e790 to
faf1791
Compare
faf1791 to
fee830a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v0.45.0
Breaking Changes
close_keynow defaults toNoneinstead ofSome(Key::Escape)). CallWindow::rebind_close_key(Some(Key::Escape))to restore the previous behavior.New Features
2D rendering
A suite of new 2D features, all sharing the existing
SceneNode2dscene graph,Camera2dand HDR film (so bloom and tonemapping already apply to 2D content):SceneNode2d::sprite/add_sprite(textured quads),set_uv_rect, and animation-frame selection viaSpriteSheet(SpriteSheet::new,frame_uv) withset_sprite_frame. Nine-slice scaling throughnine_slice/add_nine_sliceandBorder(Border::uniform/symmetric). Example:sprites2d.Object2d::set_blendandSceneNode2d::set_blend/set_blend_recursivewithBlend2d(Alpha,PremultipliedAlpha,Additive,Multiply,Screen,Opaque). Example:blend_modes2d.light2dmodule with up toMAX_LIGHTS_2D(16) point/spotLight2ds (Light2d::point/spot/with_height,Light2dKind) plus ambient, managed by the thread-localLight2dManager.LitMaterial2dshades sprites with per-pixel diffuse + Blinn-Phong specular from a normal map (flat sprites still pick up radial falloff and spot cones):SceneNode2d::lit_sprite/add_lit_sprite,set_normal_map_from_file,set_lit_params(LitParams). Example:lighting2d.Tilemapbakes a grid ofSpriteSheetframes into a single-draw-call mesh (Tilemap::new,set_tile,fill,node;Tilemap::EMPTYcells are skipped/transparent). Example:tilemap2d.SkinnedMesh2dbinds vertices (SkinVertex2d) to up toMAX_JOINTS_2D(32) bones (Bone2d) with up to four weights each, blending per-bone joint matrices on the GPU (Spine/DragonBones-style). Pose withset_bone_local/set_transform, thenupdate()once per frame. Example:skinning2d.Gi2d, a post-processing effect that ray-marches per-pixel irradiance against analytic emitter/occluder discs (GiEmitter2d,GiOccluder2d) for soft shadows and colored light bleed with no light/shadow bookkeeping. Configurable rays, resolution scale and temporal blend, with an optional radiance-cascade solver (set_radiance_cascades) and jump-flood SDF occluders (set_sdf_occluders). Applied viaWindow::render_2d_with. Example:global_illumination2d.post_processing::Crt(screen curvature, chromatic aberration, scanlines, vignette), run over a 2D scene with the newWindow::render_2d_with. Example:post_processing2d. Chain it with other effects (e.g.Gi2d→Crt) viarender_2d_with_chain; example:effect_chain2d.ObjectMaterial2d): objects using the default white texture automatically get an untextured shader variant (higher GPU occupancy), textured objects get the textured variant — no API change.Off-screen rendering on the web + zero-copy egui display
OffscreenSurfacenow exists on wasm: creation and all GPU-side rendering (render_3d,raytrace_3d, ...) work in the browser. Only the CPU read-backs (snap_*,render_image_*) remain native-only (they must block on the GPU).OffscreenSurface::output_viewexposes the surface's final (post-tonemap) texture, andWindow::register_egui_texture/unregister_egui_textureregister any wgpu texture view with the window's egui renderer — so an offscreen surface can be displayed live in an egui UI with zero GPU→CPU copies, on native and web alike.Window::render_aov_3d/OffscreenSurface::render_aov_3drender depth (fixed-range grayscale), normals or colorized segmentation as a display-ready image into the surface's output texture, with no read-back. Therobot_viewexample uses all of the above.Rendering & platform
Window::render_chain/render_3d_with_chain/render_2d_with_chainandOffscreenSurface::render_chaintake a slice of effects applied in order. The existing single-effectrender/render_2d_withare retained as thin wrappers (an empty slice is the no-effect path).CanvasSetup::required_features(awgpu::Features) requests extra GPU device features on top of the ones kiss3d enables by default. Unsupported features are silently dropped (masked against the adapter) so device creation never fails on an unavailable one.Bug Fixes
GpuVectornot reallocating its buffer when an existing allocation lacked a newly-required usage flag.