Skip to content

kb.DirectionalLight does not work with spherical world  #191

@taiya

Description

@taiya

Need add functionality to disable the spherical floor for being a shadow caster. Directional lights are modelled as lights positioned at infinity, causing world sphere to cast shadow on the object.

(incomplete) example from examples/keyframing.py

import logging
import kubric as kb
import numpy as np
from kubric.renderer.blender import Blender as KubricRenderer

logging.basicConfig(level="INFO")

# --- create scene and attach a renderer to it
scene = kb.Scene(resolution=(256, 256), frame_start=1, frame_end=20)
renderer = KubricRenderer(scene)

# --- populate the scene with objects, lights, cameras
scene += kb.Sphere(name="floor", scale=1000, position=(0, 0, +1000), background=True)
scene += kb.Cube(name="floor", scale=(.5,.7,1.0), position=(0, 0, 1.1))
scene += kb.PerspectiveCamera(name="camera", position=(3, -1, 4), look_at=(0, 0, 1))

# --- Add Klevr-like lights to the scene
scene += kb.assets.utils.get_clevr_lights()
scene.ambient_illumination = kb.Color(0.05, 0.05, 0.05)
# WARNING: HEMISPHERE WORLD BREAKS DIRECTIONAL LIGHTS!
# scene += kb.DirectionalLight(name="sun", position=(-1, -0.5, 3), look_at=(0, 0, 0), intensity=1.5)

...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions