aframe
aframe copied to clipboard
Image result from screenshot very dark
Using the keyboard shortcut to capture a screenshot of objects within a scene results in a very dark version of the rendered content seen in the experience. Worked fine, correct colors, in version 1.0.4 Anything after that it appears much darker. See attached images. I think a fix was done as THREE.CubeCamera needed a render target #4685 wonder if specifying encoding or filter on the render target might have changed it?
Image captured from aframe 1.0.4

Image captured from aframe 1.2.0

- A-Frame Version: 1.2.0
- Platform / Device: All
Might be related: https://github.com/aframevr/aframe/issues/4817
You may want to experiment with renderer on scene colorManagement: true
@Kershawj Does @kfarr suggestion solve your issue?
@kfarr Thanks for the suggestion and indeed changing colorManagement whilst using 1.2.0 does mean that the screenshot appears the same as the model in the scene. Both are then very dark as seen in the example images. However I've set that to true as it's how I would like it to appear, i.e. Lighter in the scene on the page and would expect the screenshot to reflect that. @dmarcos So I don't really think that's the solution for me, so I found the source for the screenshot component and copied the same. I then just changed the name and registered that "new" component on the page. This fixed the problem and in 1.2.0 and with colorManagement set to true gives me a correctly coloured screenshot. I didn't change anything in the code for the component so presume it's something to do with the order things are defined, but kinda at my limit there!
@Kershawj Sorry, I didn't understand. Can you elaborate on what changes did you do to the screenshot component? Thanks
@dmarcos Sorry for the delay But that's kinda the thing, I didn't. I made no changes to it. Here's what I used.
I just included it in my index file <script src = "./scripts/ssfix.js"></script>
I added the screenshotfix component to the scene definition, then I changed the way I requested a screenshot in my code.
So rather than using
sceneel.components.screenshot.getCanvas("perspective");
I used
sceneel.components.screenshotfix.getCanvas("perspective");
Which somehow fixed the problem reported.
I think this is fixed by https://github.com/aframevr/aframe/pull/5157. Closing and can reopen if problem persists.