owl-project / NVISII

Apache License 2.0
327 stars 28 forks source link

Lighting appearing strange for some images #101

Open abhihjoshi opened 3 years ago

abhihjoshi commented 3 years ago

When I render an image, it appears that the lighting is a little off. More specifically, objects appear brighter than they are intended to look. For example, see the tables in the image below. In prior versions, the tables appeared normal, however, I am only now running into this issue. Is there any way I can go about fixing this? image_2

TontonTremblay commented 3 years ago

Do you observe this problem at different sample per pixel? Did you try to run without the denoiser?

natevm commented 3 years ago

@TontonTremblay i think this might be a race condition inside nvisii somehow. I haven’t been able to reproduce it locally though, so I haven’t been able to fix it yet.

@awesome-aj0123 could you post the portion of your python script here that creates the robot and the light sources? Are you calling nvisii.import_scene multiple times in a row?

abhihjoshi commented 3 years ago

This is the code for when I create the light source.

# Intiailizes the lighting
light_1 = nvisii.entity.create(
  name      = "light_1",
  mesh      = nvisii.mesh.create_sphere("light_1"),
  transform = nvisii.transform.create("light_1"),
)

light_1.set_light(
  nvisii.light.create("light_1")
)

light_1.get_light().set_intensity(150)
light_1.get_transform().set_scale(nvisii.vec3(0.3))
light_1.get_transform().set_position(nvisii.vec3(3, 3, 4))

Also, I am calling import_scene multiple times.

natevm commented 3 years ago

@awesome-aj0123 cool, good to know.

I understand that your current setup is difficult to share, but still, I need to be able to reproduce this issue on my end in order to fix the issue. Otherwise I can only guess what’s going wrong, which isn’t super productive. 😅

Could you create a similar script to what you have now that checks to see if calling import_scene many times in a row followed by the creation of a light source reproduces this issue? My theory is that the light source will appear in some position other than the position you set it to be. Ideally the script would be as similar to your current setup as possible, but more general and therefore shareable with us.

Perhaps you could try importing some of the freely available GLTF models from here? https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0