adam Posted November 25, 2017 Share Posted November 25, 2017 On 11/24/2017 at 4:21 AM, Tomm Huth said: That sounds promising, but how does that fit in with a Webpack workflow? https://doc.babylonjs.com/features/npm_support Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 28, 2017 Share Posted November 28, 2017 On 11/25/2017 at 3:44 PM, adam said: https://doc.babylonjs.com/features/npm_support I think that @Tomm Huth is referring to a non global import like: import { Scene, ArcRotateCamera, MeshBuilder } from 'babylonjs' With the current babylonjs structure webpack is unable to tree-shake explicit imports (as indicated at the end of the NPM page) and will take everything. I don't think that's an unreasonable thing to have on a wish list! I am honestly super happy with the progress to get the current NPM support, but agree this would be nice to have. As @Sebavan said the custom builds would work, but are not as convenient. Quote Link to comment Share on other sites More sharing options...
Tomm Huth Posted November 29, 2017 Share Posted November 29, 2017 @brianzinn you're totally right. Also I don't understand how plugins could possibly work in a npm workflow, if they all require a global export. Building your own version is really only a viable solution as long as you don't use NPM. I did manage to get my own build working, but ended up having to strip out the extra Oimo plugin (500kb extra for no reason if using Cannonjs), and also fixing a problem with the export at the bottom: (function universalModuleDefinition(root, factory) { var f = factory(); if (root && root["BABYLON"]) { return; } var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this); globalObject["BABYLON"] = f; if (typeof exports === 'object' && typeof module === 'object') module.exports = f; else if (typeof define === 'function' && define.amd) define(["BABYLON"], factory); else if (typeof exports === 'object') exports["BABYLON"] = f; else { root["BABYLON"] = f; } })(this, function () { return BABYLON; }); For some reason Heroku chokes on this, complaining it can't find BABYLON export ERROR in ./node_modules/babylonjs/dist/preview release/babylon.max.js Module not found: Error: Can't resolve 'BABYLON' in '/tmp/build_2f05ec3c0854af6ba703385c4238bd5e/tommhuth-stacky-4c50f39/node_modules/babylonjs/dist/preview release' This is not a problem for me locally, and Heroku could not find a reason why this should happen. The solution to get this to work was to simply: module.exports = BABYLON For a pretty simple game (http://stacky-game.herokuapp.com/) i saved around 3mb unminified by building my own version -- on the web EVERY KB counts. The downside is that I have to manually edit the generated file and commit generated code to my repo :/ There's lots of great stuff in Babylonjs, so there is no reason why it can't also be more in line with a modern JS workflow. brianzinn and Gijs 2 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted December 8, 2017 Share Posted December 8, 2017 @Tomm Huth - Just saw that your suggestion has an issue and is (at least for now) tagged 3.2! (#3314). Quote Link to comment Share on other sites More sharing options...
HoloLite Posted December 13, 2017 Share Posted December 13, 2017 My wish list is basically the continued improvements for webvr: (Pardon me if it's already covered in 3.1) - Controller support for Gear VR, and possibly the upcoming Vive Focus and Oculus Go - Gaze events, along the line of onGaze{Enter|Leave|Move|Xxx}Observables - Api for dragging/dropping and rotating object using the controller. (so people don't have to reinvent the wheels on their own) - Custom controller gltf image and behaviors brianzinn and edzis 2 Quote Link to comment Share on other sites More sharing options...
HoloLite Posted December 13, 2017 Share Posted December 13, 2017 Plus, typescript support for Babylon playground. Quote Link to comment Share on other sites More sharing options...
JackFalcon Posted December 14, 2017 Share Posted December 14, 2017 Second the zinnman.... @brianzinn on AR support as a package. 1) More AR explorations +1. AR-STATUS-UPDATE: BABYLON works fine on AR. But caveats: wasm heavy , AR.js needs refactoring to package, and suggestion for ARToolkit is promising for review. No cycles here until February for AR. Plugin probably deserves (team) or someone more expert than afalcon. -->AR-Board-Games<-- in babylon. Cat out of the bag...woosh! !?! Very interesting... 2) Interpolation. RESEARCH: "time-based-animations different than frame-based-animations" ~ T. Parisi. - And where question pops up. BABYLON has great frame-based-animation on static-type-attributes. .animation(type, f(){keys, frames)... QUESTION: does BABYLON have time-based-animation? With dynamic types? Looking, not finding... maybe afalcon missed this? Wishing for support of single-line-dynamic-time-based-interpolation syntax like similar 'inbetweening' originally from pixar (not 3): BABYLON.interpolate.from({x:0}).to({x:10}, time).onFrame(f()).onDone(f()).begin(); Unique names for BABYLON, but release the "chains" ... Instead, Object Configuration Pattern... to rescue, configurable and unique: BABYLON.interpolate({from:{x:0},to:{x:10),time:1000,onFrame:f(),onDone:f()},ease:'inout').begin(); Why? --> Ideal for animators making cinematics that queue dynamically off JSON scripts. CONSIDER: anim = {... ,cam:{cur:{"x":0,"y":8,"z":-28},tgt:{x:0,y:8,z:-20}, tar:{"x":0,"y":6,"z":0}, dur:1000}, ...} Enables an Animation Factory Pattern... (almost). 3) MeshEditing... what??? Why would anyone ever...? You might think: Mesh-Editing is massive.We have great importers. There are advanced vendors. glTF, etc, etc.... Ah. Yeah, all true. But wait! It is a total-thrill-ride to edit mesh directly inside of BABYLON at run-time! 1) Save to beautiful native arrays of numbers and awesome complex custom components (like @JCPalmer shows). And edit assets after import(!) 2) Similar to awesome terrain editors, extended build... to buildings, cities, and all kinds of low-poly-props. e.g. Skateparks. With simplified 3D Pipeline. 3) hover-editing concept from @Wingnut and @Arte, promising. And "quad-state-vertex-click-editor" where rgb === xyz, & drags on axis... till click! Countless questions: Might it extrude? Select All/Deselect? Drop-In Shapes? Materials ectera... Trail goes forever. Inspired by Wingnut. 4) "Creative Mode"... heard it is popular with kids. Hover-Editing: http://www.html5gamedevs.com/topic/34452-select-mesh-edges-and-vertices-on-mouse-over/?page=2 Moving stuff around (real-time) in BABYLON: 4) ~ Plugins: With JCP on a bunch of things... including -->keeping size down<--. Suggestions above - as plugins. afalcon does not know how to make plugins. Looked into great ones... @Dad72 Happy to build plugins... not sure where to start. <jokes-removed/> Thank you @Deltakosh. This community is the best. Arte and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
MarianG Posted December 19, 2017 Share Posted December 19, 2017 Hello. I think we need a direct dae loader. The reason is file size, and first loading time on page. As example: I have a static dae object around 7mb, export bynary file from 3dsMax around 13mb. With optimize vertices checked on export. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted December 21, 2017 Share Posted December 21, 2017 On 12/19/2017 at 2:19 PM, MarianG said: Hello. I think we need a direct dae loader. The reason is file size, and first loading time on page. As example: I have a static dae object around 7mb, export bynary file from 3dsMax around 13mb. With optimize vertices checked on export. My experience with Collada / DAE going from MakeHuman has not been good with regard to skeletons. If you implement this, pay attention to skeletons for sure. Last time I looked at 3dsMax exporter, several years ago (I cannot really read c#), I thought the text version was exporting 8 decimals. I am only doing 4 decimals for Blender. This reduces file size greatly, without anyone really able to tell. This would not directly help a binary, but rounding prior to optimization could yield much better results. 5.78324897 & 5.78324366 both round to 5.7832. For my implementation of morph targets, I go even further allowing a tolerance after rounding for detecting a vertex change using: def similar_vertex(vertA, vertB, tolerance = 0.00015): if vertA is None or vertB is None: return False if (abs(vertA.x - vertB.x) > tolerance or abs(vertA.y - vertB.y) > tolerance or abs(vertA.z - vertB.z) > tolerance ): return False return True This has no effect for BJS morph targets, since a morph target cannot be a sub-mesh. I have thought about using this for the optimization of initial vertices too, but have postponed until I allow for changing the number of significant digits. I use decimeters for units in my scenes, but some might use meters. For Tower of Babel, I use a whole host of additional optimizations. The simplest is lead zeros are not printed. leading zeros are about 10% of the entire file. Unfortunately, JSON rules do not allow this so .babylon format cannot use this. GameMonetize and JackFalcon 2 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 28, 2018 Share Posted January 28, 2018 My needs are really for avatar handling. Stuff that you'd use for 3rd-person games. What I think would be cool to have is root-motion (so root bone of skeleton can permanently move the body) morphing that also includes texture morphing and can read those textures from a texture atlas combining animations (so character can run AND shoot) better animation merging (something looks strange when one animation merges into another) be able to export shape-keys and animation from Blender Dad72 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2018 Author Share Posted January 29, 2018 "Better animation merging (something looks strange when one animation merges into another)": Can you repro this one? Quote Link to comment Share on other sites More sharing options...
jerome Posted January 29, 2018 Share Posted January 29, 2018 suggestion : a Scene Manager something to link scenes, to orchestrate their succession, etc example : scene1 = menu, scene2 = gameParameters, scene3 = level1, scene4 = level2, scene5 = level end, scene6 = game end, scene7 = introGame, scene8 = introLevel1, scene9 = introLevel2, etc How can I define the game graph to link all these scenes, what conditions trigger one or the other start after some given scene, etc JackFalcon and adam 2 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 29, 2018 Share Posted January 29, 2018 I can do that Jerome, I was helping Dad out with some stuff and realized I had all the structure put together for it to do what you are asking. I would need some help converting it to TS though. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 30, 2018 Share Posted January 30, 2018 13 hours ago, Deltakosh said: "Better animation merging (something looks strange when one animation merges into another)": Can you repro this one? Actually I have this exact same problem as this one When my avatar is flying and transitions from horizontal to vertical the body gets warped during the blend. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 30, 2018 Author Share Posted January 30, 2018 Can you repro in the PG with simple models? Quote Link to comment Share on other sites More sharing options...
JackFalcon Posted January 30, 2018 Share Posted January 30, 2018 Scene Animations, A good pattern to use is: array of configuration objects with action-callbacks. Action-Callback Pattern: script = [ {},{},{},{},{ $act: action type, action:function(){}, ext... },{} ]; scene = script[4].action(); Good to go. ~ GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 30, 2018 Share Posted January 30, 2018 @aFalcon, yeah should not be to hard to script up a system like that. I would have the callbacks wrapped in an object that you can have a complete variable stored on, then have a "action" stack or a array that checks the first element in the array if its not been fired, mark it as fired and then run it, then after the function is done have it set the parents variable of done so the action stack knows and then splice that action out and proceed to the next one. JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
renjianfeng Posted February 3, 2018 Share Posted February 3, 2018 Hi! I now know that you can freeze dynamic shadows with this setup. shadowGenerator.getShadowMap().refreshRate = BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE; However, there are still a few movable objects in my scene, can you add a similar one in the future, such as mesh. ShadowRefreshRate=60 setting, to set the shadow matrix calculation of some mesh. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 6, 2018 Share Posted February 6, 2018 @renjianfeng This is already possible, just set the refreshRate to BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE when one of your object moves and it will automatically update the map (just once every time) Quote Link to comment Share on other sites More sharing options...
nagash Posted February 12, 2018 Share Posted February 12, 2018 Hi. When you plan release Babylon.js 3.2 beta? Quote Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2018 Share Posted February 12, 2018 Early march Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted February 22, 2018 Share Posted February 22, 2018 Hi @Deltakosh If i may suggest some additions to the Babylon GUI; Dropdown/Select, Because who can't use a dropdown menu Slider isVertical option, Because.. it would be nice. Stackpanel overflow scrolling(..slider) when a predefined width or height is set and exceeded (depending on whether the panel is horizontal or vertical) (or a new 'overflowPanel'?) Being able to predefine height's & width's while the contents are dynamic is a widely used feature when designing GUI's Cheers Quote Link to comment Share on other sites More sharing options...
Guest Posted February 22, 2018 Share Posted February 22, 2018 Do you want to create an issue to track this 3 great ideas? Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted March 9, 2018 Share Posted March 9, 2018 On 22/2/2018 at 5:31 PM, Deltakosh said: Do you want to create an issue to track this 3 great ideas? Finally got back to this.. https://github.com/BabylonJS/Babylon.js/issues/3910 Quote Link to comment Share on other sites More sharing options...
adam Posted March 14, 2018 Share Posted March 14, 2018 @aWeirdo What do you mean by isVertical? Can’t you just check the rotation to determine if it is vertical? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.