I have a bunch of SceneCaptureCubes within my level. I use them to build cube textures that are then applied to materials within the scene. The SceneCaptureCubes are not used at runtime, but they appear to be allocating a cube rendertarget.
Is there a way to make these actors editor-only so that they are not loaded up at runtime and do not allocate a cube rendertarget that is never used?
Obviously I don’t want to delete them before running/packaging as they are used to rebuild my cubes textures after I update the scene in the Editor.
Hi!
Try to create static texture from Texture renderTarget of your SceneCaptureCube actors and use this static cubemap in your shaders instead TextureRenderTarget.
Hi svv3dUDN,
I’m using static textures. Turns out that I was able to resolve all the references to cube rendertargets except for the defaults created by Unreal: ReflectionColorScratchCubemap0 and ReflectionColorScratchCubemap1.
My problem is that I earlier had to modify the GReflectionCaptureSize (both in ReflectionCaptureComponent.cpp and in ReflectionEnvironmentShader.usf) to create the hires cubemaps that my app needed. The results are great, except I’m not discovering that the two unused runtime scratch cubemaps are huge and taking up precious texture memory.
I don’t want to have a pipeline that requires having one set of source code (cpp and usf) for building and using the UnrealEditor and different set of code for running and packaging the game.
It’s fairly easy to modify the ReflectionCaptureComponent.cpp so that it is different for editor vs game. But I’m unable to properly resolve how to modify ReflectionEnvironmentShader.usf.
Any ideas?
Thanks,
Essentially I have my reflection cube texture system working very well, but when run in game I’m getting an extra 500mb of scratch texture memory being used. Most preferably I would want to switch back from 2048x2048 (11mip) editor-time capture down to 128x128 (7mip) runtime capture.
I had started going down the route of adding a SetDefine specific for the issue at hand, but I’m not sure how to get the rebuilding of shaders to occur at the right time (rebuilt during the build process - and then rebuilt again for the editor).
Any ideas?