PNG transparency

Hi.
I have a problem with an artificial shadow. I apply a texture to a none baked object. It receives a PNG fake shadow. After saving and uploading the scene the soft shadow turns into the shadow with sharp edges again. This happens to the uploaded file and the scene itself.
I prepared a video for a better understanding: PNG transparency trouble
Here the link to the scene: Table test
The soft shadow on the loading screen is visible because of a custom loading screen I prepared.

This is a bug on our end.

Shapespark has a logic that detects which textures use binary transparency (a pixel is either fully visible or fully transparent, such as many vegetation textures). This allows to treat such binary textures differently during rendering to fix render-order related artifacts for them.

This logic does not just look if alpha values used in a texture are only 1.0 or 0.0, because in practice vegetation textures often use other alpha values on leafs margins, so the logic allows for some alpha values to be between 0 and 1.0.

In case of your scene, the soft shadow texture was detected as binary transparent, because the soft shadow region is small. This is totally incorrect because you have also set opacity scalar for the whole texture and texture with additional opacity should never be treated as a binary transparent. We will fix this in the upcoming release. For now as a workaround, you could move the 0.3 opacity to be included in the alpha channel of the texture.

Hi @jan

I reduced the opacity of the shadow texture in Photoshop to 25% and didn’t make any adjustments to the opacity in Shapespark. But the result is still the same. Just the visible area is reduced.
Update Table

Tim

Can you say anything about the release date? Because I have to present a working solution for the table as an alternative to Sketchfab on Monday.

Do you require the demo to work with self-hosting? If everything works well we will release a new desktop application version tomorrow, but if we fail to do so, we for sure can release just fixed viewer tomorrow to Shapespark hosting.

No, self hosting is not required at this stage.

Hi @jan,

Is the white line around some leaves my mistake in the preparation png?

@Vladan some textures use white color for fully transparent pixels, but it is better to use black.

The reason is that during rendering GPU interpolates neighboring texture pixels. Even if a pixel is fully transparent, it will be used for such interpolation, creating bright margin around the leaves.

@jan, please for an additional explanation - how in Photoshop I can get black opacity. Is there any other program that can do this? Is the solution turning on matte - black (or maybe green)?

Or maybe the solution is to add a mask for Opacity to Shapespark in the future?

Opacity

@tim, we have deployed a new version of the viewer on our infrastructure.

Could you upload the original version of the scene (the one which used opacity < 1 for the artificial shadow material) and see if it improves the soft shadow?

1 Like

Hi @wojtek

Yes, it works now. Thank you for your support and for taking the worries of the community so seriously!

Tim

1 Like