Closed nathaneltitane closed 2 years ago
translucent colors are exported correctly, make sure you're in material mode in blender
@leozide I used blender to quickly verify the validity. it seems that any viewer I use (threejs webgl, sketchfab) keeps all the values solid (no alpha)...
@leozide I used blender to quickly verify the validity. it seems that any viewer I use (threejs webgl, sketchfab) keeps all the values solid (no alpha)...
translucent colors are exported correctly, make sure you're in material mode in blender
Hello @leozide, I have exported 4 peices with different materials to experiment with.
It seems you have a problem with your Collada exports. The RGBA value that you are assigning in the .dae file under the transparent tag is erroneous and should be applied to the transparency tag additionally/instead.
On another hand, taking a look at your Wavefront exports shows that you have correctly assigned the transparency within the d value. Serving to reinforce that the current transparency value in Collada is a bug.
Lastly, importing the Wavefront to Blender shows the correct transparency of 0.94 (240 / 255 -> 0.941176471)
P.S.: Manually changing the transparency tag within Collada yields the correct outcome within Blender too.
furthermore: nothing seems to be wrong with the current viewer in terms of alpha transparency rendering: wavefront works just fine.
here is also a very interesting outcome - exported model from leocad to collada (renders opaque):
import same collada into blender and re-export back to same file as collada (renders translucent):
output file from blender is attached (added suffix for upload to github) vf-1s-super-fighter.dae.txt
It seems you have a problem with your Collada exports. The RGBA value that you are assigning in the .dae file under the transparent tag is erroneous and should be applied to the transparency tag additionally/instead.
No, the transparent alpha gets multiplied by transparency so the export is correct. The spec is clear about this:
If either
@Genome36 ^^
It seems you have a problem with your Collada exports. The RGBA value that you are assigning in the .dae file under the transparent tag is erroneous and should be applied to the transparency tag additionally/instead.
No, the transparent alpha gets multiplied by transparency so the export is correct. The spec is clear about this:
If either or exists then transparency rendering is activated, the renderer needs to turn on alpha blending mode, and the following equations define how to combine the two values. Use these equations to get the correct results based on the opaque setting of , where fb is the frame buffer (that is, the image behind what is being rendered) and mat is the material color before the transparency calculation. • In A_ONE opaque mode: result.r = fb.r (1.0f - transparent.a transparency) + mat.r (transparent.a transparency) result.g = fb.g (1.0f - transparent.a transparency) + mat.g (transparent.a transparency) result.b = fb.b (1.0f - transparent.a transparency) + mat.b (transparent.a transparency) result.a = fb.a (1.0f - transparent.a transparency) + mat.a (transparent.a transparency)
Ref to spec please?
@leozide It appears you have not respected the Collada spec sheet properly. Collada 1.4.1 indeed specifies that the alpha should be calculated with the equation; yet it also says that if the Transparency tag is given then transparent and transparency are both honoured and taken into account for the calculation.
the Transparent tag is used for Alpha Blending Modes, all other types use the Transparency tag instead. The only problem is that not everyone wants to use alpha blending and you are also always specifying Transparency as float(1.0). If you are going to add the Transparency tag then at least honor the specification by giving it the same value as the Alpha component.
@leozide
seems the collada exporter is the issue after all:
I managed to get three.js webgl rendered to render translucent parts by adding the opaque declaration to the
effects/materials declarations should be revised to include at least opaque="A_ONE" or some kind of option for export preferences to set the opaque type on export in the settings.
Before and after:
Spec discussion:
https://community.khronos.org/t/transparent-and-transparency-revisited/5962
I did not read the whole issue but the "Loading data in F3D issue" is caused by this assimp issue: https://github.com/assimp/assimp/issues/5234
I did not read the whole issue but the "Loading data in F3D issue" is caused by this assimp issue: assimp/assimp#5234
@mwestphal as discussed over on discord, I managed to pinpoint the fact that the collada export as generated by leocad fails to explicit the opacity argument for the
one thing i would like to add is that it would also be more within known standards to actually have the transparency float be 0 and call opacity as A_ZERO to better reflect the 0-255 or 0-100 gradation of an opacity scale, translating the result into transparency (0 being fully transparent, 1 being fully opaque)
Describe the bug Currently, none of the export formats seem to translate/export the LDRaw transparent colors with alpha transparency (at the very least)
All parts with that are assigned a transparent part color turn out solid when loaded into a viewer (blender, webgl, threejs or others)
To Reproduce Steps to reproduce the behavior: open model select part assign transparent color from color palette File > export > collada/3ds/wavefront
Expected behavior colors with transparency/translucency should reflect at the very least with some alpha channel being enabled in the export file
Screenshots
Version (please complete the following information): continuous - all