Scene Capture 2D max resolution

Hey guys-

TLDR: Scene Capture target texture resolution does not go over 256 pixels, and we need a way around that limitation.

We think this is a bug, but we need to be able to capture a series of target textures at 2048 apiece in a pre-rendered matinee sequence. If we go higher than 256px on the texture render target, it streaks the textures out in both matinee make-movie and the standalone player. It does not streak in the editor, or when we simply play the shot in an external editor window.

I can export a single frame by right clicking on the texture target in the content browser and using the “export” command.

So we need to either be able to get up to 2048px in the target texture, or we need some sort of solution that will advance the shot on 1/60th of a frame and export the target texture, and this needs to include our particle systems.

Hey ChasN -

I am not having any problem setting my Render Target’s to 2048x2048 and having streaks in either standalone or otherwise. Could you post some screenshots showing the results that you are getting? Also are you displaying the Texture via a HUD or on a Mesh’s Material? Finally, what version of the editor are you using?

Thank You

Eric Ketchum

Sure thing. You can see the attached.

This was created in vanilla 4.3. It is a texture on a material that is then placed on a mesh.

Also, here’s a variable that is involved: we are on Windows 8.

One final thing before I start to reproduce, could you give me a screenshot of the texture render target in the texture editor?

Thank You

Eric Ketchum

Yes sir, here you go

So we tested this on a windows 7 box, and are getting the same results, AND, it seems like 512px actually works, but is still too low res for us. We really need 2048.

Thanks for looking/reading.

Yeah, I’ve checked that. It’s not a UV issue. I’ve done it with three different planes, some coming from UE’s internal assets, and another from a plane that I created in Maya, all with correct UV’s.

And if it were a UV issue, the problem would be consistent across the board, and it wouldn’t work at all in the editor (it does work). Plus, the amount of streaking changes according to the texture resolution that I apply. If I change the res to 1024 the streaking is different than if I do 2048.

Thanks

Hey ChasN -

This error looks like a UV issue. The Mesh that you are projecting the Render Target on to, how is it unwrapped? Could you post a screenshot of your mesh’s UV map in the Static Mesh Editor and you Material setup as well for how the Render Target is applied. I will see which would be better fixed.

Thank You

Eric Ketchum

Fantastic, thank you sir!

Hey ChasN -

I was finally able to reproduce this issue and have alerted our Engineers to the issue. I will keep you informed as I know more, but currently have no time table for a fix.

Thank You for your help tracking this down.

Eric Ketchum

Hi!

I’ve been looking at this today, and believe I have identified the problem. It’s related to the way scene render targets are allocated, and the fact that currently scene captures to a render target bigger than the main view won’t cause the scene render targets to be reallocated to the correct size, hence why you get a main-view sized patch of goodness in your output, and garbage in the rest.

The solution to this isn’t trivial, but we’re in discussions now and will hopefully be able to get a fix in very soon!

Thanks for your patience,

Graeme

*> It’s related to the way scene render

targets are allocated, and the fact
that currently scene captures to a
render target bigger than the main
view won’t cause the scene render
targets to be reallocated to the
correct size*

I’m not sure that I fully understand what you are saying, and I think that is mainly because I am capturing an image to the render target texture that is not bigger than, but is actually smaller (768px), or as small (1024px), as the main render view.

Also, it doesn’t really explain why it will work properly in the editor window play, or the external editor window play, regardless of any and all resolutions.

Maybe I am just misunderstanding what you are trying to convey, and I do appreciate the response…

And I don’t know that this actually “answers” the question, for whatever that is worth. Especially given the editor vs standalone disparity.

It works in the editor because when we’re in editor mode we allow the scene rendertargets to grow as bigger sizes are requested. This is to stop constant unwanted reallocations when the editor viewports are resized.

In my tests, having the destination render target being smaller than the main viewport gave me correct results, so I’m not sure what is going on there. In my case, Can you confirm that, when setting the destination render target size to 512x512, and running a standalone game at 1280x720, you still see this problem? I’ll double check that case in the morning and get back to you.

Graeme

Yes, it is happening at several final resolutions above 512x512. I have tested at 1k squared, 2k squared, and 1920x1080. I didn’t test it specifically at 720p, but all of the sizes are >textureTarget resolution

I fixed this problem by doing the following:

Goto: YourProject/Config/DefaultEngine.ini → Script/Engine/RenderSettings

and Add:

r.SceneRenderTargetResizeMethod=2
r.SceneCaptureResizeMethod=1

You risk, having insufficient memory! From source of unreal4:

static TAutoConsoleVariable<int32> CVarSceneTargetsResizingMethod(
	TEXT("r.SceneRenderTargetResizeMethod"),
	0,
	TEXT("Control the scene render target resize method:\n")
	TEXT("(This value is only used in game mode and on windowing platforms.)\n")
	TEXT("0: Resize to match requested render size (Default) (Least memory use, can cause stalls when size changes e.g. ScreenPercentage)\n")
	TEXT("1: Fixed to screen resolution.\n")
	TEXT("2: Expands to encompass the largest requested render dimension. (Most memory use, least prone to allocation stalls.)"),	
	ECVF_RenderThreadSafe
	);

static TAutoConsoleVariable<int32> CVarSceneCaptureResizingMethod(
	TEXT("r.SceneCaptureResizeMethod"),
	0,
	TEXT("Control the scene render target resize method for scene captures:\n")
	TEXT("(This value is only used in game mode and on windowing platforms.)\n")
	TEXT("0: All scene capture renders are limited to screen resolution or smaller. (Default - prevents allocation when requested dimensions are too large.)\n")
	TEXT("1: Allows scene capture targets to expand to encompass the dimensions requested.\n")
	TEXT("   (large sizes could cause stalling without 'r.SceneRenderTargetResizeMethod 2'. Out of memory issues can occur if size is too large)"),
	ECVF_RenderThreadSafe
	);