cx20
November 24, 2023, 9:18pm
1
I tried the CYOS WebGPU shader.
https://cyos.babylonjs.com/
However, the execution result of WebGPU’s Phong shader seems to be too bright compared to WebGL2.
When I checked the code, it seems that specComp2
is being calculated, but it is not being used. I think that’s probably the cause.
// Specular
let angleW = normalize(viewDirectionW + lightVectorW);
let specComp = max(0., dot(vNormalW, angleW));
let specComp2 = pow(specComp, max(1., 64.)) * 2.;
//fragmentOutputs.color = vec4(color * ndl + vec3(specComp), 1.);
fragmentOutputs.color = vec4(color * ndl + vec3(specComp2), 1.);
The settings I tried are below.
TEMPLATES: Phong
MESHES: Sphere
3D API: WebGPU
sebavan
November 24, 2023, 9:41pm
2
Yup it is a bug I ll push a PR ASAP for @RaananW to deploy
sebavan
November 24, 2023, 9:47pm
3
3 Likes
cx20
November 24, 2023, 9:51pm
4
Thank you for the quick correction.
I checked the others, and it seems that there is a similar problem with “Wave”.
sebavan
November 24, 2023, 10:05pm
5
The same PR will fix it as the fragment is shared but thanks for your feedback @cx20 !!!
1 Like
RaananW
November 27, 2023, 1:04pm
6
just to update - deployed and working correctly
1 Like
cx20
November 27, 2023, 3:22pm
7
I have confirmed that the shader is fixed.
BTW, I noticed another problem with CYOS.
I would appreciate it if you could check this as well.
I tried zip download using CYOS.
https://cyos.babylonjs.com/
Strangely enough, even if WebGL1/2 is selected as the 3D API, shaders seem to be stored in ShadersStoreWGSL.
[image]
I suggest revising the logic to ensure that the shaders are stored in the appropriate location based on the selected API in the dropdown menu, rather than relying on whether the WebGPU API is supported or not.