Skip to content

Conversation

@SiboVG
Copy link
Member

@SiboVG SiboVG commented Mar 29, 2023

This PR fixes #2076 and adds support for transparent background rendering and exporting in PhotoStudio. A fully transparent color is just rendered as white.

Demo:

Screen.Recording.2023-03-29.at.19.38.17.mp4

@neilweinstock
Copy link
Contributor

Should we have an "Opacity" slider in the settings panel, like we do for Appearance?

@hcraigmiller
Copy link
Collaborator

Functions as expected, no anomalous behavior found.

OR Build: 1677
Microsoft Windows 11 Pro; 10.0.22621 Build 22621.1105; Windows Feature Experience Pack 1000.22638.1000.0
Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)

@SiboVG
Copy link
Member Author

SiboVG commented Mar 29, 2023

Should we have an "Opacity" slider in the settings panel, like we do for Appearance?

Probably a good idea, yes, I'll include that in this PR.

Something unrelated: but I'm not too happy with the workflow that you first have to select "None" in the sky image combo and only then can use a sky color. I think something like a radio button to switch between "color" and "image" would make more sense. Thoughts on this @neilweinstock?

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 29, 2023

Should we have an "Opacity" slider in the settings panel, like we do for Appearance?

Are you suggesting an "Opacity" slider in Photo Studio on the Environment tab? If so, thumbs up.

@SiboVG
Copy link
Member Author

SiboVG commented Mar 29, 2023

Should we have an "Opacity" slider in the settings panel, like we do for Appearance?

Are you suggesting an "Opacity" slider in Photo Studio on the Environment tab? If so, thumbs up.

Yes, I'd say below the sky color item.

@neilweinstock
Copy link
Contributor

Are you suggesting an "Opacity" slider in Photo Studio on the Environment tab? If so, thumbs up.

Yes, I'd say below the sky color item.

Yes, should like just like the appearance tab, minus the "Shine" parameter.
image

Something unrelated: but I'm not too happy with the workflow that you first have to select "None" in the sky image combo and only then can use a sky color. I think something like a radio button to switch between "color" and "image" would make more sense. Thoughts on this @neilweinstock?

Hmmmmmm. I agree that the current implementation could be better. Not sure if radio buttons are the right way to go (might be, but not yet sure). Let me think on it for a few minutes.

@SiboVG
Copy link
Member Author

SiboVG commented Mar 29, 2023

Opacity slider added:

Screen.Recording.2023-03-30.at.01.27.59.mov

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 29, 2023

Opacity/transparency inoperative.

Transparency

OR Build: 1679
Microsoft Windows 11 Pro; 10.0.22621 Build 22621.1105; Windows Feature Experience Pack 1000.22638.1000.0
Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)

@SiboVG
Copy link
Member Author

SiboVG commented Mar 29, 2023

Opacity/transparency inoperative.

Transparency

OR Build: 1679 Microsoft Windows 11 Pro; 10.0.22621 Build 22621.1105; Windows Feature Experience Pack 1000.22638.1000.0 Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)

That's very odd, works perfectly for me... In your first comment you mentioned that this PR worked as expected, so it stopped working after the slider was added?

@hcraigmiller
Copy link
Collaborator

In your first comment you mentioned that this PR worked as expected, so it stopped working after the slider was added?

Yes.

@hcraigmiller
Copy link
Collaborator

Still not working.

OR Build: 1680
Microsoft Windows 11 Pro; 10.0.22621 Build 22621.1105; Windows Feature Experience Pack 1000.22638.1000.0 Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)

@SiboVG
Copy link
Member Author

SiboVG commented Mar 30, 2023

Are your saved PhotoStudio images also opaque? And does it not work over the full 0-100% range, or only at those extremes? And do you have "use off-screen rendering" enabled/disabled?

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 30, 2023

Okay, I found the issue. I switched computers mid-stream and didn't realize that one device had the "off-screen rendering" enabled and the other disabled. Apparently, this feature, on my dvices, requires off-screen rendering to be enabled. This is going to need a Wiki explanation.

With that caveat, functions as expected, no anomalous behavior found.

OR Build: 1680
Microsoft Windows 11 Pro; 10.0.22621 Build 22621.1105; Windows Feature Experience Pack 1000.22638.1000.0
Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)

@SiboVG
Copy link
Member Author

SiboVG commented Mar 30, 2023

Okay, I just implemented "artificial transparency rendering"® when a system does not have off-screen rendering enabled. Since changing the opacity slider basically blends the sky color with a white background (= how transparent background is rendered), I just check whether off-screen rendering is enabled or not. If it isn't, I blend the background color with a white color, depending on the opacity value.

So, there is no need for a Wiki explanation, and this feature should work for all users now. Saving the image with transparency also works for both cases.

Demo (first with off-screen rendering enabled, then with off-screen rendering disabled):

Screen.Recording.2023-03-30.at.13.27.14.mp4

PS: don't mind how wacko the off-screen rendered PhotoStudio looks on my machine, #JustJOGLThings.

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 30, 2023

With off-screen rendering enabled and sky color active, checking the flame or smoke effect strips color/decals from rocket. Once stripped, Photo Studio must be closed and reopened to correct. If one (or both) is checked when opened, the color/decals will be stripped.

With off-screen rendering disabled and sky color active, checking then unchecking the flame or smoke effect (the initial check does not trigger error), or checking both, strips color/decals from rocket. Once stripped, Photo Studios must be closed and reopened to correct. If one (or both) is checked when opened, unchecking one has the same effect.

OR Build: 1690
Microsoft Windows 11 Pro; 10.0.22621 Build 22621.1105; Windows Feature Experience Pack 1000.22638.1000.0 Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)

@SiboVG
Copy link
Member Author

SiboVG commented Mar 30, 2023

With off-screen rendering enabled and sky color active, checking the flame or smoke effect strips color/decals from rocket. Once stripped, Photo Studio must be closed and reopened to correct. If one (or both) is checked when opened, the color/decals will be stripped.

With off-screen rendering disabled and sky color active, checking then unchecking the flame or smoke effect (the initial check does not trigger error), or checking both, strips color/decals from rocket. Once stripped, Photo Studios must be closed and reopened to correct. If one (or both) is checked when opened, unchecking one has the same effect.

Is this a result of this PR or is it present in 22.02?

@hcraigmiller
Copy link
Collaborator

Is this a result of this PR or is it present in 22.02?

Ah. . . yes. Regrettably it is. Good for this PR, bad for me.

With that caveat, it appears to be functioning as expected.

OR Build: 1690
Microsoft Windows 11 Pro; 10.0.22621 Build 22621.1105; Windows Feature Experience Pack 1000.22638.1000.0 Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)

@SiboVG SiboVG merged commit 57c3522 into openrocket:unstable Apr 1, 2023
@SiboVG SiboVG deleted the issue-2076 branch April 1, 2023 07:44
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

Successfully merging this pull request may close these issues.

[Feature Request] Transparent background in photo studio

3 participants