Forum

animation with build modifier

28 November 2016 10:41
Hi Mikhail,

I noticed that there is still one problem with the solution you gave me last week. The scene I have is pretty complex with the pipes running here and there. Because of that, they tend to overlap from nearly every possible camera angle, and when they do, the pipe in the front may look like it's actually running behind the one in the background.

I guess there is no other solution to this than to select the camera angle for each animation very carefully so that the pipes included in the animation wouldn't overlap each other too much. In your dairy animation that wasn't really a problem as the pipes weren't crisscrossing that much, and the camera was a bit further away.

Tricky, eh?

Cheers, Harri
28 November 2016 12:04
I noticed that there is still one problem with the solution you gave me last week. The scene I have is pretty complex with the pipes running here and there. Because of that, they tend to overlap from nearly every possible camera angle, and when they do, the pipe in the front may look like it's actually running behind the one in the background.
Yes, it's a problem if you have a lot of objects with transparency. Maybe you can use another method? For example fill in with a color opaque pipe? Here's I've prepeared another examle for you, maybe it can help.
pipe_animation.blend
Blend4web and that kind of thing.
28 November 2016 14:02
Hi Mikhail,

You certainly seem to have new ideas all the time! Great!

This model of yours works well if you have just simple pipes that run from A to B. In my model the pipes branch out to different directions (see the screen capture I attached earlier) and because of that the material morphing does not follow the pipelines anymore. So basically I have to make the original example work somehow, probably just with carefully selected camera angles.

One possibility might be to change the usual pipe material to a transparent one for just the duration of the animation and then back to the original one. Then all the other objects in the backgroud would still have the normal, metal materials (when not subject to an animation) and transparency would affect only those pipes needed in the animation. This requires pretty accurate timing though, but I think it's do-able.

I really need to think about this. I'm shortly running out of time with this project (I'm just about to finish my studies and this is my last project…) so I have to make the decision in one direction or the other.

EDIT: I actually came up with one more solution: I draw the animated "water" around the pipeline, not inside of it. Just by making it a bit larger than the pipe itself I get rid of all the ridiculous transparency issues. I hope.

Cheers, Harri
28 November 2016 15:15
DIT: I actually came up with one more solution: I draw the animated "water" around the pipeline, not inside of it. Just by making it a bit larger than the pipe itself I get rid of all the ridiculous transparency issues. I hope.
It's a good solution if it's fit your needs. I've also prepeared an example for you with changing material on pipes from opaque to transparent using logic node system. It's quite complex, but may be you can use it in some parts. I specifically colored transparent and opaque material in different colors to see that they are changed, but you can make them similar.
pipe_animation.blend
Blend4web and that kind of thing.
28 November 2016 15:42
Thanks again, the node setup for the logic editor didn't actually look too complex once I got the idea. That would be perfect if my model were simpler. At the moment the scene takes nearly 30 seconds to load with fast connection which, I think, is quite a long time to wait. If I need to duplicate some of the more complex objects in the scene it will slow down the loading even more. But I will see what can be done.

So far I done most of the stuff in the code level (I have a programming background..) so the logic editor could make it a whole lot easier and quicker to get the results. And if I got it right, you can actually run the logic editor animations from the code level the same way as any other animation?

Cheers, Harri
28 November 2016 16:07
Thanks again, the node setup for the logic editor didn't actually look too complex once I got the idea. That would be perfect if my model were simpler. At the moment the scene takes nearly 30 seconds to load with fast connection which, I think, is quite a long time to wait. If I need to duplicate some of the more complex objects in the scene it will slow down the loading even more. But I will see what can be done.
You can use Inheirt Material node instead of just hiding and revealing two objects with different materails to save weight.

So far I done most of the stuff in the code level (I have a programming background..) so the logic editor could make it a whole lot easier and quicker to get the results. And if I got it right, you can actually run the logic editor animations from the code level the same way as any other animation?
You can run logic tree using script if you set Run From Script on entry point or you just can play animation with script using blend4web api function and avoid logic nodes at all. Logic nodes made for artist who don't know how to program.
Blend4web and that kind of thing.
06 December 2016 12:58
Hi guys,

I tried several different transparency combinations for my chp plant visualization but unfortunately I couldn't make any of them work the way I wanted. Then I came up with a quite clever (imho) solution where I turned the whole setting around. I changed the water and gas (that run inside the pipes) as opaque and static meshes. To give them a feel of movement I added a simple texture animation where stripes move along the materials. I haven't actually tried the Inherit material node in the Logic editor, so I don't know if there's any difference between these two approaches.

Then I changed also the steel material for pipework transparent (or actually translucent) when the animation is running. I animated the steel material with the Value node so that the default Value is 0, and during the animation the value is set to 1. The Value is then used for switching between two different base materials and alpha values.

Here's the node setup for the woodgas :



and this is the "clever" part, the animated steel material:



This is how it looks when all the animations (a lot of them) are running at the same time. Because of the complexity of the scene it was very difficult to get all the bits and pieces work together with transparencies.



Only downside with this setting is that because of all the animations, the loading time of the data in the beginning has nearly doubled even though the amound of data in MiBs hasn't actually grown much at all. Is there any way optimize the animations so that the load wouldn't take that long? Or is there an better way to change the materials, perhaps?

Cheers, Harri
06 December 2016 15:43
Only downside with this setting is that because of all the animations, the loading time of the data in the beginning has nearly doubled even though the amound of data in MiBs hasn't actually grown much at all. Is there any way optimize the animations so that the load wouldn't take that long? Or is there an better way to change the materials, perhap
Most of animations are very simple, event for shaders so they can't slow loading too much, but complex materials and very big amount of them can. Can you make a screencshot from viewer with the loaded scene in it with hud info on. I marked with red which information will be helpfull to understand what slows it.


It's also will be helful if you send us a screenshots with Batch View, Opaque Wireframe and Render Time debug modes on.
Blend4web and that kind of thing.
06 December 2016 18:14
Thanks Mikhail,

Here are the screenshots, hope they help to analyse what's going on in the scene. Clearly the geometry and the textures take both a huge junk of MiBs, so I think they are the ones I need to go through first. However, the loading process slowed down remarkably when I added the animations and with them the new transparent materials. Any tips would be greatly appreciated!

Cheers, Harri
06 December 2016 19:21
Thanks Mikhail,

Here are the screenshots, hope they help to analyse what's going on in the scene. Clearly the geometry and the textures take both a huge junk of MiBs, so I think they are the ones I need to go through first. However, the loading process slowed down remarkably when I added the animations and with them the new transparent materials. Any tips would be greatly appreciated!
Yes, I analysed your screenshots, It's really helpfull for understanding the problem. As, I said before it's not due to amount of animation, rather directly. So, I'll try to explaint. When you add any animation to an object it makes it dynamic, so that maked them independent from other objects. All objects with the same material batched into one meta-object, but after that each of this object started to be independent and created a so called "Draw Call" (you can see the amount of then in the top-right corner) each of this objects started to render separatly. This increases the load on the GPU.
So, you need optimize your objects in that way: combine as many materials into one material, may be you can make one animation for longer part of tubes and then play it step by step using NLA animation strip. It's only the way. So, than less the draw calls then better for perfomance, than less the dynamic objects than better for perfomans. You can add huge amount of animations but if they all will be played on only one dynamic object - this will increase perfomance of your application.
Blend4web and that kind of thing.
 
Please register or log in to leave a reply.