-
Notifications
You must be signed in to change notification settings - Fork 7
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
Objects that have been made to look semi-transparent in the editor appear opaque on twotech #43
Comments
Fix for colour issue mentioned above also applied to glass, which was being tinted a blue colour. Objects now appear coloured, but are still not completely correct, and multiply is still a suspect. Also check when and how transparency is being applied, especially if it is before multiply. |
Related to #42 |
Removing the line I'm still working out what is going on here, but wanted to report that interesting tidbit. |
Or maybe I'm confused about this. What do we want, say, the Glass Bottle to look like? |
Do you have a screenshot of how yours is looking? |
For Glass Bottle, the issue is related to the third sprite for the object: Removing this sprite makes things better, but not as good as what's shown above. But it does remove the coloring, which makes sense, since the color field of the 3rd sprite is that teal color. |
Ideal would be to see it like this @TanyaPegasus and I, with others, played around with this but didn't make a lot of progress. We got up to a similar point where we had removed the sprite with the colour and were able to view the bottle exactly as you've shown. Also played with changing the background colouring of the canvas, as it appears that has an effect when the teal sprite is included. To me, it appears to have a light teal look in game, which should be replicated in twotech. The presumption is that it can only have that appearance in this specific "lighting" context. It'd be interesting if the object could be rendered with a white (or other) background, but anything outside the object is the regular twotech background. |
In the game, the transparent layer is blended with what is behind it with an "additive blend" from OpenGL. Exact formulas are here: https://registry.khronos.org/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml The formulas allow me to recreate the effect in python: https://github.com/risvh/massEditor/blob/a12e6350f9851d8caec40145cc3fbc2216ac8cb5/draw.py#L72 And this is the result. Conclusion is that how the transparent sprite looks depends on the background it is drawn on to. You may wanna leave these sprite as transparent for twotech, but how transparent layers are rendered in the browser is probably different than this "additive blend", hence different results are unavoidable. Or you may wanna pre-calculate the resulting pixels with a fixed background. However twotech draws these sprites on different shades of grey in different pages. If you ask me, this issue is not a major one and it has been around since onetech started years ago. People got used to how they are drawn and understand from the weird look that these parts are transparent. I think how it looks below is acceptable, it is equivalent to drawing the transparent sprite on a black background with "additive blend". (Compare the dark teal with the bottle on black background in the image above) |
@risvh Thanks for the thorough information! I'm going to keep this open, as I would like to see an attempt at improving the current state, where bottles don't look so dark. Otherwise, I agree that it's acceptable and most are comfortable understanding what it is. |
Examples include items such as any glass bottles or jars:
https://twotech.twohoursonelife.com/3338-Glass-Bottle
Items such as windows, however, appear transparent as they should:
https://twotech.twohoursonelife.com/12273-Windowed-Brick-Wall
The processor uses a multiply layer to alter colours when the hsv sliders have been used within the editor. It appears this may be causing the semi-transparent areas to become much more opaque. For items such as windows however, these sliders are not used, as the original image is transparent, meaning multiply does not need to be applied.
How multiply may be affecting this:
"When you place a multiply layer over the semi-transparent white layer, it will multiply the pixel values of the layers beneath. Since the semi-transparent white layer contributes white to the image, the multiply operation will effectively amplify the white color. This tends to lighten or maintain the brightness of the pixels beneath it."
Note: It appears that the blueprints (which appear as solid adobe floors on twotech) are also appearing opaque. They are also being affected by issue #42 which is why they don't appear blue.
https://twotech.twohoursonelife.com/14064-Floor-Blueprint
The text was updated successfully, but these errors were encountered: