Jump to content

Koroldev

Members
  • Content Count

    84
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Koroldev reacted to Deltakosh in Particles dispose   
    I'm on it
    Will be done for next commit!
  2. Like
    Koroldev reacted to Deltakosh in Particles dispose   
    We can also think about updating the dispose function of the particle system to add a boolean to let the system knows that you don't want the texture to be disposed
  3. Like
    Koroldev reacted to aWeirdo in Particles dispose   
    Hi @negrant
    You could as you also mentioned clone the texture,
    Another option is to create your own dispose function, copy/paste the particleSystem.prototype.dispose function from core babylon.js file and remove the part which dispose the texture.
    A third option would be to not dispose them, keep the particleSystems in an array, simply stop() the particleSystems when they should end, and reuse, re-position/etc, and start().
  4. Like
    Koroldev reacted to Deltakosh in new rest pos for Skeleton   
    Let's try something else
    Can you go through your bones and call bone.updateMatrix(yourNewBaseMatrix) ?
  5. Like
    Koroldev reacted to Wingnut in new rest pos for Skeleton   
    *nod*.  It might not be technically possible, though.  Animations could be "accumulated" (additive?), so perhaps they need to be played-to-a-frame, and cannot jump to a frame.
    I think each frame is "movement since previous frame" and not "movement since beginning frame".  Maybe, no jump-to-frame is possible... because of that. 
    But, I am no expert about interpolations.  I should read some docs and/or study some code... before I yap. 
  6. Haha
    Koroldev got a reaction from Wingnut in new rest pos for Skeleton   
    You are already the second, we collect signatures for signing the petition about set bones to any frame wihtout a blending
  7. Like
    Koroldev reacted to Wingnut in new rest pos for Skeleton   
    Hi guys.  Sorry to interrupt.  Yeah, this is animation "sewing", in a way.
    "Rest".  It would be nice to have auto-animate... from rest position... to ANY-frame.
    AND... auto-animate... from ANY-frame... to rest position.
    Animations are not as plug'n'play as they COULD be, eh?  *nod*
    I dunno why I replied.  I have nothing useful to say.  :/
  8. Like
    Koroldev got a reaction from Wingnut in new rest pos for Skeleton   
    I tried, but it is not exactly what I need.
    I need something like setFrame for a bone, but setFrame working only if an animaiton for a bone already played.
    If I clone new skeletone and use setFrame for each one bone for the skeleton and skeleton do not have playing animation, then setFrame does not works.
    How I can clone skeleton and at once in this frame before a render apply any frame for this skeleton, that the animation started from frame that I need, because the first animation
    alway started from rest pose and then rest pose blends with animation which we started.
    In short - need to start animation for new skeleton from needed frame without rest pose.
     
    Thanks!
  9. Like
    Koroldev reacted to Deltakosh in new rest pos for Skeleton   
    Hello this is not directly supported but you should be able to update bone._restPose to a new Matrix
     
    If this works for you I'll add an accessor to avoid using a private property
  10. Thanks
    Koroldev reacted to NasimiAsl in Material Color   
    hi @negrant
    all material in webgl is a shader and shader have 2 part vertex shader and fragment shader
    in each frame vertex shader run for all vertex in the mesh ( if mesh linked to material ) and fragment shader  run per any pixel mesh looked in resolation
    so that color mix by texture in all pixel 
    all happen in GPU and GPU designed for do that it is optimized  too 
     
  11. Like
    Koroldev reacted to Temechon in Material on scene after dispose WorldSpaceCanvas   
    Hi !
    You can do something like this : http://www.babylonjs-playground.com/#JG2PA5#1
    ping @Nockawa to check if it's the intended behaviour in canvas2D.
  12. Like
    Koroldev reacted to jerome in ParticlesSystem from AtlasSubPicture   
    For 1 to 2K, the SPS is your friend anyway :-D
    It's quite easy to make explosions with solid different particles rotating in every direction.
    Have a look please at those demos featured by the BJS web site : 
    http://www.babylonjs.com/demos/boom/
    http://www.babylonjs.com/demos/spscollisions/
    http://www.babylonjs.com/demos/facets/ 
  13. Like
    Koroldev reacted to jerome in ParticlesSystem from AtlasSubPicture   
    In theory the standard particle system is faster than the SPS. You should be able to start to notice a little difference for more than 12-15K particles emitted at once (more visible above 50K particles)
    That said, if you need :
    correctly sorted particles relatively to other transparent meshes or per particle color/texturing/scaling/pickability or particle intersection computation or solid particles... well, you have no other choice to use the SPS...
    The SPS is quite optimized and its performances will be really close from the standard particle system and you would probably notice no difference for thousands of particles.
  14. Like
    Koroldev reacted to Wingnut in ParticlesSystem from AtlasSubPicture   
    Thanks... I'm glad you like.
    You ask a very good question.  I will ping @jerome for his opinion, too.  He invented SolidParticleSystem (SPS) and was always concerned-with performance during its dev.  SPS is more feature-packed than particleSystem... allowing planes, boxes, tetrahedrons, nearly any shape.  SPS also has basic particle collision feature, and also MIGHT allow particles to cast shadows and emit godrays.  But you might not NEED any advanced features.
    Also, do you know about "profiling"?  It is a performance tester inside browser f12 dev tools.  Perhaps you need to make tests in there.  It would be FAR wiser than Wingnut opinion.    I GUESS that standard particleSystem would be faster, but 10 textures has extra load-time.  Is load-time part of performance?  Perhaps.
    Maybe... someone has ideas for using atlas with standard particleSystem.  Take a look at particleSystem shader.  See line 4?  There is a vector4 (4 values) called options.  In line 25, you see that LAST 2 values (z & w) is an "offset".  Then in line 40, vUV = offset.  vUV perhaps === uOffset and vOffset - the same values we adjust in SPS. 
    But I am not sure how we users can change z and w values of options Vector4... in particleSystem.  Hopefully, others will tell us more.  Are you under a deadline?  (I hope not, they are stressful)
    Perhaps you can do some test profiling, and we can wait some more time... for more/better replies and advice.
    Shader gods... please help.  Can we do uOffset and vOffset on particleSystem refmaps?  Can someone show us HOW?
    Thanks for help, fellow forumers.    Talk soon, Negrant.  Reply, as wanted, of course.
  15. Like
    Koroldev reacted to Wingnut in ParticlesSystem from AtlasSubPicture   
    Hi again, Negrant.
    I don't think that is possible with our standard particle system, but perhaps it is... with a custom shader.  Not sure.
    Here is a Solid Particle System, using planes, with texture = atlas... which shows it can be done with SPS system.
    I'm not pro with SPS, but let's tour:
    Lines 22-23 - scaling... smaller number = bigger sprite face.    Experiment.
    Lines 26-27 - offsets... careful micro-adjusting picks the sub-image in the atlas sheet.
    Lines 30-35 - A Wingnut uOffset and vOffset animation.  Activate for fun.
    Line 40... set shape and how many.
    Lines 72-83 - a scaling, rotation, and color section... disabled by Wingnut to make tests easier to see.  Please re-enable at-will.
    Helper:  You can highLight large blocks of code, and toggle activation ON/OFF with control /
    If all your particle textures are the same size within the particle-atlas, and all spaced proportionately, then you will be able to index-into the particleAtlas with a math formula.  (You probably knew that already.) 
    If your particleSprites are varying sizes and spaced inconsistently, you may wish to maintain a little array of u/v Scales and u/v Offsets... pre-calculated atlas targets. 
    I tried using standard particleSystem, but u/v Scales and u/v Offsets did not work, for that.  Perhaps I tried it incorrectly, but, perhaps not.
    If you see color-changing, it is likely due to red-ish specular in line 12 light.  (I borrowed this playground code from Jerome) 
    Also, hemispheric light in line 8 is aimed in an unusual way.  They are most-often aimed 0, 1, 0... straight up.
    This is the ONE WAY I know how to do this.  There may be other ways, and/or better ways.  Others may comment soon.  Be well, we'll talk.
  16. Like
    Koroldev reacted to adam in BitmapFontTexture in firefox Error: WebGL: texImage2D   
    The error I'm seeing in FF is:
    Error: WebGL: texImage2D: Conversion requires pixel reformatting.
    Found this in FF code:
    https://dxr.mozilla.org/mozilla-central/source/dom/canvas/TexUnpackBlob.cpp#335
  17. Like
    Koroldev reacted to adam in BitmapFontTexture in firefox Error: WebGL: texImage2D   
    I got the font to load here:
    http://www.babylonjs-playground.com/#Q0M3CV#4
    There was a breaking change that changed the constructor:
    https://github.com/BabylonJS/Babylon.js/commit/19ed9366706a8264ffc5c9526f8f9b19bfb4bcbc#diff-69e60dcf75816ab45ec8ed9ef039f79c
  18. Like
    Koroldev reacted to Deltakosh in BitmapFontTexture in firefox Error: WebGL: texImage2D   
    You have to use the raw version of it
  19. Like
    Koroldev reacted to Deltakosh in BitmapFontTexture in firefox Error: WebGL: texImage2D   
    github works well for that
  20. Like
    Koroldev reacted to Nockawa in Several BitmapFontTexture   
    @negrant the bug is fixed, more info here and the new preview files are as usual available there
  21. Like
    Koroldev reacted to Nockawa in WorldSpaceCanvas2D attach to mesh   
    Hello,
    The doc entry point is here: http://doc.babylonjs.com/overviews/canvas2d_home you'll find plenty of playgrounds at the bottom.
    In the first time tutorial, there's a section about WorldSpaceCanvas and their relationship with 3D Scene Nodes  http://doc.babylonjs.com/tutorials/using_the_canvas2d#world-space-canvas
    Finally I think this PG (also referenced in the doc entry point) will do what you're looking for: http://babylonjs-playground.com/#1KYG17#1
     
  22. Like
    Koroldev reacted to Deltakosh in One big texture or many small textures   
    Agree with @BitOfGold. This is good for cache
  23. Like
    Koroldev reacted to BitOfGold in One big texture or many small textures   
    I'm sure that one big texture will be faster.
    (less draw calls if you use one material)
    the max size depends on the webgl context.
    engine.getCaps();
    this returns  maxTextureSize:16384 in my browser;
     
  24. Like
    Koroldev reacted to shen in babylon js attachToBone and changing animations   
    Seems the mesh is only updated to the bone's position during an animation is playing. 
    I find that attachToBone doesn't work with the bone moved with BoneIKController. 
  25. Like
    Koroldev reacted to adam in babylon js attachToBone and changing animations   
    After all that, I think the very first PG actually works correctly.
    http://www.babylonjs-playground.com/#OCCLB#26
    http://www.babylonjs-playground.com/#OCCLB#37
    Edit:
    I think it's because you are rendering the scene again.  Here I commented out scene.render():
    http://www.babylonjs-playground.com/#OCCLB#38
    So it actually isn't the ideal solution.
     
×
×
  • Create New...