jschwuch Posted April 10, 2017 Share Posted April 10, 2017 Hi, I'd like to know if there is any way to tell a camera to only render when I want it to. I have a setup with two cameras, where one of them shows the entire scene from above and the other shows only a small segment of the scene. I'd like to be able to render the camera that shows the complete scene from above only when something changed (I decide when a [significant] change happend, not BJS) so I can have better performance on the second camera which only shows a small portion of the whole scene. My scene is rather big so that I have some serious performance problems when the complete scene is rendered on every frame. I'm aware that I could use two planes with dynamic textures rendered from the two cameras and set the refreshrate on the renderTargetTexture, but as it is now I have two cameras with different viewports set and would like to keep it this way (don't want to change too much code). I hope my question is clear and there is a way to accomplish this without using dynamic textures. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 10, 2017 Share Posted April 10, 2017 hello, you can simply add/remove your camera from scene.activeCameras to enable/disable rendering Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 11, 2017 Author Share Posted April 11, 2017 Hi, thx for your answer but it's not the solution I'm seeking If I remove the camera from activeCameras the camera won't be displayed anymore. I need it to display but not refresh (unless I tell it to). Maybe you have another idea? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 11, 2017 Share Posted April 11, 2017 There is no way to render the camera only when needed then. Because the image is regenerated on every frame. Only available option in this case is to use what you mentioned: rendertargettexture Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 12, 2017 Author Share Posted April 12, 2017 Ok, thx for the info, than I'll consider changing my setup to using rendertargettextures. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.