Your suggestions are perfectly hitting my problem. But… ![]()
Texture Collection is still marked as experimental and, not working at all. Shader with Texture Collection node do not compile, here’s the error (same on 5.7.4 and 5.6.1):
LogShaderCompilers: Warning: Failed to compile Material for platform PCD3D_SM6, Default Material will be used in game.
Shader debug info dumped to: "F:\Unreal Projects\Testing547_New\Saved\ShaderDebugInfo\PCD3D_SM6\FMatExpressionPreview MaterialExpressionTextureSample_0_c51ba1cf8c3c820f\Default\FLocalVertexFactory\TBasePassPSFNoLightMapPolicy\0"
G:\Data\EpicGames\UE_5.7\Engine\Shaders\Generated\UniformBuffers\Material.ush(10,1): Shader TBasePassPSFNoLightMapPolicy, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/UniformBuffers/Material.ush:10:1: error: unknown type name 'FResourceCollection'
FResourceCollection Material_TextureCollection_0;
^
So I tested Texture Array and it worked, but… ![]()
I need Render Targets to be in this material. There will be a constant number of them, but they have to be able to be swapped, replaced by new render targets etc. So Texture Array could perfectly fit in this, but it only handle UTexture2D and UTextureRenderTarget2D do not inherit from UTexture2D (as I thought and as it would seem to be), but from UTexture. So, it is impossible to cast UTextureRenderTarget2D to UTexture2D. Yes, I know there are ways to extract content from Render Target as UTexture2D, but my Render Targets contents will be updated every frame, so copying more than one RT constantly every frame to UTexture2D will kill my game ![]()
Still looking for clean solution for this and still can’t figure it out
Only if Texture Collections would work or just Material Instance Dynamic on nanite landscapes ![]()
EDIT:
Found this Bindless Resources - UE 5.4 - #5 by koloved So far so good. Materials with Texture Collection nodes starts compiling and working. Now will try to put dynamically created render targets to the Texture Collection and see what happens. Will let you know here about the results.