babylon-runtime / _r Goto Github PK
View Code? Open in Web Editor NEWCode Less, Babylon More
Home Page: https://babylon-runtime.github.io/
License: Apache License 2.0
Code Less, Babylon More
Home Page: https://babylon-runtime.github.io/
License: Apache License 2.0
console say _r::unrecognized easing function linear
see https://codepen.io/vinc3r/pen/OJPMjZG
The patch does not enable vignette. You can use thisjavascript code to execute it in the console, you will see the result we should have:
_r.scene.imageProcessingConfiguration.isEnabled = true;
_r.scene.imageProcessingConfiguration.vignetteEnabled = true;
_r.scene.imageProcessingConfiguration.vignetteWeight = 100;
_r.scene.imageProcessingConfiguration.vignetteColor = BABYLON.Color4.FromHexString("#FF000000");
_r.scene.imageProcessingConfiguration.vignetteCameraFov = 1;
How to configure building packages, how to make a pull request, launch tests...
If you send this patch to the console, you'll be able to see the desired result:
_r.patch([{"cornellBox.red.000:material":{"albedoColor": "yellow"}},{"cornellBox.ground.000:material":{"albedoColor": "blue"}}]);
If you call the patch after addToScene, it works:
_r.select(assets).addToScene();
_r.patch(["cornellBox.patch"]);
this works :
window.onload = function() {
_r.load.script("/socket.io/socket.io.js").then(() => {
Under Chrome android, the loading percentage doesn't work, it displays NaN% instead.
http://3dmad.online.fr/WebGL/Steelcase_v0.9/index.html
But in private browsing mode there is no problem.
(embeded link for sharing issue)
repo on Github: https://github.com/Vinc3r/codesandbox-project/tree/master/BabylonJS/_runtime/cycle-through-patches/bjs
Take a look on cycling-through-meshes.patch >> be able to get current mesh in the albedoTexture function could be useful to automate texture assignation process (especially for lightmaps, with mesh name detection).
See https://codesandbox.io/s/convert-scene-add-interactions-02-grry0 (BJS v3)
CStfan give us also an example on BJS v4: http://3dmad.online.fr/WebGL/Steelcase_v0.9_custom_off/index.html , but note this is weird: on my Chrome it works, not on Firefox
you can test using this code:
_r.ready(function(){
/* DEBUG FOG */
var usePatch = false;
if (usePatch) {
_r.patch([{
"scene": {
"fogMode": BABYLON.Scene.FOGMODE_LINEAR,
"fogStart": 1,
"fogEnd": 5,
"fogColor": "red"
}
}]);
} else {
_r.scene.fogMode = BABYLON.Scene.FOGMODE_LINEAR;
_r.scene.fogStart = 1;
_r.scene.fogEnd = 5;
_r.scene.fogColor = _r.color("red");
}
/******/
});
Like in HTML, is there a way to use nested/recursive selector?
So this _r.select("*:mesh material:ball material:blue");
so it would:
codesandbox example, check loadassets.js to see the assets addition, removeFromScene is called from the button (line 30 of index.html)
Cstfan try to animate the lamp from my tutorial, and it looks like buggy : https://codesandbox.io/s/convert-scene-add-interactions-02-eb5tt?fontsize=14&hidenavigation=1&theme=dark
(first anim' on/off working great, nexts not)
On a simple scene it looks like it's working https://codesandbox.io/s/rlaunch-y1lnp?fontsize=14&hidenavigation=1&theme=dark
for now we have to use
var camera = _r.select("cameraName")[0];
_r.scene.activeCamera = camera ;
camera.attachControl(_r.canvas, true);
_r.selec('*:mesh').on("event1, event2", function() {
})
_r.patch([{
"exec" : function() { console.log("1");
}, {
"exec" : function() { console.log("2");
}, {
"exec" : function() { console.log("3");
}).then(function() {
console.log("4");
});
console.log("5");
=> 1, 5, 2, 3, 4
Should be
=> 1, 2, 3, 5, 4
I can try to do it myself, this can train me about plugin creation.
example:
for now we have _r.select("*[position.x=0]");
IMMO it's more readable to write _r.select("*[position.x==0]");
_r.downloadScene({scene : "duck.glb"});
_r.downloadScene({scene : "duck.glb"});
if we import multiple times the same fle, createLibrary
will send an error
to allow use of the selector _r("*:transformnode")
(useful for gltf imports, when a mesh with multimaterials is splitted into submeshes)
https://doc.babylonjs.com/api/classes/babylon.transformnode#getclassname
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.