castle-engine / castle-model-viewer

Viewer for many 3D and 2D model formats: glTF, X3D, VRML, Collada, 3DS, MD3, Wavefront OBJ, STL, Spine JSON, sprite sheets in Cocos2D and Starling XML formats
https://castle-engine.io/castle-model-viewer
90 stars 18 forks source link

VRML2 IndexedFaceSets solid FALSE #31

Closed gcad3d closed 3 years ago

gcad3d commented 3 years ago

thanks for the best VRML-viewer for Linux; is there a way for VRML2- files to shade IndexedFaceSets from both sides -

michaliskambi commented 3 years ago

The solid=FALSE is indeed the way to achieve it. If it doesn't work, we have a bug.

Please check https://raw.githubusercontent.com/michaliskambi/x3d-tests/master/pbr/one_and_two_sided_materials.x3dv (from https://github.com/michaliskambi/x3d-tests/ ) with latest view3dscene ("snapshot version" at the top of https://castle-engine.io/view3dscene.php ). Open it, and rotate to see it from the back. Correct result: from the front -> everything is visible, from the back -> bottom row is not visible (as on screenshot below).

If you see something different, then we have a bug. Send the view3dscene OpenGL log in this case (use "Help -> OpenGL Information" menu item, press Ctrl + C and paste it into a file and attach it here).

one_and_two_sided_materials_back

gcad3d commented 3 years ago

Sorry, cannot interprete correct the results (have 2 rows on top, 1 row on bottom side). See images: http://www.gcad3d.org/temp/Bottomside.png http://www.gcad3d.org/temp/Topside.png

My system is Ubuntu 18.04.5 with card AMD A8-6500 APU Radeo HD Graphics x 4 / Oland PRO [Radeon R7 240/340] with driver radeon (lshw -c video)

output of view3dscene /media/fwork/disk/one_and_two_sided_materials.x3dv is:

view3dscene: VRML/X3D warning: Unknown node of type "PhysicalMaterial" (named "") view3dscene: VRML/X3D warning: Node "PhysicalMaterial" is not allowed in the field "material" of the node "Appearance" view3dscene: VRML/X3D warning: Unknown node of type "UnlitMaterial" (named "") view3dscene: VRML/X3D warning: Node "UnlitMaterial" is not allowed in the field "material" of the node "Appearance" view3dscene: VRML/X3D warning: Unknown node of type "PhysicalMaterial" (named "") view3dscene: VRML/X3D warning: Node "PhysicalMaterial" is not allowed in the field "material" of the node "Appearance" view3dscene: VRML/X3D warning: Unknown node of type "UnlitMaterial" (named "") view3dscene: VRML/X3D warning: Node "UnlitMaterial" is not allowed in the field "material" of the node "Appearance" view3dscene: VRML/X3D warning: Error when reading, will skip the rest of VRML/X3D file: Error at line 173 column 25: Invalid VRML node content (probably unknown or not allowed field, prototype or VRML 1.0-style children) inside "Appearance": got "backMaterial"

We are rewriting the VRML2-output for CAD-data, so we often have surfaces outside solids. Thanks for yor effort.

michaliskambi commented 3 years ago

This is an old version of view3dscene. Please try the latest view3dscene ("snapshot version" at the top of https://castle-engine.io/view3dscene.php :) ). The model I linked ( https://raw.githubusercontent.com/michaliskambi/x3d-tests/master/pbr/one_and_two_sided_materials.x3dv ) indeed will not work in old versions.

Also, please attach the view3dscene OpenGL log -- it contains a bit more information, it tells me what view3dscene gets from your graphic card (use "Help -> OpenGL Information" menu item, press Ctrl + C and paste it into a file and attach it here).

gcad3d commented 3 years ago

Version 3.19.0 works great, has solved problem solved (had V 3.18.0 before).

Card: AMD A8-6500 APU Radeo HD Graphics x 4 / Oland PRO [Radeon R7 240/340] The card ist set to 3849x2160 pixels and is ok. The Radeon driver is ok, makes only problems with the selection-buffer (extremely slow).

Opengl-Info and images is at: http://www.gcad3d.org/temp/view3dscene.log http://www.gcad3d.org/temp/Bottom.png http://www.gcad3d.org/temp/Top.png