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

Rendering PNG not working #17

Open
csongorkeller opened this issue Oct 19, 2021 · 13 comments
Open

Rendering PNG not working #17

csongorkeller opened this issue Oct 19, 2021 · 13 comments

Comments

@csongorkeller
Copy link

Hi there,
I've tried rendering PNGs in the sample project and it doesn't generate anything. It first the image taking flow but then the folder remains empty...
Do you have any idea where to start looking to fix it?

@TimmHess
Copy link
Owner

TimmHess commented Nov 3, 2021

Hey,
does this issue remain for you? I just tested color image generation for .jpeg and .png settings, also in sequence. and I could not reproduce.
I also checked the git to make sure I did not forget to push anything lately, because I remembered that I indeed had this issue a while back.

@MrDasix
Copy link

MrDasix commented Jan 24, 2022

I have a similar problem. If i generate a float it doesnt create any file. If i generate a PNG it creates a file but its all transparent

@TimmHess
Copy link
Owner

Ok, I will certainly take another good look at this, however, it might take some days as I am currently away from my workstation. I will come back to you though

@MrDasix
Copy link

MrDasix commented Jan 24, 2022

Thanks! I have seen that if i use the plugins happens what i said, but if i use the project from the repo it creates exr files. Dunno how to open them in a correct format tho

@TimmHess
Copy link
Owner

Oh thank you for that hint! That will be useful.
You need a format like exr because you cannot save float values in uint8 encoded png by default. You can take a look at the openexr library for python. Thats what I use

@MrDasix
Copy link

MrDasix commented Jan 24, 2022

Okay, sorry. Now i created another empty project. Imported the UE5 plugin. Added a Blueprint of type CameraCaptureManager and attached a scenecapture. Now it works, but the JPG and EXR photos are all black.

`pt = Imath.PixelType(Imath.PixelType.FLOAT)
img = OpenEXR.InputFile("img_000000.exr")
dw = img.header()["dataWindow"]
size = (dw.max.x - dw.min.x +1, dw.max.y - dw.min.y +1)

R,G,B = [np.asarray(Image.frombytes("F", size, img.channel(Chan,pt)), dtype=np.uint8) for Chan in ("R", "G", "B") ]

img_rgb = cv2.merge([B, G, R])

print(img_rgb)

cv2.imshow("Hey",img_rgb)
cv2.waitKey(0)
cv2.destroyAllWindows()`

This is what im using to read the exr file

@TimmHess
Copy link
Owner

Yea for some reason I had the same issue with numpy.. You can try openexr lib, but if the jpeg is likewise black something will be off most likely.

@MrDasix
Copy link

MrDasix commented Jan 25, 2022

Okay, maybe i'm dumb and everything was right on the begining. I was capturing the image on BeginPLay event, and that was the problem. Now the plugin works flawless. Thanks you very much!

@TimmHess
Copy link
Owner

Ahh yes.. that will explain the issue. Thank you for sharing this.
Great to hear everything is working :) 👍

@Lap1n
Copy link

Lap1n commented Feb 6, 2022

In UE5, I was also getting black textures, but I found out that it was only occurring on models using Nanite.

@TimmHess
Copy link
Owner

TimmHess commented Feb 6, 2022

Thank you for letting me know!
Just to clarify - black textures on Nanite objects in the capture color image? That is definitely odd...
I did not yet test with Nanite objects, merely with MetaHuman :/

@Lap1n
Copy link

Lap1n commented Feb 8, 2022

Forgot to clarify, it was with segmentation capture images that the color was black.

@TimmHess
Copy link
Owner

TimmHess commented Feb 8, 2022

Alright, yes this will be because of Nanite seemingly not supporting a number of features (yet), amongst them - custom depth stencils:
https://forums.unrealengine.com/t/solved-vertex-painting-mesh-not-working-for-imported-meshes/267082/2

Sadly those are this project's source of annotation buffer... So I think this is currently not fixable, sorry :/

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

4 participants