Repository navigation
Demo pages fit a phone; iOS: byte voxels, a nearest shadow map; ?gldiag and ?nofloatlinear - #1166
Merged
Merged
Conversation
…map; ?gldiag and ?nofloatlinear Phone layout (examples/web/templates/demo.html.in): - At phone width or on a touch screen, the title, the demo picker and the Fullscreen icon share one line, with a short touch hint on a second. The long description and the keyboard keys had been squeezed into a narrow column about 690 px tall at 375 px wide, half the screen. - The page is 100dvh tall, so it no longer runs under a phone's address bar. - top/right/bottom/left in place of `inset`, which Safari before iOS 14.5 ignores. - An iPhone has no element fullscreen, so the button is hidden there rather than throwing on a tap. The webkit-prefixed calls cover iPads. iOS rendering: WebGL2 filters 32-bit float textures linearly only with OES_texture_float_linear, which iOS Safari lacks. There a linearly filtered 32F texture is incomplete and samples as zero. - cloud_sky's near volumes and wave_sea's volume take byte voxels (new VolumeNode::updateScalars overloads for unsigned char), with their transfer functions on the 0-255 scale. VTK uploads float voxels as R32F / RG32F. - The sun's shadow map (R32F) samples NEAREST. A zero read is "nothing drawn here" in calcShadow, so on iOS nothing was ever in shadow. Each of its taps is compared on its own, so the soft edge never came from the filter. - Not covered: VTK's own transfer-function tables are 32F textures, filtered linearly when the volume interpolates linearly. That needs a change inside VTK's volume mapper. Diagnostics: - ?gldiag on a demo page shows a WebGL2 report instead of the demo: the renderer, the float extensions, the shader precision, and whether R8, R16F, R32F, RG32F and RGB32F filter linearly. - ?nofloatlinear hides OES_texture_float_linear before the demo starts, so a desktop renders as a device without it would. On the current build it makes the terrain lab's near clouds vanish. Tests: cvcgl_ariadne_realize checks wave_sea's byte voxels and byte-scale transfer function.
transfix
enabled auto-merge (squash)
November 12, 2026 12:18
transfix
added a commit
that referenced
this pull request
Nov 12, 2026
ci.yml's sanitizer test list keeps this branch's stream_test, net_ws_client_test and ariadne_host_test and master's contour_stack_test. The allowlist ratchet (#1152) passes: against master the list only loses the open-url clock's line.
This was referenced Nov 12, 2026
transfix
added a commit
that referenced
this pull request
Nov 13, 2026
package-linux / libcvc-release-grpc failed only in tools/singleton_scan, on cvc::ocean::sea_surface::source's thread_local. The run tested a merge with master b745ea6, from before #1181 (29ff406) took that thread_local out, and a rerun would test the same merge. Master since then: #1156, #1153, #1166, #1181, #1165. No conflicts.
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.
Joe's report: on a phone the demo pages are squished, with the text at the top leaving the demo very little room. On a friend's iPhone the CSS looked broken, the rendering was washed out and discoloured, and the clouds were black.
Phone layout
The header was one flex row that never wrapped. At 375 px wide, the description and keyboard keys became a column about 690 px tall, half the screen, and the Fullscreen button ran off the right edge.
At phone width (≤ 720 px) or on a touch screen:
Also:
100dvhtall, so it no longer runs under the address bar.insetis replaced by top/right/bottom/left, since Safari before iOS 14.5 ignoresinset.webkitcalls cover iPads.Checked in headless Chrome at 375 and 320 px wide, and at 1280 px, where the desktop header is unchanged.
iOS rendering
WebGL2 filters 32-bit float textures linearly only with
OES_texture_float_linear, and iOS Safari lacks it. There, a linearly filtered 32F texture is incomplete and samples as zero.cloud_sky's near volumes andwave_sea's volume now take byte voxels, through newVolumeNode::updateScalarsoverloads forunsigned char. Their transfer functions move to the 0–255 scale. VTK 9.5 uploads float voxels asGL_R32F/GL_RG32F(vtkVolumeTexture::SelectTextureFormat). The far cloud slices (VolSliceNode) already used bytes for this reason.calcShadowa zero read means "nothing drawn here", so on iOS nothing was ever in the sun's shadow. That flat lighting is a likely cause of the washed-out look. Each of the 16 taps is compared on its own, so the soft edge never came from the filter.vtkOpenGLVolumeLookupTable) are R32F / RGB32F textures, filtered linearly whenever the volume interpolates linearly. The fix belongs inside VTK's volume mapper. Changing VTK's default float format globally would also turn the float textures VTK uses for vertex data into 16-bit floats, so this PR doesn't do that.Diagnostics
?gldiagon any demo page (e.g.cvcgl/arigl/?gldiag) shows a WebGL2 report instead of the demo. It lists the renderer, the float extensions and the fragment shader precision. It also renders a 2×1 texture holding 0 and 1 to test whether R8, R16F, R32F, RG32F and RGB32F filter linearly (0.50 = ok, 0.00 = unfilterable). One screenshot from an iPhone settles which of these it supports.?nofloatlinearhidesOES_texture_float_linearbefore the demo creates its context, so a desktop renders as such a device would. With the same patch applied by hand to the current live build, the terrain lab's near clouds vanish and the sky goes paler. They vanish here rather than turning black, so the black clouds on the iPhone are not explained yet.Tests
cvcgl_ariadne_realizecheckswave_sea's byte voxels and that its transfer function ends at 255.