gz-rendering icon indicating copy to clipboard operation
gz-rendering copied to clipboard

Point light attenuation/falloff does not work when cast_shadows is enabled

Open azeey opened this issue 2 years ago • 2 comments

Environment

  • OS Version: Ubuntu 20.04
  • Source or binary build? source, ign-rendering6, f043b4fc
  • Render Engine: ogre2

Description

  • Expected behavior: Point light attenuation/falloff to work regardless of cast_shadows.
  • Actual behavior: When cast_shadow is enabled, the light does not falloff according to the attenuation parameters. For example, given the following light source
<light type="point" name="mylight">
  <cast_shadows>true</cast_shadows>
  <pose>0 0 2.5 0 0 0</pose>
  <diffuse>0.8 0.8 0.8 1</diffuse>
  <specular>0.8 0.8 0.8 1</specular>
  <direction>0 0 -1</direction>
  <intensity>2</intensity>
  <attenuation>
    <range>4</range>
    <linear>0.5</linear>
    <constant>0.2</constant>
    <quadratic>0.01</quadratic>
  </attenuation>
</light>

with cast_shadows = true, I get a sharp circle determined by the range (4m) of the light. image

with cast_shadows = false, the light falls of smoothly, but the box does not have a shadow. image

Steps to reproduce

  1. Run the attached file (test.sdf.txt) in ign gazebo.
  2. Change <cast_shadows> to true or false.

azeey avatar Mar 21 '22 22:03 azeey