GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — three-rs/docs/webgpu_postprocessing_godrays-progress.md at main · oneilltomhq/three-rs

Expand file tree

/

webgpu_postprocessing_godrays-progress.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
74 lines (57 loc) · 3.19 KB
/

webgpu_postprocessing_godrays-progress.md

Copy path

File metadata and controls

74 lines (57 loc) · 3.19 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

webgpu_postprocessing_godrays

Branch display-pages-2.

Green at 3 pixels of 100000 (limit 0.1%), steady frame 12.1 ms, 54 draw calls, 9234 triangles.

What the score covers

The page renders a scene pass with depth, ray-marches the point light's cube shadow map at half resolution (godrays), blurs the march edge-aware in two passes (bilateralBlur), and lays it over the beauty pass in the light's colour (depthAwareBlend). The graded frame is the first one. So the score checks these things:

  • the point light's six-face shadow lands in the cube depth texture that godrays was built with, before the march reads it;
  • the march, both blur passes and the blend compose in the right order on that first frame;
  • the targets have this frame's sizes. The rung asserts that the march and both blur targets are 400×250 on the 800×500 page.

tests/nodes_display_wgsl.rs checks each shader against three's dump: godrays_matches_three (m09), bilateral_blur_horizontal_matches_three and bilateral_blur_vertical_matches_three (both m11, because three compiles one program for both directions), and depth_aware_blend_matches_three (m13).

The 3 differing pixels are not explained further. They are under the limit, and the WGSL gates pass.

What this rung adds

area what
src/nodes/display/godrays.rs GodraysNode.js
src/nodes/display/bilateral_blur.rs BilateralBlurNode.js
src/nodes/display/depth_aware_blend.rs depthAwareBlend.js
src/lights/light_shadow.rs LightShadow::point_depth_texture()
src/renderer/mod.rs the point shadow draws into the light's own CubeDepthTexture
src/nodes/tsl.rs const_array_of, UniformArray::element_xyz
src/nodes/builder.rs negate() shared as a var; a Block read twice re-counts its result; vector ConstArray elements

Two builder fixes the gates found

negate() was never shared. The march's ray-plane t is a negation read three times. Three's negate() is a MathNode, so it becomes a var. The port inlined it, and the dump comparison counted 18 dots against three's 10.

A block read twice was counted once. Under renderOutput(), depthAwareBlend()'s result is read twice. Three's analyze stage builds an Fn() call's output at every reach, so the final mix becomes a var. The port counted the block once and wrote the mix twice.

Divergences

  • bilateralBlur is two materials with fixed directions, not one material with a swapped texture. Both compile to three's single program.
  • The page's GUI is not ported. Every value it drives is a public uniform on App, and output_raw is the graph the blur toggle swaps in.

Note: GodraysNode and BilateralBlurNode run their input's update-before first, so the first frame has this frame's depth and sizes. That order is three's too: addSequentialNode registers a node's children before the node. Only the mechanism differs: the port's nodes call the input's update through frame::texture_update themselves.

Left out

  • GodraysNode's DirectionalLight branch. The constructor panics for any light but a point light.
  • A logarithmic depth buffer.
  • dispose().
  • An orthographic camera in depthAwareBlend.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.