Could you set daz scene spot light angle for generate blender light? (scene light issues)

Issue #597 resolved
engetudouiti created an issue

I saw some issue when import default scene light, (why I need it, I simply compare my material with almost same light intensity, without env)

then report here about scene light things.

When import daz spot light as rectangle, add on generate blender light as Area. it seems reasnable for me, but I often see, the scene was too dark, at first I felt , add on conversion func somehow miss used, but I found, add on can not set the spot angle then leave it as 180 degree. (so not spot and illuminate mesh as same as daz)

I suppose scene duf may include those setting, can you simply set same angle for generate light?

in blender

In duf, the light setting is discribed

node_library , id = spot light same hieralchy, extra > channels > id : “Spread Angle”

"channel" : {
                                "id" : "Spread Angle",
                                "type" : "float",
                                "label" : "Spread Angle",
                                "value" : 60,
                                "current_value" : 30,
                                "min" : 0,
                                "max" : 180,
                                "clamped" : true,
                                "step_size" : 0.01
                            },

like this. you already pick other extra channel propertys, so I suppose add on can pick the “current_value”. and set it for blender light props = bpy.data.light[““].spread as Radians (I suppose 30 (degree) need to convert as Radians when set by python)

as same as you set rectangle size X, Y. from saved duf.

If set angle so, at least with my current test scene, it show reasnable effect. (so basically formula seems correct I feel , at least with this shape of distant light. )

Comments (10)

  1. engetudouiti reporter

    Then 2nd issue,,

    DAZ spot light , shape = “sphere”, add on generate blender light as “point” but it should not.

    because, blender point can not set light direction.. Only when the Daz light = “Point light”, (not spot light shape = Point),

    add on need to set blender light as “Point”. When scene light is spot light, add on should not use “Blender point”, but use “Blender area” or “Blender spot (for sphere only)”

    Though about this case, I can not confirm, the conversion (luminace to W) correct or not… If you correct it to generate spot light in blender,, I may report again..

    (when add on generate light as Spot ,, I feel there still remain miss conversion,, (maybe we need different conversion formula for blender Spot and Blender Area type light, I afraid,,,)

  2. Thomas Larsson repo owner

    This is an old bug, but now I finally got around to look at it. The first part is fixed. The spread angle now corresponds to area light spread and also to spot light spot angle.

  3. Thomas Larsson repo owner

    Now I have looked at the second part, and what Engetu said about DS spotlights must become some kind of directional light makes sense to me. So now it is a spotlight for point geometry, and an area light otherwise. Spotlights with sphere or cylinder geometry become area lights with disc geometry. Not perfect but at least the direction is there.

  4. Alessandro Padovani

    Was looking at this myself, just for completeness since I don’t use spot lights. We have to convert iray spot lights to cycles area lights, not to cycles spot lights, because spot lights in cycles do not follow photometric rules so they will not match with iray. Plus in iray the spread angle depends on the beam exponent.

    The equation below converts the beam exponent in a range from 1 to 100 to a similar spread angle in blender.

    edit. corrected to 0.05 factor that seems closer to iray.

    # convert iray spotlight to cycles area light
    cycles spread = iray spread angle / (1 + (beam exponent - 1) * 0.05)
    

    Test scene included spot.duf

  5. Alessandro Padovani

    update. spot with point shape. For the spot light with point shape in daz studio we could use a area light with 1 mm disk shape in blender, that seems to do fine enough. I would not go below 1 mm to avoid rendering artifacts if the light is too small.

    Again please note that we can’t covert to spot light, we have to use the area light for photometrics to apply and thus the light to be similar to iray.

  6. Thomas Larsson repo owner

    Implemented in last commit. Don’t you think that we could increase the area of the “spotlight”. A real lightbulb is a few centimeters, so the area doesn’t have to be much smaller than that, does it? In my experience too small lights tend to lead to fireflies.

  7. Alessandro Padovani

    Commit 0500f8f works fine.

    Ideally a point light is as small as possible, though probably it doesn’t make any difference in a spot light since the light cone prevails. If there’s nothing to add we can close as resolved, this is a good one so we import spots as well.

  8. Log in to comment