{"id":1445,"date":"2020-04-19T01:17:51","date_gmt":"2020-04-19T01:17:51","guid":{"rendered":"https:\/\/castle-engine.io\/wp\/?p=1445"},"modified":"2020-04-19T01:17:51","modified_gmt":"2020-04-19T01:17:51","slug":"lots-of-gltf-work-new-x3d-extensions-and-conversion-improvements","status":"publish","type":"post","link":"https:\/\/castle-engine.io\/wp\/2020\/04\/19\/lots-of-gltf-work-new-x3d-extensions-and-conversion-improvements\/","title":{"rendered":"Lots of glTF work, new X3D extensions and conversion improvements"},"content":{"rendered":"<table class=\"thumbnails thumbnails-align-right\"><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/04\/Screenshot-of-selection-at-2020-04-19-031404.png\"\n             class=\"screenshot\"\n             title=\"Blender desining example_level for glTF export to fps_game example\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/04\/Screenshot-of-selection-at-2020-04-19-031404-200x105.png\"\n             width=\"200\" height=\"105\" \n            alt=\"Blender desining example_level for glTF export to fps_game example\"\n          ><\/a><\/td><\/tr><\/table>\n<p>More work on perfect glTF support in <i>Castle Game Engine<\/i> follows \ud83d\ude42<\/p>\n<p>Things done lately related to glTF:<\/p>\n<ol>\n<li>Our engine demo <a href=\"https:\/\/github.com\/castle-engine\/castle-engine\/tree\/master\/examples\/fps_game\">examples\/fps_game\/<\/a> uses now glTF format for both level and creatures. So you can just <a href=\"https:\/\/castle-engine.io\/creating_data_blender.php\">export from Blender to glTF, using standard Blender exporter<\/a>.\n<p>While X3D is still a great scene graph format our engine&#8230;  But as a file format, glTF today wins, with much more capable Blender exporter, that already supports animations, PBR, textures, normalmaps and more. So we advise this approach.<\/p>\n<li>\n<p><a href=\"https:\/\/castle-engine.io\/creating_data_levels.php#section_placeholders\">Placeholders (detected for levels defined in level.xml)<\/a> now account for Blender-&gt; glTF behavior.<\/p>\n<li>\n<p>New orientation value otUpYDirectionZ, following Blender -&gt; glTF behavior and both Blender and glTF conventions of &#8220;where is front&#8221;.<\/p>\n<p>This will be default soon. Changing this default will break compatibility, but we really want to make glTF a first-class citizen for us.<\/p>\n<li>\n<p><a href=\"https:\/\/castle-engine.io\/apidoc-unstable\/html\/CastleLoadGltf.html#GltfForcePhongMaterials\">CastleLoadGltf unit with public GltfForcePhongMaterials<\/a>. This makes sense for people that want to easily upgrade their pipeline to glTF, but are not ready for PBR yet.<\/p>\n<li>\n<p>New X3D extensions: <a href=\"http:\/\/doc.instantreality.org\/documentation\/nodetype\/ValueTrigger\/\">ValueTrigger (compatible with InstantReality)<\/a> and<code>Shape.collision<\/code> field (set to <code>\"BOX\"<\/code> to collide as a box easily).<\/p>\n<li>\n<p>Saving X3D (in particular after glTF -&gt; X3D conversion), now creates unique names for all X3D nodes if needed. This makes sure that model is saved preserving all DEF\/USE references and routes (DEF\/USE references cannot be always preserved in case names are not unique; in case names are empty, DEF\/USE references cannot be preserved, and also ROUTEs cannot be recorded).<\/p>\n<li>\n<p>Fixed rendering animations defined by <a href=\"https:\/\/castle-engine.io\/creating_data_resources.php\">resource.xml<\/a> with one scene for all animations.<\/p>\n<li>\n<p>Fixes to glTF skinned animation transformation in some cases.<\/p>\n<li>\n<p>Fixed normal vectors during glTF animations (normals need to be interpolated too).<\/p>\n<li>\n<p>Optimized animations: Store and use X3D <code>Shape<\/code> node <code>bboxCenter<\/code>, <code>bboxSize<\/code>, don&#8217;t recalculate useless octrees when not needed.<\/p>\n<\/ol>\n<p>I&#8217;m working still on optimizing glTF skinned animation speed. It&#8217;s still a work in-progress (CGE now does various unnecessary things, causing a slowdown; and we don&#8217;t apply skin on GPU yet).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>More work on perfect glTF support in Castle Game Engine follows \ud83d\ude42 Things done lately related to glTF: Our engine demo examples\/fps_game\/ uses now glTF format for both level and creatures. So you can just export from Blender to glTF, using standard Blender exporter. While X3D is still a great scene graph format our engine&#8230; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/castle-engine.io\/wp\/2020\/04\/19\/lots-of-gltf-work-new-x3d-extensions-and-conversion-improvements\/\" class=\"more-link\">Continue reading  \u27a4<span class=\"screen-reader-text\"> &#8220;Lots of glTF work, new X3D extensions and conversion improvements&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1446,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"publish_to_discourse":"1","publish_post_category":"9","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"347","discourse_permalink":"https:\/\/forum.castle-engine.io\/t\/lots-of-gltf-work-new-x3d-extensions-and-conversion-improvements\/138","wpdc_publishing_response":"","wpdc_publishing_error":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1445","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/04\/Screenshot-of-selection-at-2020-04-19-031404.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9IgYW-nj","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/1445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/comments?post=1445"}],"version-history":[{"count":2,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/1445\/revisions"}],"predecessor-version":[{"id":1448,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/1445\/revisions\/1448"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media\/1446"}],"wp:attachment":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media?parent=1445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/categories?post=1445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/tags?post=1445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}