JackFalcon

Members
  • Content Count

    398
  • Joined

  • Last visited

  • Days Won

    3

JackFalcon last won the day on March 15

JackFalcon had the most liked content!

About JackFalcon

  • Rank
    Advanced Member

Profile Information

  • Location
    this._collideWithWorld()

Recent Profile Visitors

2,083 profile views
  1. JackFalcon

    Combine Babylon.js with Pixi.js

    @SinhNQ, 1) Interpolate range and use callback state to apply state to BJS, is how. Really surprised how well that works. Made transition myself after all of the above ANIMATION REVIEW. 2) Looking into GSAP license, at that time, it was free "non-commercial". Tricky. Perhaps they changed it? : )
  2. JackFalcon

    Combine Babylon.js with Pixi.js

    2D + 3D Hybrid approach is really cool! Might we call it 4D or 5D? HYBRID MIXES like this can be HIGHLY-EFFECTIVE. Didn't know Pixi.js + Babylon could work, really intriqued! But DID HAVE SUCCESS mixing: Babylon + GSAP AND Babylon + jQuery! (surprize!) Don't laugh. Stop laughing. : ) There is a reason... for mixing Babylon and jQuery. jQuery.animate turned out to be just as good as GSAP(if not better).... and FREE. : ) Most Importantly: integration is lightweight and seamless. Example shortly, in upcoming BJS release. Can't wait to try this... +1 LIKE for BJS+Pixi.js && HYBRID~5D. Jack : )
  3. JackFalcon

    How to publish HTML5 games on facebook?

    ~Will give this a try...
  4. JackFalcon

    Sharing My Music and Sound FX - Over 1000 Tracks

    Hey Everyone, please consider LISTENING to AUDIO by Eric Matyas when you get a chance. He is doing GREAT work. AND is a huge benefit to this awesome community. Eric was instrumental in a recent creation to get BabylonJS on STEAM! So please look into Eric's work, he deserves it!
  5. JackFalcon

    Yaw Pitch Roll

    It works. Delta & crew helped on step 3-4 (above). : ) That world inversion syntax: /*CONVERT WORLD COORDINATES INTO LOCAL*/ var invertParentWorldMatrix = worldObj.getWorldMatrix().clone(); invertParentWorldMatrix.invert(); var local_position = BABYLON.Vector3.TransformCoordinates(pickPointNext, invertParentWorldMatrix); Thinking, pickPointNext is where the vector3(0,offset,0) goes. Maybe it helps? Could understand world inversions better! Awesome how matrix math works .... : )
  6. JackFalcon

    Sharing My Music and Sound FX - Over 1000 Tracks

    @Eric Matyas, A falcon digs your archives, and finds a perfect track! It is great for upcoming production of a 3D PUZZLE GAME... Is there option for attribution AND paid license... DM-me? : ) Thank you for your music service!
  7. JackFalcon

    deregisterAfterRender?

    @Deltakosh and @brianzinn ... the best. Thanks for the insight and the code links! : )
  8. JackFalcon

    deregisterAfterRender?

    Here it is (in a nice little pattern): scene.registerBeforeRender(function someCallback() { if(done){ scene.unregisterBeforeRender(someCallback); } }); solved.
  9. JackFalcon

    deregisterAfterRender?

    Ok, maybe got it... scene.unregisterAfterRender(unregister);
  10. JackFalcon

    deregisterAfterRender?

    Hi. Too easy. Anyone have a link to an example of how to deregister a beforeRender or afterRender callback? looking for a good pattern... Or unregister...? Thx.
  11. JackFalcon

    Explosion scene for a game

    Used this is a great place to start... https://doc.babylonjs.com/snippets/writing2 Adapted to extend range (supernova effect)[loops itself] and added fader fadeout -> cool things. var blueBoom; anmExplodeShader = function(){ BABYLON.Effect.ShadersStore["customVertexShader"]= "\r\n"+ "precision highp float;\r\n"+ "// Attributes\r\n"+ "attribute vec3 position;\r\n"+ "attribute vec3 normal;\r\n"+ "// Uniforms\r\n"+ "uniform mat4 worldViewProjection;\r\n"+ "uniform float time;\r\n"+ "void main(void) {\r\n"+ " vec3 p = position;\r\n"+ " vec3 j = vec3(0., -1.0, 0.);\r\n"+ " p = p + normal * log2(1. + time) * 25.0;\r\n"+ " gl_Position = worldViewProjection * vec4(p, 1.0);\r\n"+ "}\r\n"; BABYLON.Effect.ShadersStore["customFragmentShader"]="\r\n"+ "precision highp float;\r\n"+ "uniform float time;\r\n"+ "uniform float fader;\r\n"+ "void main(void) {\r\n"+ // " gl_FragColor = vec4(1.0,0.0,1.0,1.0);\r\n"+ // " gl_FragColor = vec4(0.2,0.0,1.0,1.0);\r\n"+ " gl_FragColor = vec4(0.2,0.0,1.0,fader);\r\n"+ "}\r\n"; var shaderMaterial = new BABYLON.ShaderMaterial("shader", scene, { vertex: "custom", fragment: "custom", }, { // needAlphaBlending : true, attributes: ["position", "normal", "uv"], uniforms: ["world", "worldView", "worldViewProjection", "view", "projection"], needAlphaBlending: true }); // " gl_FragColor = vec4(1. - log2(1. + time)/100., 1. * log2(1. + time), 0., 1. - log2(1. + time/2.)/log2(1. + 3.95));\r\n"+ shaderMaterial.backFaceCulling = false; blueBoom = BABYLON.MeshBuilder.CreateSphere("blueBoom", {diameter:100}, scene); blueBoom.convertToFlatShadedMesh(); blueBoom.material = shaderMaterial; blueBoom.material.alphaMode = 2; var time = 0.; var fader = 1; scene.registerBeforeRender(function() { if(time<50) { blueBoom.material.setFloat("fader", fader); blueBoom.material.setFloat("time", time); time +=0.1; //fadeout over time if(time > 30){ blueBoom.material.setFloat("fader", fader); fader -=0.01; // blueBoom.material.alpha -= 0.5; // console.log('ALPHA: ',blueBoom.material.alpha) } } else { blueBoom.dispose(); } }); Also rotate the camera to look down into the y axis... pretty cool low poly cartoon explosion effect.
  12. JackFalcon

    Performance Optimization tips.

    rudimentary stats... TEST DESCRIPTION: rotating parent with gradual increasing number of children(30,60,90) for each rotation, step-interpolation = 0.02, on a closed-circuit track. BASELINE NO-PERF-OPS 3 CONTROL-TESTS: TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 1867 TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 4294 TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 6724 OP-TEST-1 visibility = 0 3 COMPARISON-TESTS: TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 1937 TIMESTOP: END-ORBIT = 4237 TIMESTOP: END-ORBIT = 4679 OP-TEST-1 RESULTS: Within variance, visibility = 0 for hidden mesh, reduces orbit time ~2 seconds on third rotation (HOO-RAY). QUESTION: which is better visibility or setEnabled(false)? Bird should read source code, or... TEST: replace vis =0 to setEnable(false) in the same loops... TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 1917 TIMESTOP: END-ORBIT = 4227 TIMESTOP: END-ORBIT = 4778 RESULTS: Interesting - visibility is slightly faster (within variance). Didn't expect that. Bird should read source code. NOTE: couldn't use setElement(false) at parent level because in context need parent to remain visible, and only children hidden. NEXT-STEPS: Not going to do LOD test, sticking with simple visibility op for the moment. Instances not applicable. This is solved. Maybe more PERFOPS later. Hope this helps someone.
  13. JackFalcon

    Babylonjs consumes too much memory

    Also in optimization phase and ran across this simultaneously... https://blog.raananweber.com/2015/09/03/scene-optimization-in-babylon-js/ friend @RaananW says crystal clear: So hooray, bird on topic (marks on calendar) : ) Hit jRad with the similar question about a year back, on run-time vertex editing utility.... @BMWPilote Maybe that helps you. Are Instances applicable? https://doc.babylonjs.com/how_to/how_to_use_instances Or LOD?: https://doc.babylonjs.com/how_to/how_to_use_lod https://doc.babylonjs.com/how_to/in-browser_mesh_simplification cheers!
  14. JackFalcon

    Performance Optimization tips.

    Ok, Put in TIMESTAMPS ... gotta go. Thanks to who'ever made dude. Here is adapted timestamp utility, to easily measure performance anywhere: //TIMER var timeStamp = 0; var currentTimeStamp = 0; var timeReport = function(testname){ console.log('TIMESTART: '+testname); if(!timeStamp){ timeStamp = new Date().getTime(); } return function (testname) { currentTimeStamp = new Date().getTime(); var timeDelta = currentTimeStamp - timeStamp; console.log('TIMESTOP: '+testname+' = '+timeDelta); timeStamp = null; } } //EXAMPLE-USAGE-. // var debugTimeStop = timeReport('START Time Test'); // debugTimeStop('END Time Test'); Statistics pending...
  15. JackFalcon

    Performance Optimization tips.

    Statistics -->great idea<-- Thank you setEnabled(true) insight! TINY-UPDATES: - the code below worked well as first pass rough-in. RESULTS: performance improvement achieved! (ding). - Will try setEnabled... on parents - -> But had interesting PROBLEM: need parent setEnabled(true) AND children setEnabled(false)???<-- anyway... : ) - Hello LOD! too. - Probably date.now all three [hope] (BZ thx). reloadLevel = function(){ for(var i=0; i<edges.length; i++){ edges[i].visibility = 1; } for(var i=0; i<orbs.length; i++){ orbs[i].visibility = 1; } for(var i=0; i<boxes.length; i++){ boxes[i].visibility = 1; } for (var i=0; i<tiles.length; i++){ tiles[i].visibility = 1; } } unloadLevel = function(){ for(var i=0; i<edges.length; i++){ edges[i].visibility = 0; } for(var i=0; i<orbs.length; i++){ orbs[i].visibility = 0; } for(var i=0; i<boxes.length; i++){ boxes[i].visibility = 0; } for (var i=0; i<tiles.length; i++){ tiles[i].visibility = 0; } }