Closed elmkni closed 3 years ago
Thank you for catching this! It was always occurring when you have "Anti-Aliasing" selected in view3dscene options. We did a trivial mistake in shader code change recently.
Fixed.
Allow a few hours for the Jenkins to rebuild Castle Game Engine and then view3dscene, and the problem will disappear in latest "snapshot" version from the top of https://castle-engine.io/view3dscene.php .
Note about your attached example: on my current GPU (Mesa DRI Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)
on Linux) it required an extra fix, reporting compilation error initially:
VRML/X3D: Cannot use GLSL shader for shape "Box": Fragment shader not compiled:
0:31(17): error: no matching function for call to `mix(int, int, float)'; candidates are:
0:31(17): error: float mix(float, float, float)
0:31(17): error: vec2 mix(vec2, vec2, float)
0:31(17): error: vec3 mix(vec3, vec3, float)
0:31(17): error: vec4 mix(vec4, vec4, float)
0:31(17): error: vec2 mix(vec2, vec2, vec2)
0:31(17): error: vec3 mix(vec3, vec3, vec3)
0:31(17): error: vec4 mix(vec4, vec4, vec4)
0:31(11): error: cannot construct `vec3' from a non-numeric data type
0:31(2): error: no matching function for call to `star(vec3, error, vec2, float)'; candidates are:
0:31(2): error: void star(vec3, vec3, vec2, float)
0:32(8): warning: `c' used uninitialized
To fix, change the line
star( c, vec3( mix( -20,2, rand( i ))), f, 0.3 ); /* stars */
to
star( c, vec3( mix( -20.0,2.0, rand( i ))), f, 0.3 ); /* stars */
That is, add .0
to two constant values, to make them float. In GLSL, automatic promotion from integer->float is not allowed, unlike in most other languages.
Hi Michalis,
it's me, Elmar.
Thank you very much for the quick fix and also for the info about my mistake ;)
I had actually fixed the int-to-float issue in most of my files, but accidentally send one of the un-fixed... (Murphy's Law)
Best regards, Elmar
Hi Michalis,
its me, Elmar.
I discovered that recent view3dscene win64 compiles (view3dscene-3.19.0-win64-x86_64.zip - 24-Jan-2021 19:59 - 6573059) show an GLSL shader compile error in the logfile (see attached/zipped view3dscene.log) for all built-in effect shaders,
that didn't occur with older versions of view3dscene (like: view3dscene_3.19.0-win64-x86_64 - 23-Oct-2020 08:00), so that the built-in effect shaders can't be activated from the menu (e.g.: View->Screen Effects->Visualize Depth) anymore, no matter if used with or without
--debug-enable-fixed-function
Effect shaders within loaded x3d/x3dv-files (example included in zip file) seem to work, as far I can tell.
Please help...
Yours, Elmar
view3dscene_log_plus_example_x3dv.zip