Two Skylight questions

  1. From the lights panel, the Skylight intensity is always shown as 1 and can’t be edited, whereas its intensity in Rendering panel can be adjusted. What am I missing, are these two different settings?
    image

  2. Is there a reason why the exported Sun settings don’t contain the Skylight intensity value? We tend to use this a lot, but the sun-skylight pair is usually correlated for the best effect for various sun time/intensity. It would be great if the skylight intensity can be saved/restored from the *.rsun files as well. Currently many other Skylight settings are in the rsun files, including its on/off state but not that one:

<skylight-on type="bool">true</skylight-on>
<skylight-shadow-intensity type="double">1</skylight-shadow-intensity>
<skylight-custom-environment-on type="bool">false</skylight-custom-environment-on>
<skylight-custom-environment type="uuid">00000000-0000-0000-0000-000000000000</skylight-custom-environment>

Could we please have that value remembered as well?

thank you,

–jarek

@andy, @nathanletwory any interest in this?

On 1) skylight intensity can be changed in the light panel when an environment for skylight is set that supports it. That said, I think skylight intensity should be always changeable, even for environments that don’t have an HDR as their texture.

RH-65679 Allow changing skylight intensity at all times, but see also RH-64218 Enabe intensity control in skylight even without HDR texture

On 2) the answer is: @andy forgot. RH-65680 Add skylight intensity to rsun

Short and sweet… It would be a big help if #2 could be fixed at some point in the SR cycle.

thanks Nathan.

–jarek

OK - the way this is designed, it can’t be done the way you want it to work…because…

In fact the “Skylight intensity” edit box is really a shortcut to the “HDR multiplier” value in a HDR or EXR texture. The data is actually stored on the texture, not in the document.

We need this number stored in the sun data file to save/load along with other sun settings:
Can the Sun data remember the setting and apply it to the current active texture then?
image

From user standpoint the sun + skylight is a combo that works together for a specific shading look, so from UI staindpoint I want to save the same “look” with Sun, since Sun also remembers Skylight On/Off.
Low sun needs brighter skylight for example, high sun darker, also depending on sun intensity factor. It is very hard to work with when some settings are saved and some not.

In case this can’t be fixed, how would I access (read/set) the Skylight intensity via code (RhinoScript RDK or Python)?

On the document RhinoDoc you can use the property CurrentEnvironment though which you can get the RenderEnvironment used ForLighting, which is the skylight environment. Once you have the skylight environment instance you can use GetParameter with as argument the string "multiplier" to get the skylight intensity.

Thanks Nathan, I’ll check it out- I appreciate your help with this topic.

–jarek

I think I have somewhere a snippet of code to access this using Python. I’ll try to dig it up. Main thing is that data retrieved using GetParameter is a variant, and that needs to be converted. Not hard once you know, until then it is less fun.

1 Like

I am failing to get the “multiplier” parameter to change the skylight intensity or read as anything other than zero. Has something changed? I am on Rhino 7.23.

My goal is to use scripting (via a C# component) to turn on and off the sun and skylight as well as change their intensities: I am able to do everything but alter the skylight intensity. I can type in the skylight intensity in the Lights panel and that works as desired, but I want a scripting technique to achieve the same behavior.

RhinoCommonLighting.gh (14.2 KB)

You’re looking at the skylight shadowintensity property, but that isn’t used at all anywhere. It is not the same as the intensity setting. In your SkyParams script you need to also use GetParameter on both “multiplier” and “rdk-texture-adjust-multiplier” and multiply those together to get the final intensity. Changing skylight intensity works only for the case where an HDRi environment is used, so you’ll have to go through that route.

edit:

Setting the skylight intensity can only done via the HDRi environment as mentioned. You don’t do it directly on the RenderEnvironment.

RenderEnvironment skyLight = doc.CurrentEnvironment.ForLighting;
if(skyLight!=null) {
  RenderTexture skyHdri = skyLight.FindChild("texture");
  if(skyHdri!=null) {
    skyHdri.BeginChange(yourContext);
    skyHdri.SetParameter("multiplier", 1.3);
    skyHdri.EndChange();
  }
}

I’ve upated your GH script here

jesterKing__RhinoCommonLighting.gh (15.1 KB)

1 Like

Thanks, @jesterking – working with the texture instead of the environment was the step I was missing!

1 Like