Stride: scene blacks out at some camera angles when using multiple SceneTextures in parallel

Hey!

I’m using Gamma 2021.3.0 + Stride 0.9.69

I’m having this super weird thing with Stride that I was finally able to track down.

I’m rendering my scene in both a debug view through a SceneWindow, and also multiple SceneTextures for some immersive POV via PerspectiveLookAt.
By times, from some camera angles the scene would render fine, and sometimes my geometry would not render at all.

I finally managed to narrow it down to the use of multiple SceneTextures that I use to store the different perspective views for the different videoprojector outs.

  • when these SceneTextures are disabled (then F8, F5), I can rotate inside the scene without problem
  • when these SceneTextures are enabled (then F8, F5), there are some “dead angles” from which the whole scene just stops rendering.

I have no problem with only one SceneTexture in parallel with my main SceneWindow; the problem starts with two, and gets worse as I add more. (the more SceneTextures, the longer the black out).
This would let me think about a video memory issue? But I’m using a RTX 2080 so would be kind of surprised to hit a limit here with such a basic scene?

Other weird thing, as mentionned in the patch: while stripping down my real patch, I noticed that the problem shows up only when I leave 2 Translations that cancel each other (one on parent geometry level, other at child/instance level). If I take this out, the problem disappear…
In my real patch these two translations are really useful, although it seems dummy here; and anyways I can’t see how this should have an impact on the problem, so I left it here to help track it down.

We have a show next week and the main screen is at one of these dead angles, so texture is black, and I can’t find a workaround so far :(

Hope this will bring up something fishy that we can’t get rid of!
Let me know if I can be of any help to track this down.

Best
T

debugStride_20210221.vl (55.2 KB)


(FYI just tested the patch above with Gamma 2021.4.0 and problem is the same)

I guess your option would be to go setup Surround Span, use only one Scene Texture or Scene Window and hope for viewports to work…

1 Like

Indeed, but I don’t think there’s a way yet to input a spread of Viewports in a Stride renderer for that strategy?

I really suspect something wrong with Transformation composition actually. The fact that disabling the two Translations fixing the problem makes so little sense, and kind of reminds me of this problem I spotted the other day, which would make a light disappear if it was straight above the target.
Tebjan said it’s a know problem related to the LookAt function inside, maybe there’s a transformation composition bug down deep that leads to problems in this scene as well?

Yea with perspectivelookat it’s pretty possible specially if your transformation order is incorrect, but you would expect same behaviour on one renderer.

The problem you might facing is that normal transform uses only xyz component of vector and everything with projection would use xyzw, so then if you apply transform after w can be overwritten or handled incorrectly… The second one also quite popular error is that you have far near plane incorrect, maybe there is node to override that…

1 Like

Indeed, because in my full patch tweaking the near plane made things better; not in this debug patch though, so the issue is interesting.

(Now in my full patch changing the near plane got rid of the geometry disappearing, but I now have missing Light Shafts, which also seem very sensitive to near/far planes. They work with Orbit Camera and not with Camera, while Orbit uses a camera inside… So I’m tweaking with injecting view/proj matrices directly, but with no luck. Something fishy with the Projection Matrix going on in the whole chain imho.)

Maybe this due to you try to apply transform after view and projection matrix multiplied so the next transform would change the projection also… Anyways there is not much to do about that… I haven’t yet tested this stuff extensively… And the lookat is bit different matrix then regular SRT…

I think you spotted part of the problem actually!

In my full patch I indeed managed to get my LightShafts back after overriding the near/far planes inside the LookAtRectCamera node with SetNearClipPlane / SetFarClipPlane (capture below).
I don’t really get the values I need to put in though, they make no sense compared with the bounding box of the shafts…

An OrbitCamera will be fine with 0.05-100, but I need to override the PerspectLookAt planes with something around 15-1000 to get them appear with a similar aspect, from about the same POV in the scene. Do you see a reason for such a different range?

Altough I was confident in solving the debug patch above with the same trick, I didn’t succeed though, so Truth is (still) Out There.

I guess, either Far Near is incorrect for PerspectiveLookAtReact, either when perspective matrix applied it multiplied with another projection matrix or FarNear inside of Camera node.

1 Like

New side-effect discovered today: deleting the bunch of SceneTextures is the only way to get shadows in my scene, otherwise they don’t work 🤷‍♂️

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.