Is is possible to define what should be rendered in a render texture - ie. exlude rendering certain parts?
We want to render 50% on one PC and render the remaining 50% on another PC to get optimal performance.
Appriciate any input on this.
Is is possible to define what should be rendered in a render texture - ie. exlude rendering certain parts?
We want to render 50% on one PC and render the remaining 50% on another PC to get optimal performance.
Appriciate any input on this.
Yes it is, though not easily. You would need to setup off-centered frustums. Problem is, that’s not a Unity feature. But you can set your own projection matrix on the camera.
Thank you for your reply! Can you elaborate / specify how this would be done using the projection matrix? Appriciate any additional information.
Also was wondering how to do such a thing! Will be very grateful for any examples or tips!
Well you would need to generate your own projection matrix, which mean dealing with the math behind perspective projection. And that the not so easy part.
Actually, there is an example in the unity docs to get started:
The problem with messing with the projection matrix is that all sorts of post-effects and whatnot seem to stop working properly if you shift the picture outside of what would normally be rendered by that camera.
For example: If I shift the image 100% to the left you can see that shadows end around 50% outside of the original view.
If only we could tell the camera to only render a certain region of it’s view. Viewport-Rect doesn’t help because it changes the aspect ratio of the screen and keeps rendering the central part of the image.
Of course messing with the projection matrix will brake other stuffs since by doing that will conflict with the standard Unity rendering pipeline. You have to know what you are doing and take care of the consequences. But there’s no other way to solve what the OP is asking for.