QuaziGNRLnose's Forum Posts

  • kmsravindra

    Thanks for being so helpful with your testing on iPad, I'm doing my best to ensure Q3D performs as well as it can. somethings you listed like the transparency are simply shortcomings of forward renderers that i can't avoid without a heavy performance tradeoff, and other things like morph animation size are just a drawback of the technique. When skeletal animation is available you should be able to improve loading/filesize issues (morph animations love to chew memory when not used for procedural morphing stuff) at the cost of some performance (skeletal animations are more cpu-intensive, since they require extra transformation matrices). That's quite an old iPad you're testing on, so it's understandable to me now why there have been these issues, as i stated my nexus 5 can run many lights simultaneously in the browser no less! i think this stuff varies widely among platforms.

  • I see many people are using this plugin without problem. How about mobile performance with lights? anyone tested it?

    Performance on mobile varies widely between device types / OS / hardware

    The WebGL standard is support better by some (google / android) than others (apple / IOS). My current stance is to optimize the plugin for current average desktop hardware. Phones will get there when they get there, but I can't do much to make it more performant that wouldn't mean severe limitations. When Q3D was in V1.0 most (probably all) phones couldn't run/render 3D WebGL with much success, and now I've gotten 60 fps on a nexus 5. I'd say mobiles are catching up, but first and foremost Q3D and really WebGL itself are optimized for desktop web applications right now. Test the mobile demo on the first page for an example on your phone browser. It has 6 lights i believe. I'm working to make it a fast game engine for the web, but WebGL's still pretty cutting edge so the mobile environment/devs aren't as fast on the uptake of the technology as desktop browsers have been. I'd say anything you make with it will eventually (in the not so distant future) be running just as well on mobiles.

  • where is manual how to use this plugin? i would like to read it before getting it, thank you

    I don't have one made yet, as the plugin is still undergoing lots of changes. a manual will likely be out in a few months after physics and skinned animation using bones are implemented.

  • QuaziGNRLnose, When I am use morph animation "DO loop and do ping pong" mode - then I see that the animation once it reaches the last frame momentarily jumps back to first frame ( seen like a flicker) before it starts going back from last frame to first frame. The same DOES NOT happen when I use "DON'T loop and do ping pong". If you want to verify this, you can verify it in the .capx file that I shared with you.

    strange, i noticed that. I'll fix it. It's due to me only testing with animations that loop cyclically so i didn't notice the issue

    if you want to fix it before the next update it'll be really quick.

    look for the block of code around line 163 in the Q3D Morph Controller Behaviour runtime.js file that looks like this

    				if (a.pingpong){
    				
    					a.t = a.t+a.speed*(dt)
    					if(a.t > Ma.animlen){
    					a.t = Ma.animlen
    					a.speed = a.speed*-1
    					a.pong = -1;
    					}else if( a.t < 0){
    					a.t = 0
    					a.speed = a.speed*-1
    					};
    				
    				}[/code:36xuh9iu]
    
    and change it to this:
    
    [code:36xuh9iu]				if (a.pingpong){
    				
    					a.t = a.t+a.speed*(dt)
    					if(a.t > Ma.animlen-1){
    					a.t = Ma.animlen-1
    					a.speed = a.speed*-1
    					a.pong = -1;
    					}else if( a.t < 0){
    					a.t = 0
    					a.speed = a.speed*-1
    					};
    				
    				}[/code:36xuh9iu]
    
    i had forgotten the "-1" after Ma.animlen
    
    also a suggestion: you could store the multiple animations for the cube in a single file, and use different animation names.
    
    EDIT:
    
    I also think i know why your ipad performance is extra low. Your exported models have skinning/bones information, which they never use. When you export morph targets, you don't need to check skinning/bones/skeletal animation in blender, or else you'll get both morph targets AND bones. Bones are loaded even though they aren't properly used, and they also waste a lot of memory if you're not using them. You don't need to check that stuff if you made your animation using bones, you only need it if you want to actually use the bones with the model in real time, which isn't supported yet in Q3D anyway (it will eventually).
    
    I managed to fix both the bugs you reported so they'll be gone in the next update
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The c2 sdk is pretty limited, id imagine stuff like this would be part of c3. There are a lot of choices in the c2 plugin system that could be vastly improved. Obe major issue is plugins cant share a common ACE, so you end up having to do nasty workarounds. Theres a lot of features i wish the sdk had that would make advanced plugins easier to maintain. I feel the current sdk was designed with the expectation that the plugins wouldnt become very elaborate, or try to augment c2 in a meaningful way, and thus only needed the bare minimum in terms of inheritance and eddittime data management.

    As things stand its impossible to make plugins that require preprocessing without nasty hacks and workarounds. Another issue is that the edittime only has access to textures, so if you need to import some proprietary format, or some kind of file and display that data in the editor you just wont be able to. The data interface is severely lacking aswell, and doesnt allow any kind of interaction. Theres a lot of issues that c3 should address like this. I love construct but i feel the closed off edittime like this is a huge detriment to its growth.

  • kmsravindra

    Yea its a bit wonky but its also how you initialize other objects in C2 (even the official plugins).

    When i have the time ill fix that interlayout bug. But as i suggested try making q3d master global and having only one instance instead of having multiple. This will make your application faster, because each Q3D master carries out an expensive initialization step on create/destroy

  • Understood. I will give this early loading a try. Also I hope you were able to reproduce the error I mentioned above...Thanks!

    It's late so i'll give it a try another day, thanks for the walk-through though!

  • Edit:

    Sorry, I mistook the "Q3D" models as Quake 3 MD3 files for some reason.

    This looks like a great project. Thanks for sharing it with us

    Ah, i can see the confusion

    Q3D loads .obj files and three.js json files, which can be converted to from most common formats. Supporting fbx/etc. internally is a bit of a pain since they're proprietary, and it's not a trivial task to write complicated loaders for these file types. The three.js community has written various tools that do the conversion already anyway, and I think modeling software should be used to handle the conversion anyway, rather than an event sheet. Importing 3D models is always a dirty process in every engine, but i'll do my best to integrate more loaders in the future.

  • As i explained, you need to create one of each model at least once, either by swapping to it with change model when the model is finally loaded, or by creating and destroying instances with that model (again the model has to be loaded first, or Q3D will "wait" for the load to finish and it wont initialize in the same way). It's kind of difficult to explain but Q3D models use complex internal pooling, so that things work efficiently if you create and destroy a lot of objects. "Change model" isn't really meant to be used the way you're using it without hiccups, so it makes things a bit more complicated to initialize.

    Normally Q3D expects one model file for each Q3DModel in the scene, so it just initializes everything at the beginning, and as you dynamically load in things that it's never seen before it has to do the setup work on the spot. Since you're basically always changing to things it's never seen before, it has to take that time the first time it sees it. You have to force it to see it earlier to get around that.

  • kmsravindra

    Didn't know about that bug! The plugin covers a lot of functionality so it's difficult for me to test every interaction. I have simple unit tests but sometimes I just miss bugs like that. A way to deal with the issue for now that you can do is probably to just make Q3DMaster a global object and make it invisible when it isn't needed. I'll try to figure out whats causing the bug for the next update though. Please report any bugs like this that you run into!

    EDIT:

    From testing in a simple project, i couldn't recreate that bug. could you please pm me a simple cap that causes the problem you're talking about. i made a project that switches between two layout and uses "on model created" but this is insufficient to cause the bug.

  • kmsravindra

    please do pm me with the capx.

    Note that loading models for the first time requires the browser to download the file, and send the geometry to the gpu, so it causes a drop in the fps that can't be avoided, also, using the same model but never uploading it to the gpu because it hasn't been rendered yet, or requires new model attributes because of textures/animations/etc. also causes small drops. these delays are unavoidable for first time initialization, but usually aren't a big problem on desktops. I assume again that the ipad hardware isn't really the greatest and the webgl implementation is poor.

    You can load everything at the beginning using the Q3DMaster action "load model" and then the drop will only occur at the beginning but not when swapping between models with "change model", this will mean the models don't have to be downloaded but there will still be a small pause on first time initialization. to get rid of even that pause, you have to basically get those models to initialize first, which should happen if you change to each of the models you need at least once in this case. Q3D sort of lazy initializes things this way because it would otherwise use way too much memory making assumptions.

    I'd advise you that the "keep mat settings" feature in "Change Model" introduced in V.2-3 is "slow" (at least it probably introduces a non-negligible overhead on mobile), and you should disable it unless you need it. "Change model" is also not the fastest function unless its changing to initialized models.

    Again, Q3D is very optimized, but the IPad has slow hardware and safari's .js engine and webGl implementation aren't very good. There isn't very much I can do to improve things, but your projects performance can easily be improved by properly initializing objects. I can't make Q3D automatically guess the number of models and of what type it needs to build pools for, or the models it needs to load, so you have to do that manually if you wish for the initialization to occur only during loading and not lazily on a need-to-know basis. Perhaps eventually i'll include the option for a special initialization file that gives Q3D instructions, but for now you can use change model (ensure the files are done downloading first).

  • Theres an svn tut somewhere, i believe it shouldnt be so diff with git, use google.

  • Physics plugin is about 90% complete, I've added support for various joint types, collision bitmasks, spheres/boxes/cylinders, helper functions, and only have multi-body shapes left to add.

  • I feel like its not really a great idea for backwards compatibility to be "leading the charge" so to speak in terms of design. C2 does a lot wrong, and maintaining backward compatibility means C3 will likely inherit its shortcomings in the process. Sure, if there's an elegant way to do it, maintaining that compatibility is great, but construct projects are very complicated and im afraid the same mistake clickteam made could happen here, where the product can open old projects from 90s software but the new product maintains all the issues it should have grown out of. C3 should really fix the big issues with the edit-time and it's interaction with the runtime, and i don't see how it can be done without essentially having C2 inside of C3, or making C3 too much like C2. If users want a new software that's just like C2, that's a little weird imo.

  • vioz

    did you look at the texture loading example in the examples pack on the first post? You need to rename your animations for textures to work, because Q3D needs to know what the texture is used for. Rename the first animation "DiffuseMap" as an example.

    kmsravindra

    Q3DLight is already as optimized as it can be, it uses shaders in a forward renderer for all lighting calculations. The problem is likely the the iPad hardware isn't good enough, or the iPad is an older model which has poor webGL support / weaker hardware (I don't have one to test). 3D WebGL is very new and is getting better every month, but it's not perfect yet, especially on mobiles.

    Lastly, the best option you have to try is probably to lower the resolution of the renders using Q3D Master if that's acceptable. IPad has a very high resolution screen even though it's hardware is bad, especially if its "retina", so you're probably trying to render a screen as big as some desktop displays. You can change the render resolution by first changing the layout property for "resolution" from "Auto" to "use size", and resizing the Q3D Object, or setting the resolution using the action "set resolution" if you want to enable a changeable resolution. In practice low resolutions make lighting faster as you need less of a gpu fill-rate for a given render.

    Your only alternative if that is unacceptable or doesn't work is to bake lighting onto static objects or fake shadows some other way. Having many objects also slows down the lighting calculations significantly, so you have to make your scene simpler on mobile.

    emartransformo

    As far as i know, you're the first! If you press f12 and tell me what the console says, that could possibly help me sort out any errors. What browser / OS are you using? Again, WebGL is newer technology so it wont work on some older setups / out of date browsers / older hardware. It's a shame but it's the state of things atm.

    to rule out if it's Q3D, could you tell me if any of these examples display?

    three.js examples