Re: Several rendering engines in the same plugin

by enkonyito » Wed May 13, 2020 2:51 am

Changes made to version 1.1 of the YafaRay plug-in

Code: Select all

if (this.sunDirection == null || !Arrays.equals(this.sunDirection, sunDirection)) {
  if (this.sunDirection != null) {
    try {
      // Reinitialize renderer because Yafaray doesn't allow to modify or delete lights
      dispose();
      finalize();
      init();
    } catch (IOException ex) {
      // Shouldn't happen since first initRenderer call worked
    }
  }
  if (sunDirection [1] > -0.075f) {
    ...
  }
  
  this.sunDirection = sunDirection;
}
have an impact on variable light sources (daylight or automatic).

Their power is linked to [font=courier new]sunDirection [1][/font] which is initialized before the call to the [font=courier new]exportLightSource[/font] method.

Code: Select all

this.sunDirection = getSunDirection(this.compass, Camera.convertTimeToTimeZone(this.home.getCamera().getTime(), this.compass.getTimeZone()));
If I keep this initialization, the sky or the sun is no longer visible.

Automatic light off.
Image Image

Automatic light on.
Image Image

Do you have any advice to resolve this situation?