Colored lighting

can light color be controlled?

how do you set up multiple colored lighting? it seems that the light color in directional light has no effect?

Point/spot/directional lights (and their colors) will only affect shader graphs using the PolySpatial Lighting node. You can alter visionOS’s image based lighting (used for Standard, URP/Lit, and Lit shader graph targets) using the VisionOSImageBasedLight[Receiver] components.

do you guys have an example that demonstrates this usage?

Okay i see it working on a volume camera mesh - but do you know if colored lights work on render textures?

is there some sort of setting (?) for colored lighting and IBL to show up in render texture (not just main camera)

We do not have an example, but it should be straightforward to follow the documentation.

When rendering to RenderTextures, you are using the Unity renderer rather than RealityKit, and will not receive image based lighting. The only option that will work on both RenderTextures and frame buffer rendering is to use shader graphs with the PolySpatial Lighting node (and colored point/spot/directional lights).

Hmm - why aren’t the default URP shaders using shader graphs with Polyspatial Lighting support?

That’s something we have on our road map to support as an option, but we don’t want to include the functionality by default, because it adds complexity (and thus draw expense) to the shader, and not everyone wants that functionality. Also, without knowing which features (dynamic lighting, light maps, etc.) to include, we would either have to include all of them (gated by boolean parameters) or generate different MaterialX outputs with all the possibilities (increasing import times).

should def be included in the Polyspatial Samples

1 Like

using skahder graph for hte first time - is there something you have to do to keep the existing UV?

I am just trying to get Polyspatial Lighting IBL to work with regular URP Lit shader… What’s wrong with my shader graph?

It looks correct to me. If you submit a bug report with a repro case and an explanation of the issue, and let us know the incident number (IN-#####), we can look into it.

hmmm do you have an example lit shader working where IBL works on render texture?

being new to shader graph i’m also not too sure how to connect polyspatial lighting? do i blend it or directly connect to emission?

my test case is a default lit urp shader + IBL… main camera shows a beautiful IBL lighting on the otherwise white mesh, but rendertexture simply shows only the white mesh

@kapolka I am curious which render texture cases you have tested to work?

hmm does the render camera itself need VisionOSImageBasedLightReceiver component?

As I said above, there’s no image-based lighting when rendering to RenderTextures, because the image-based lighting comes from RealityKit (and ultimately from the visionOS’s cameras), and RenderTextures are rendered using the Unity renderer.

That depends on whether you want to replace the image based lighting entirely (use Unlit target, output to Base Color) or add the Unity lighting to the image based lighting (Lit target, use Emission). However, when rendering to a RenderTexture, you will only get the Unity lighting (point/spot/directional/etc.), not the image based lighting.

It’s possible that we could eventually support rendering to a texture using RealityKit’s RealityRenderer, which does provide RealityKit’s image based lighting (though not from the camera–just from an environment map). If you’re interested in that, please request it on our road map.