Why is SceneTexture node not allowed to be used in Opaque or Masked material?

I don’t know exactly the reason, but some cases really need it. For instance, when some objects with Opaque material need to be culled with other object’s stencil.

The result in lower image was implemented using Render Target, but it’s not as efficient as using SceneTexture directly (lost at least 5% frame rate).

https://s13.postimg.org/bk8cnihav/ueue.gif

By the way, even Unity supports this feature.

It would be feasible with forward rendering. With deferred rendering you first render opaque. Then do lighting. Then copy scene color. After that you can render transparent with forward rendering using scene color. But with opaque you would have to use forward path(instead of deferred) which isn’t identical in quality wise or identical with rest of the scene…

well with deferred it would be possible to use the result of the last frame, just like SSR does :slight_smile:

That would just allow feed back loop. OP wan’ts to see what behind that opaque object.

oh wait yes, didn’t think that twice :smiley:

Actually opaque materials should be allowed to use Custom depth/stencil scene texture. There is no reason not to allow this.

您好,您解决了这个问题了吗。我遇到了相同问题,希望能得到您的帮助。

I developed a plugin named “SceneTextureForUMG”, which bakes scene textures so that they can be used for other materials.

I developed the plugin mainly for UMG, but I found your problem also can be solved by the plugin. This plugin bake scene textures to render targets, so you can use them at anywhere you want.