Suppose I have a scene with a very nice tropical island(sounds familiar?) with waving trees, pro daylight water and a superb waterfall made with particles.
Now suppose I want to PAUZE the complete scene. Can I somehow give instructions to unity3d to stop all physics processing (my particles follow gravity) and also to stop updating the water ?
If possible, is there also a way to advance in a scene by for example 40ms?
Why I need this? Well actually quite simple.
We are planning on making a big terrain with HUGE amount of trees and foliage. This will be rendered in 1920x1080 resolution and there will be more then 10 million drawcalls.
We don’t want it do be realtime, but we want to take screenshots so we can composite this later in adobe premiere and make a HD 1920x1080 Blu-ray movie with it.
If physics, particles and water isn’t used ten this is easy of course, but it gets more difficult when we DO have physics and particles for the waterfall + the o so nice daylight water for our aqua parts
So I think this could only be done if it would be realy possible to pauze everything, take the screenshot and then advance 40ms and take another screenshot.
at so many drawcalls it is very possible that the computer won’t even make 1fps realtime, but that doesn’t matter since we want to render a movie, not make it realtime.
Any hints on making this possible are extremely welcome.
So frames requiering more then 1 sec to render wouldn’t work.
Waht I’m more looking for is a way to halt everything in the scene. Like tha famous Matrix movie scene where the whole scene including all action freezes and only thing which happens is camera rotates.
You do realize that there isn’t a single system in the world that can handle “10,000,000” draw calls right? Most computers can’t even handle 10 thousand let alone 10 million (run the difference between the two numbers in your head and you’ll see what I mean).
If you mean 10 million polygons then that sounds possible but performance will suffer greatly even on high end systems. But it could work for screenshots.
As for stopping time, have a look at Time.timeScale (this will affect all runtime events that rely on time components, such as animation, transforms, and functions that rely on the Time API). You will need a more elaborate system if you want to manipulate the camera as you would in realtime.
Actually, EVERY system can handle 10 million drawcalls.
It can even handle as many drawcalls as you can imagine. Just it can’t do it realtime, but that was not what I asked for. It may easily use upto 5 to 10 secs to make 1 single image.
A drawcall is just writing 1 object into the color and depth buffer, so you can draw as many as you wish. Every card can do that but because of their speed they won’t be able to do this realtime of course.
Why on earth would you choose a realtime rendering system to create a pre-rendered scene? Surely you could get a far better result with something like Max or Maya or Blender or Cinema 4D or just about any 3D Modeling package?
I’m sorry but 10 Million drawcalls will bring a system to it’s knees, and I know you said it doesn’t need to be fast but the fact of the matter is that you will have realtime systems running in the background that alter the world such as physics, which means you have little to no control over how your shot will look.
What you want is a 3D modeling and rendering package, not a realtime graphics, physics, sound engine…really, you will get far better results.
And that there lies the problem. Your trying to make a pre rendered movie inside of an engine that simply can’t handle it. Do what Murcho said. Use a 3d graphics package, not a realtime one.
With pre rendered engines, you get the benefit of making everything within the 3d graphics program the rendering engine comes with (Maya, 3DS Max, Cinema 4D etc), as well as being able to control the visibility of objects and quality of the viewport (for setting up your scenes and such) and rendering with a MUCH better quality than you will ever get with a realtime engine.
With realtime engines, your at the mercy of the redraw rate. 10 million draw calls will NOT be 5-10 seconds redraw rate, it will be something like 20 minutes. That means for every move you make within Unity, the view won’t be updated for 20 minutes. Crazy right?
Seriously dude, use a 3d graphics program for a heavy scene animation, and leave the realtime engines to realtime applications.
I’d just like to add that we aren’t trying to put down your method, we just find it hard to understand why you would choose such a difficult path based on the information you have provided. You say you have good reason to use a realtime engine, then go for it, but from the information you have provided on what you are trying to achieve, a 3D Modeling and rendering system will be far easier, and give far better results.
To give you an idea on what issues you may run into graphics wise, we had a scene pushing 17 Million triangles and around 17,000 draw calls (don’t ask why), and in the build, with a 4850x2 in crossfire mode, we were struggling to push 20 fps. Now if you want to push it further than that, you will need to make sure that you have enough VRam to accommodate all the models/textures, and then all Render Textures, and then hope that it doesn’t just lock up your computer for 20 minutes, and then hope that after 20 minutes you actually have a shot worth taking.
Once again, we aren’t trying to sound condescending, we are trying to help people on the forums here find better results, and based on the information you have provided, we feel you will get a better result in a modeling package. Thats all.
I helped someone out recently trying to setup a pause system for a game, the idea was to basically have a manager script that holds a reference to each object in the scene that requires pausing. Now whether thats animation pausing, movement pausing, or anything else, you will still need to work out what each one needs. If you’re working in C#, it’s easiest to implement something like a IPausable interface on each script that requires pausing, and then just send messages from your manager class to sync it all. If you’re working in JS, possibly just a commonly named function, I don’t work in JS any more so I’m unsre of the best approach there. If you’d like a more in depth solution let me know.
Good luck, I hope you find a good solution that works well.
I guess you can use Time.timeScale to control the scale at which time is passing. Time.timeScale = 0.2f; does the slow motion effect. Time.timeScale = 0.0f; stops the objects.