aframe icon indicating copy to clipboard operation
aframe copied to clipboard

Image result from screenshot very dark

Open Kershawj opened this issue 4 years ago • 5 comments

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 ss_aframe_v1_0_4

Image captured from aframe 1.2.0 ss_aframe_v1_2_0

  • A-Frame Version: 1.2.0
  • Platform / Device: All

Kershawj avatar Aug 26 '21 12:08 Kershawj

Might be related: https://github.com/aframevr/aframe/issues/4817

You may want to experiment with renderer on scene colorManagement: true

kfarr avatar Aug 29 '21 02:08 kfarr

@Kershawj Does @kfarr suggestion solve your issue?

dmarcos avatar Sep 06 '21 04:09 dmarcos

@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 avatar Sep 06 '21 09:09 Kershawj

@Kershawj Sorry, I didn't understand. Can you elaborate on what changes did you do to the screenshot component? Thanks

dmarcos avatar Sep 08 '21 22:09 dmarcos

@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.

ssfix.js.zip

Kershawj avatar Sep 09 '21 13:09 Kershawj

I think this is fixed by https://github.com/aframevr/aframe/pull/5157. Closing and can reopen if problem persists.

dmarcos avatar Nov 21 '22 02:11 dmarcos