Sometime before Babylon6, we had a working Print Screen function (yes, I know, who even uses printers anymore? Answer: the SnapOn field sales team does.)
Since 6, the canvas element is now blank in the Windows Print Screen preview window.
Im at a loss for even a good guess as to what happened. Nothing was changed WRT the print mode. We even have a separate React page specifically tailored to printing the current user config, and that’s been working fine for 6 months to a year.
Any ideas?
Is it working with the previous version and the same browser version ???
@Evgeni_Popov is there anything you can think about with regards to this issue ?
Is this preview window generated by proprietary code?
As @sebavan asked, does it work with a 5.x version of Babylon.js in your current browser?
I don’t really see what could have changed on our end to make the canvas no longer readable, it would be more of a change on the browser side.
Currently at Babylon v6.5
Tried 6.3 and 6.1 (core, loaders, and inspector), same result.
Tried 5.9, and shader compilation breaks during ShadowGenerator init even though I’ve made no v6-specific changes (in fact this area of the code has been pretty much finished for a while).
Tint WGSL reader failure: :1:13 error: invalid type alias
alias Arr = @stride(16) array<vec3<f32>, 8u>;
^
- While validating [ShaderModuleDescriptor]
- While calling [Device].CreateShaderModule([ShaderModuleDescriptor]).
logger.ts:121 BJS - [14:26:08]: WebGPU uncaptured error (1): [object GPUValidationError] - Tint WGSL reader failure: :1:13 error: invalid type alias
alias Arr = @stride(16) array<vec3<f32>, 8u>;
Nothing proprietary, the preview window is simple window.print().
Same result across latest Brave, Chrome, and even (lol) Edge.
You are using WebGPU?
The error you have in 5.9 is because you don’t use the latest version of TintWASM (TWGSL).
Can you try using the WebGL engine instead, in case it’s something with WebGPU?
[…] Ok, I just did Ctrl+P on the default Playground and got:
WebGL:
WebGPU:
So, it really seems to be a problem on the browser side when using WebGPU, I’m asking to the dev to be sure.
Im using whatever engine that EngineFactory wants to give me. How do I tell? Seems to be hidden behind automagick now.
EngineFactory.CreateAsync( reactCanvas.current,{
antialiasing: true,
useHighPrecisionMatrix: true,
failIfMajorPerformanceCaveat: true,
adaptToDeviceRatio: true
} )
.then( newEngine => {
//alert( `new Engine ${JSON.stringify( newEngine.getInfo() )}` );
const scene = new Scene(newEngine, props.sceneOptions);
I got confirmation that it’s a problem on the browser side: 1267243 - chromium - An open-source project to help move the web forward. - Monorail
Yes, the engine factory will create in priority a WebGPU engine if supported by your browser. If you don’t really need it (which I assume), you should create a WebGL engine instead (new Engine(...)
).
1 Like
That was it! Ive reverted to the old engine creation API for now. Thank you!