I created a mesh light using UsdLux, but it didn't work

I used UsdLux to create a mesh light, but it didn’t work. I want to create a hemispherical light source with light rays pointing toward the center of the sphere, to simulate uniformly scattered skylight. However, a DomeLight does not meet my needs.

First, I tried applying LightAPI to a plane. Although the light attributes appeared in the property panel, no matter how I adjusted the parameters, the mesh did not emit light.

My code is as follows

from pxr import Usd, UsdLux, Sdf, Gf
import omni.usd
import omni.kit.commands


stage = omni.usd.get_context().get_stage()
omni.kit.commands.execute('CreateMeshPrimWithDefaultXform',
	prim_type='Plane',
	prim_path=None,
	select_new_prim=True,
	prepend_default_prim=True,
	above_ground=True)
mesh_prim = stage.GetPrimAtPath('/World/Plane')
# LightAPI
print(UsdLux.MeshLightAPI.CanApply(mesh_prim))
meshLightAPI = UsdLux.LightAPI(mesh_prim)
meshLightAPI.Apply(mesh_prim)
links = meshLightAPI.GetLightLinkCollectionAPI()
meshLightAPI.CreateColorAttr().Set(Gf.Vec3f(1.0, 1.0, 1.0))
meshLightAPI.CreateIntensityAttr().Set(1000000)
UsdLux.ShadowAPI.Apply(mesh_prim)

Additional note: The figure below shows the stage I created, where I placed a large cube to check whether the light was emitting. In this stage, I used UsdLux.RectLight.Define(stage, ‘/World/Plane’) to create a light, and it worked properly as a light source.

I ran the same code on both computers, and both used isaac - sim 4.2 and kit-app-template, and the result was a crash. Configured as follows

---------------------------------------------------------------------------------------------|
| Driver Version: 572.83 | Graphics API: D3D12
|=============================================================================================|
| GPU | Name | Active | LDA | GPU Memory | Vendor-ID | LUID |
| | | | | | Device-ID | UUID |
| | | | | | Bus-ID | |
|---------------------------------------------------------------------------------------------|
| 0 | NVIDIA GeForce RTX 3070 Ti Lap.. | Yes: 0 | | 8018 MB | 10de | 74260100.. |

Unfortunately we do not support anything custom like that. We have a domelight which does exactly that. Why does a domelight not work for you? It is a perfect ambient, non directional, balanced spherical environment light. Should be perfect for your needs.

If you tell me the overall goal of what you are trying to achieve in rendering, I can help you. I am sure we can set up a domelight to your requirements.

@Richard3D Thank you very much for your reply. I am currently working on a scientific computing system. I need to simulate the sky, where I can control the energy/power ratio between direct sunlight and diffuse skylight. The power of direct light can be directly calculated from the light source radius and intensity. However, at present, I don’t know how to calculate the power of a DomeLight, since its radius seems to be infinite. Therefore, I would like to define a custom DomeLight with a controllable radius.

Ok. So rather than using a custom dome light, literally just make a self illuminated hemisphere. It is just a sphere with inverted normals, you set the radius of the sphere dynamically and you apply a pure white or RGB self illuminated material to it with a known lux. Much easier. For the direct sunlight, just use a Distance light.