Show the dice faintly in a glossy table - #379
Merged
Merged
Conversation
The owner asked for the dark glass to reflect the dice "a bit, not perfectly". Filament's screen-space reflections were read against 1.76.1's shaders first and ruled out: they reflect everything on screen, so the walls would lay a dark band along their foot (the band switching ambient occlusion off removed); their roughness blur is in world units and comes out sharp in this millimetre scene; and they fade every ray that turns back towards the camera, which from the default straight-down view is nearly all of them. Instead a glossy floor gets a planar reflection of the dice alone: a second view from the camera turned over in the floor, a quarter of the screen each way, no shadows and no post pass, with the tray on a layer it does not see. The floor, a third material compiled on first use, adds that picture times its own Fresnel term and the table's strength and lowers its reflectance as much where a die is, so a white die shows as a soft pale patch and a dark one as a darker one. The small picture is the blur and most of why it is cheap. Whether a table reflects is read off its roughness (under 0.3; dark glass at 0.1 is two-thirds strength), so the format does not change and felt, oak and plain stay on the opaque material, drawing exactly as before at no cost. The rendered harness gains --table so the cost can be measured on dark-glass (decision 93). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.



Owner request: the dark glass should reflect the dice a bit, not perfectly.
Technique (decision 93): a planar reflection of the dice only.
GLASSmaterial variant samples that texture and adds it, weighted by Fresnel × the table's strength. The variant is compiled lazily and cached.Why not Filament's screen-space reflections (from reading the 1.76.1 shader source):
Which tables reflect: derived from roughness, with no format change. Strength = 1 − roughness/0.3, clamped. Dark glass (0.1) gets 2/3; felt, oak and plain get none and pay nothing.
On the Pixel 10a (the whole stack):
:render:filamentdevice suite 51/51, with the newReflectionDeviceTest:Judge on the phone: is it too subtle?
Reflection's strength mapping is the knob.Also:
tools/harness.sh --rendered --table <id>can now pick a table, to measure the cost on dark glass.Docs:
docs/physics-and-rendering.md("The dice in a glossy table"),docs/tables.md,docs/build-setup.md, decision 93.Based on #378.
🤖 Generated with Claude Code