Print at Mar 29, 2020, 7:05:29 AM

Posted by enkonyito at Jan 23, 2020, 2:52:11 AM
Re: YafaRay rendering plug-in
Enkonyito, I made some tests about area and mesh lights, and you can use some working code found in the comments of YafarayRenderer constructor.
In the source code you posted, corner, point1 and point2 must be arrays of 3 floats not Point3f instances (by the way, from parameter isn't used).
You should also take care of the orientation of the triangle built from corner, point1 and point2 (if ever it's wrongly oriented, just swap corner and point1).

About mesh lights, you have to provide the integer id of the mesh used as a light in a parameter named object. This id is returned by startTriMesh method so you'll have to store the ids of the meshes used as lights somewhere.
Good luck! smile


Thank you Puybaret for the advice on area lights! This works for unviewable light panels.



Using
long meshLightId = startTriMesh(-1, vertices.length / 3, verticesIndices.length / 3, false, uvs != null, 0, 0);
and
params.put("object", Integer.parseInt(light.getProperty(this.INT_MESH_LIGHT_ID)));
Sweet Home 3D no longer crashes for mesh lights but the opaque light panel emits light without being luminescent.