Closed Champion-zzy closed 7 months ago
Transparency is computationally heavier than the normal rendering, becasue it involved dedicated shader code. It does not make sense to alway turn on transparency. So in Easy3D (and almost all other rendering tools), transparency isdisabled by default. To enable transparency, please refer to Tutorial_504_Transparency.
"Thank you very much for Professor Nan's prompt response. I also wanted to ask how I can control the transparency of only certain faces or parts of faces without affecting other parts of the model."
You're welcome. If you want to have a subset of the faces to be transparent (or different parts having diffent transparancy), you could simply create multiple TrianglesDrawables, and set each drawable a opaque value.
Of course, it is also possible to allow a per-face transparency value using the alpha. This will require modifying the current shader code.
The transparency parameter (the last component of vec4) does not seem to take effect when setting the model grid color. Consequently, setting semi-transparent faces may not yield the expected results.
eg: plane->add_face_property("f:color", vec4(0.6, 0.6, 0.8, 0.5));
Set the semi-transparent state of the model's faces.