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

Totally black rendered images #19

Open
andreascip98 opened this issue Nov 21, 2020 · 5 comments
Open

Totally black rendered images #19

andreascip98 opened this issue Nov 21, 2020 · 5 comments

Comments

@andreascip98
Copy link

andreascip98 commented Nov 21, 2020

The recording functionality (r key) should produce the rendered frames as images, to ./Playback folder.
The problem is that i'm getting totally black images, even changing fps or resolution or any settings inside "camera.py".

Any guess?

@Qwerter49
Copy link

I just started using this program and I'm having the same issue.

@jookovjook
Copy link

Found solution, works perfectly:

Inside ray_marcher_demo.py

from PIL import Image
from PIL import ImageOps

# REPLACE THIS:
pygame.image.save(window, 'playback/frame' + ix_str + '.png')

# WITH THIS:
glPixelStorei(GL_PACK_ALIGNMENT, 1)
data = glReadPixels(0, 0, window.get_width(), window.get_height(), GL_RGB, GL_UNSIGNED_BYTE)
image = Image.frombytes("RGB", (window.get_width(), window.get_height()), data)
image = ImageOps.flip(image)
image.save('playback/frame' + ix_str + '.png', 'PNG')
# Do the same for:
pygame.image.save(window, 'screenshot.png')

@harperawl
Copy link

when i replace it, it says there's an error with an "unexpected indent." i'm new to stuff like this, can someone help?

@Ayers-Kendall
Copy link

when i replace it, it says there's an error with an "unexpected indent." i'm new to stuff like this, can someone help?

Python 3 does not allow the mixing of spaces and tabs. Delete the tabs at the start of each line you added and try adding spaces instead, or vice versa. It would be a good idea to download an IDE like VS Code which will autodetect which is being used in the current file and format it correctly (convert tabs to spaces if necessary)

@Ayers-Kendall
Copy link

I have fixed this issue in my fork of the repo, and plan to expand this project quite a bit when I have the time. Everyone feel free to check it out, and also contribute if desired

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

5 participants