![]() ![]() ![]() If you're thinking about doing something along the lines of a dynamic split screen like TT Games' Lego games, then all 3 options are perfectly viable. You mentioned split screen as your end goal. There are ways to optimize this, but this is again another topic entirely. For the most part this shouldn't be a concern, but this does mean you're still paying the CPU cost of sending those objects to the GPU to render, and the GPU cost of calculating the vertex positions. None of these techniques will prevent objects within the camera view frustum, but not visible due to the mask, from rendering. You can use stencils and ZTest together to make some parts of rendering the Z mask easier, or allow for more complex interactions with the "mask" and the world, like for portals. You can use the ZTest or stencil based approach to help speed up the render texture approach, they're not mutually exclusive. If that's something you're interested in doing, then it's the only option for doing that.Īn advantage of the ZTest & stencil based approaches is you don't need a render texture, which can make some things a little cheaper when rendering. "Modify the masked area at runtime" is a very open ended phrase that could mean a lot of things.Īn advantage of the render texture based approach is you can do soft masks. What you do and how you do it really comes down to the specific question of what exactly do you want to do. All 3 options you list can use a dynamic mesh or texture mask constructed on the CPU, or use a shader to create the shape on the surface of a static mesh. Some random thoughts before we get further in.ĭynamically modifying masked area is a completely separate topic, and kind of doesn't matter for which method you use. There are other options, but they're insane things like modifying all of the geometry in real time. You've kind of got the 3 viable options down. cons: Possibly based on me completely misunderstanding ztest, complicated mesh updating at runtimeĪre there other options I haven't considered, or easier ways to do this?.Create a mesh mask with a shader that blocks objects behind it, but doesn't render anything itself.cons: Have to modify all other shaders to use the stencil.pro: Skips some rendering in masked areas.Create a mesh in front of the camera with a cut out area and a stencil shader.cons: Doesn't reduce objects rendered by the camera, can't easily modify the mask.Render camera to a RenderTexture with a mask texture and custom shader.Here are the options I'm aware of (please correct me if any are wrong) and optionally modify the masked area at runtime.and reduce rendering in masked areas as much as possible.so that it can be overlaid on another camera.Mask a cameras viewport/rendering area to a non-rectangular area.I'm trying to create a dynamic splitscreen effect, so that's adding some factors I'm considering, but I'm asking this question to try and get a more general overview of the options regardless of application. ![]() I'm working with the built-in render pipeline, but I'm happy to hear if there are more options in SRP! ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |