Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird camera exposure & color #27

Open
safdarzareef opened this issue May 22, 2023 · 5 comments
Open

weird camera exposure & color #27

safdarzareef opened this issue May 22, 2023 · 5 comments

Comments

@safdarzareef
Copy link

safdarzareef commented May 22, 2023

Hi @TimmHess, thanks for this repo. I am having similar issues. Would you be able to help me with it? I tried what you suggested above (the GEngine->GetDisplayGamma() part) but they change very little. Right now, I have:

Editor:
image

Saved Image:
image

I am using jpegs to save by the way - I changed the ERGB format on CameraCaptureManager.cpp Tick() to RGBA. Also changed the pixel format on SetupCameraComponent to PF_R8G8B8A8 to match it.

Thanks a lot for your help! (Also commented on #8, not sure whether you want a new issue or just the old one.)

@TimmHess
Copy link
Owner

Hey,
maybe I am able to help a little. While issue #8, indeed, look similar, I think the cause could be quite different.

I am assuming that you are using a rather recent engine version 5.1 or 5.2? And that you are making use of global illumination (GI) features judging from the scene setup visible in your renders?
Apparently, the SceneCapture2D was skipped in GI up until engine version 5.1 - but now it should be supported. From my experience, you need to tick GI explicitly in the CaptureComponent's post-process settings even when having a PostProcessVolume active (maybe that changed in 5.2). But, be aware that emissive materials and their light emissions might not be rendered correctly (again I only tested in 5.1).

Even though this still not quite explains the blatant color mismatch of the walls, especially since all other objects seem to be rendered correctly (?). But maybe there is something weird happening in the deferred render of CaptureComponent that results in this behavior... Or it might be a combination of GI and Gamma entangling to weird results.

In any case, I hope this gives you a direction to look, unfortunately, I will be rather busy the next 2 weeks so I could only try to interact with you based on your findings but I won't make it to dive deeper myself.

Maybe only one more thing - depending on what you need - you could try looking into MovieRenderQueue plugins for capturing (and annotating). They might not be as versatile but maybe they circumvent issues with the CaptureComponent.

@safdarzareef
Copy link
Author

safdarzareef commented May 22, 2023

Hey, thank you a lot for your response. I am using 5.1 and GI features. By ticking do you mean doing this:
image

If so, that still didn't make a difference, unfortunately. I have two questions:

  • Also, can the MovieRenderQueue output mp4s/jpegs similar to your plugin?
  • Is there a way to replace the SceneCapture2Ds with a camera actor?

Thank you so much!

@TimmHess
Copy link
Owner

I never looked into the RenderQueue because I always felt it was too static for my purposes. But it might as well not be and I just shied away from it... I once saw a render + annotation plugin for it on the marketplace though.

There must be a way to grab buffers directly from a camera. It is not possible with this codebase. But you can check out this blog https://medium.com/@weirdframes/bringing-deep-learning-to-unreal-engine-5-pt-1-aa84c8c05ffa
It is targetting a totally different issue, BUT in the process, it reveals how to read pixels from a camera. At some point, I will do an effort to combine this codebase with the solution proposed in the blog above. Maybe you can give it a try :D

@TimmHess
Copy link
Owner

And about the GI - yes these are the flags I meant. In my test, I placed a SceneCapture with a TextureTarget/RenderTarget for testing purposes, and then ticking exactly these, as you did in the CaptureComponent's settings, at least gave me a change in the render target. But I never tested it together with the capturing code..

@safdarzareef
Copy link
Author

Hmm I see, thank you @TimmHess. I'll try changing things around/looking at things, and update it in this thread if I find anything useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants