Re: Photo-video rendering plug-in

by enkonyito » Wed May 30, 2018 3:56 am

@okh
it seems to me that the new light types can give softer illumination with fewer light sources
This is especially true for light panels (TriangleMeshLight type) as shown in the Sunflow doc (page 54).
I also found it in my renderings to simulate the interior natural light.
does the renderer rely on the description field to determine the type?
Yes, the PhotoRenderer class uses the description of the light object to differentiate types.

Code: Select all

String lightDescription = light.getDescription();
// SphereLight type
if (lightDescription == null
    || lightDescription.contains("SphereLight")) {
...
}
// PointLight type
else if (lightDescription.contains("PointLight")) {
...
}
// TriangleMeshLight type
else if (lightDescription.contains("TriangleMeshLight")) {
...
}
We can then assign a type to a light we want to create.
The TriangleMeshLight type is special because the coordinates of the vertices are statically encoded so the shape is limited to a single-sided panel.
As it is rotating, nothing prevents to use it for an existing object.
(Light panel #1: opaque when off, Light panel #2: invisible when off, Light panel #3: visible when selected and not viewable in rendering).
Would adding a planIcon# simplify placement of the different lights in the 2D view?
For those I created, given their depths, it was not really necessary but if you want to add a type to the description of your lights it could be useful.
Could also having a TriangleMeshLight with other colours be useful?
Something closer to incandecent ([font=courier new]lightSourceColor#2=#BB9854[/font]) maybe?
The default color is daylight ([font=courier new]lightSourceColor#2=#6D7991[/font]) but since the PhotoRenderer class retrieves the color of the object to use as a light source color, you can change it.

Code: Select all

int lightColor = lightSource.getColor();
HomeMaterial[] lightMaterial = light.getModelMaterials();
if (light.getColor() != null) {
    lightColor = light.getColor();
} else if (lightMaterial != null && lightMaterial.length == 1
        && lightMaterial[0].getColor() != null) {
    lightColor = lightMaterial[0].getColor();
}