Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by RalphEl

  1. https://github.com/lemontmoon/Babylon.js


    this is my first contribution on GitHub



    still dont fully understand how github works,,  ROFL

    if U want to play animation with transitions,,,,,       simply ----- > scene.beginAnimation(target,from,to,loop,speedRatio,null,null,transitionSpeed)

    transitionSpeed = 1   means no transition it works like it worked before

    transition less than 1 will play current animation u want to play together with previous,,, with linearFADE-in     


    try something like 0.1 its nice !


  2. 23 hours ago, adam said:

    That wasn't my code.  I found that in a demo in some other thread.

    Ok,,, so ,,,, i used that hacked version its version 2.1beta which is hacked..........

    I looked into it and did easingIN  function,,,,,,,,it works great, !,, i think its very great solution for blending  skeletal animations,,,,,,,,,, so what I am trying to do,, ,is ......... that I have implemented this into the latest version of babylon 2.4alpha...


    conclusion for now --- > everythings works great,, but,,...."?"......  one thing i am missing is   that somehow i cant figure out why _activeAnimations for my specific target won't have more that 1 animatabale,,, I've also disabled animation stop on beginning of animation.........          I will let U know if I will finish this for 2.4a........... or I will do some extension code for latest version..

    ..................... working on .....  please stand by......



    this is solved for now.... blending works !! but will need to dynamically change speed of animation

  3. On 2/21/2016 at 4:58 PM, adam said:

    That demo is using a "hacked" version of BabylonJS.


    Check out the Scene.beginAnimation function that has a weightAtFrame param:

    Scene.prototype.beginAnimation = function (target, from, to, loop, speedRatio, onAnimationEnd, animatable, weightAtFrame) {
                if (speedRatio === undefined) {
                    speedRatio = 1.0;
                // this.stopAnimation(target);
                if (!animatable) {
                    animatable = new BABYLON.Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, null, weightAtFrame);
                // Local animations
                if (target.animations) {
                    animatable.appendAnimations(target, target.animations);
                // Children animations
                if (target.getAnimatables) {
                    var animatables = target.getAnimatables();
                    for (var index = 0; index < animatables.length; index++) {
                        this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, weightAtFrame);
                return animatable;


    and Animatable:


    var Animatable = (function () {
            function Animatable(scene, target, fromFrame, toFrame, loopAnimation, speedRatio, onAnimationEnd, animations, weightAtFrame) {
                if (fromFrame === void 0) { fromFrame = 0; }
                if (toFrame === void 0) { toFrame = 100; }
                if (loopAnimation === void 0) { loopAnimation = false; }
                if (speedRatio === void 0) { speedRatio = 1.0; }
                this.target = target;
                this.fromFrame = fromFrame;
                this.toFrame = toFrame;
                this.loopAnimation = loopAnimation;
                this.speedRatio = speedRatio;
                this.onAnimationEnd = onAnimationEnd;
                this.weightAtFrame = weightAtFrame;
                this._animations = new Array();
                this._paused = false;
                this.animationStarted = false;
                if (animations) {
                    this.appendAnimations(target, animations);
                this._scene = scene;
            // Methods
            Animatable.prototype.appendAnimations = function (target, animations) {
                for (var index = 0; index < animations.length; index++) {
                    var animation = animations[index];
                    animation._target = target;
                    if (this.weightAtFrame != null) {
                        animation.weightFunction = this.weightAtFrame;
            Animatable.prototype.getAnimationByTargetProperty = function (property) {
                var animations = this._animations;
                for (var index = 0; index < animations.length; index++) {
                    if (animations[index].targetProperty === property) {
                        return animations[index];
                return null;
            Animatable.prototype.pause = function () {
                if (this._paused) {
                this._paused = true;
            Animatable.prototype.restart = function () {
                this._paused = false;
            Animatable.prototype.stop = function () {
                var index = this._scene._activeAnimatables.indexOf(this);
                if (index > -1) {
                    this._scene._activeAnimatables.splice(index, 1);
                if (this.onAnimationEnd) {
            Animatable.prototype._animate = function (delay, cache) {
                if (this._paused) {
                    if (!this._pausedDelay) {
                        this._pausedDelay = delay;
                    return true;
                if (!this._localDelayOffset) {
                    this._localDelayOffset = delay;
                else if (this._pausedDelay) {
                    this._localDelayOffset += delay - this._pausedDelay;
                    this._pausedDelay = null;
                // Animating
                var running = false;
                var animations = this._animations;
                for (var index = 0; index < animations.length; index++) {
                    var animation = animations[index];
                    var isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this.speedRatio, cache);
                    running = running || isRunning;
                if (!running) {
                    // Remove from active animatables
                    index = this._scene._activeAnimatables.indexOf(this);
                    this._scene._activeAnimatables.splice(index, 1);
                if (!running && this.onAnimationEnd) {
                return running;
            return Animatable;
        BABYLON.Animatable = Animatable;


    That looks like a good starting point for blending animations.


    Thaks for all  stuff & wisdom  you've sent me,,,, I've been trying your experimentation earlier but didnt know that there was modified babylon.js file.... I am gonna loook into it much deeper........... loooks like you really did skeletal animation blending,, ,,

  4. Hello,,, 

    I've been trying to use SSAO renderingPipeline,,,, and got this ERROR



    WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElementsInstancedANGLE: attachment has a 0 dimension
    babylon.js:5714 WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElements: attachment has a 0 dimension
    babylon.js:5711 WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElementsInstancedANGLE: attachment has a 0 dimension
    2(index):1 [GroupMarkerNotSet(crbug.com/242999)!:7CC10008]RENDER WARNING: there is no texture bound to the unit 0
    (index):1 [GroupMarkerNotSet(crbug.com/242999)!:7CC10008]RENDER WARNING: texture bound to texture unit 1 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
    babylon.js:5457 WebGL: INVALID_FRAMEBUFFER_OPERATION: clear: attachment has a 0 dimension
    babylon.js:5457 WebGL: INVALID_FRAMEBUFFER_OPERATION: clear: attachment has a 0 dimension
    10babylon.js:5714 WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElements: attachment has a 0 dimension



    I used code is from SSAO example "CAT"


     var ssao = new BABYLON.SSAORenderingPipeline('ssaopipeline', scene, 0.75);
                    scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline("ssaopipeline", camera);
                   scene.postProcessRenderPipelineManager.enableEffectInPipeline("ssaopipeline", ssao.SSAOCombineRenderEffect, camera);
    Any idea >? or same problem here ?
    NO WORRIES   ,, now its working,,,,,,, i've added pipeline while engine wasn't properly initialized
  5. Yes,, I can say its working ,, but not with clonedMesh & workerCollisions = true


    If I use instanced mesh its ok,,, but I need to make cloned mesh with cloned skeleton,,,,,,,,, do I need to clone collider or is there something else I need to turn on, setup after cloning  to get collider working ?





    I need same skeletal characters but I need to clone them to play separate animations on them..... with instanced skeletalMesh we cant play different animations,, they are playing same animation all the time right ?


    correct me if I am wrong



    + tested  with workerCollisions=false      --- > works with instances & clones

    + tested  with workerCollisions=true       --- > works with instances    BUT doesn't work with clones

    checked 3 times to be sure


    As I saw in latest 2.3 alpha release there was bug fix with workerCollisions and instances,, maybe now this fix should be applied to clones xD 


    strange is if I create another clone while playing game or just create only one clone at runtime  ,,, collisions works 


     if there is array of object clones to create problem is here,,,,,,,,,, for example if tell engine to create object every 0.5s --- > GOOD working.

  6. Hi,, I have problem with shadowmaps


    when there are objects moving around scene origin 0,0,0 shadows starts flickering very intensive


    how can i solve that ? "it is iimposible to take screenshot of that"




    Also is there possible to merge two shadowmaps ? for example I have want to use two ShadowGenerators


    fist for static objects with refresh rate: 60

    second with dynamic objects refresh rate: 1


    it works very well in term of performance but problem is that when first static shadowmap is overlapping dynamic ,,, shadows become darker at overlapping point.


  7. I have question about shadows too...... I;ve separated static and dynamic objects into two shadowGenerators, (Static & dynamic)  so static shadow refresh rate is 60 and dynamic is 1  ,,,, --- > work pretty good but,,,,, is there way to merge two shadowgenerators shadowmaps into one in output because second shadowgenerator is overlaying first one,,,, and static shadow becomes darker if dynamic shadow overlaps static ..




    This effect is not physicaly realistic  in real world.......


    it should be


    output color  = total diffuse * light


    final color = output color  + ((shadowgenerator1 shadow map + shadowgenerator2 shadowmap)*shadow intensity)   



    in my opinion shadowmaps should be rgb color (0,0,0) "or whatever color u want" * alpha (shadowintensity)


    thanks ..

  • Create New...