I’m trying to implement Portals (™ ® ©) and I’ve previously raised this issue (HELP! Can anyone explain "weird" shader behaviour (affine "correction") and Affine shader rendering causing visual artifacts).
I think the problem boils down to having multiple camera enabled at the same time.
The secondary camera renders correctly:
but part of the the image seems to bleed through to the
primary camera:
Is there are way to switch camera on to render then off when finished?
if you need the other camera to render every frame, then you cannot turn it off and on again during the same frame, those settings are not applied mid frame really.
But we do support multiple cameras at the same with shadows just fine, for example: PlayCanvas Examples
I remember a screenshot from your project issue before, and I’m not sure it was shadow … it didn’t look like a shadow issue to me.
Maybe I remember some other thread. I just looked at the threads you listed above, and I’m not sure there’s any shadow issue there, it seems like issues with matrices for the cameras / projecting texture back onto the world geometry.
This isn’t a shadow issue.
The final render goes like this:
1

(This should be blank but part of the render seems to be a leak from the second camera)
2

3

Final image

The final image should be:

I’ve just done some more investigation and it’s not a leak between cameras.
1 above, the camera is rendering to texture, but the render surface is off-screen so shouldn’t be visible.
In addition to rendering to a texture I’m also cropping it.
This one is really getting away from me.
I’ll have to regroup and try to come up with more coherent questions in a new thread.
Sigh
1 Like
I don’t want to jinx it, but I think I’ve finally fixed it.
See (Affine shader rendering causing visual artifacts - #25 by CarlBateman) for details