论坛

由用户创建的信息 Ivan Lyubovnikov
23 November 2015 11:56
I've added a couple of point lamps into the scene. Every one is animated independently by clicking on a ceiling lamp (blue and green rooms).
23 November 2015 10:41

I would like to animate point light via nodes. It will be nice if it would be definied by Bezier's Curve, but even just "ON/OFF" effect will make me satisfied. How to achive this?
Hi, you can animate the "Energy" parameter and use "Play Animation" node in the Logic Editor. The corresponding action can be tuned up via Bezier's Curve or any other way.

I attached the example.
16 November 2015 10:39

13 November 2015 10:02

Физика работает только при сборке через Bin/JSON или обфусцированный HTML тоже с физикой работает?
Нет, при экспорте в HTML физика не работает.
09 November 2015 18:59
These objects are loaded through multiple data.load calls. I tried to load just one object and then duplicating it but the duplication worked only for the parent, not the children. I didn't find another way to load all these objects in an efficient way.

But you can link them into the main scene in Blender. What are the reasons for having them loaded from another scene? Are they placed randomly or depending on some conditions?
09 November 2015 18:49

Is there a way to hide a dynamic object so that it's not updated at each frame when not visible? I mean is there a way to skip all those preparations before rendering for an object? Hiding it via scenes.hide_object() would do the trick?
Yes, but it can also be solved through the LOD system by adding an EMPTY object to the end of the stack.
09 November 2015 18:26
I've tried to reproduce this lag by using many dynamic objects loaded from the separate .json file, each one is outlineable. Nevertheless fps is normal for me: 110 when idle, 70 when moving the mouse.

I've attached an example (it takes about 20-30 sec. to load all the objects).
09 November 2015 18:01
I've explored the profile and found that there are 3 ponderous factors/places:

1) Having many dynamic objects leads to a massive preparations before rendering: frustum culling tests, sending data to GPU and so on. It affects fps all the time, even without any user input.

2) Outlining on hover is a heavy but practically scene-independent operation. So it doesn't matter how many objects are on the scene. It happens when you perform mouse moving or clicking.

3) Anonymous function from app_logic_fms.js:1204. I cannot see what's in it. But it seems that it's called approximately 1 time per sec. and it takes a big amount of time.




If hiccups occur all the time then the main reason is too many dynamic objects. It also depends on the camera clipping distance, so you can tune up the clip_end value for the camera to maximize frustum culling and minimize rendering cost.

If hiccups occur only after mouse moving/clicking then it rather be the outlining functionality which slows down the app work.
06 November 2015 18:36
I load all the objects at startup as it's a single scene with all objects rendered.
OK, it seems normal. At first I thought that it happens suddenly during the application work.

Ok I could try this but in js code I'm cycling through all children of a given object to update them eventually, so I'm using 'objects.get_parent'. Using 'append_stiff()' I think I'll loose this kind of structure, right? Moreover this structure allows me to have multiple objects with the same name which I use in js code to do a lot of things (identifying the object selected for example)
Yes, you're right, 'objects.get_parent' won't work after this. Now, I see that you have a complex structure, therefore copying I think is not an option.

Can you attach the profiling data? It'll help us to identify there is the bottleneck place. And we'll try to think up a workaround or a possible optimization.
06 November 2015 14:59
Hi!

These objects are loaded through multiple data.load calls.
Which certain moment the dynamic loading is happened? It's a heavy operation and should be used for loading different levels of a game/scene and other similar tasks.

I tried to load just one object and then duplicating it but the duplication worked only for the parent, not the children. I didn't find another way to load all these objects in an efficient way.
Yes, copying of an object doesn't currently consider parenting and other relations. But instead of dynamic loading you can copy all the needed objects and apply one of the constraint to emulate parenting, e.g. append_stiff(). It should be much faster.

I have about 1063 objects that are selectable and with outlining on hover enabled.
Outlining on hover means that the mouse move action will cause an iterating through all scene objects. But if the hiccups appear only when the camera moves (and not just the mouse) then the problem isn't here.

I found that my main problem could be the high number of objects that I have loaded in my scene.
I have about 1063 objects that are selectable and with outlining on hover enabled. Static objects (~131) are placed dinamically and have LODs objects and Force Dynamic Objects enabled (to move them dinamically).
Technically, all your objects are dynamic because of these settings.
On the one hand it isn't good to have too many dynamic objects, because it leads to many draw calls and drops FPS. But on the other hand it's easy to perform frustum culling optimization for them. So it's a kind of a balance. Anyway, moving the camera shouldn't affect FPS by this reason.