Polyspatial Lighting

Hi, I’m trying to replicate the default lit shader lighting in a way in which I have control over each parameter. Per earlier guidance I’m using an unlit shader with polyspatial lighting and polyspatial environment radiance. Am I supposed to blend or add the diffuse and specular? Which parameters (such as roughness and specular) should be toggled to reproduce the default lit lighting? Also, the reflections seem to be cut off on the bottom half of the sphere and when I move my head the lighting and reflections change position on the sphere but they remained fixed on the default lit shader.



Unless you need the shader to be able to turn off or manipulate visionOS’s image based lighting, I would recommend instead using a Lit shader target (not the PolySpatial Environment Radiance node, which provides access to the image based lighting outside of the context of a Lit target) and attaching the output of PolySpatial Lighting to the Emission output of that. Then you can use the same inputs to the Base Color, Smoothness, etc., properties of PolySpatial Lighting and the Lit target block.

AFAIK, it makes the most sense just to add them. The PolySpatial Environment Radiance node is simply a proxy for Apple’s Environment Radiance node, which doesn’t specify how the outputs should be combined.

If you do need to toggle the default (image based) lighting in a single shader, then I’d recommend just adding the output of the PolySpatial Lighting node to those of the PolySpatial Environment Radiance nodes (but only add those if image based lighting is enabled). It might be both easier and more efficient, though, to use a separate shader when you don’t want image based lighting.

I’m not sure what might be causing this, but my best guess would be the coordinate space of the normal used by the Environment Radiance node. There are some issues with world space in shader graphs due to discrepancies in the results returned by Apple’s nodes. You might try transforming from Object to World space for the normal.

Thanks for the help, Kapolka. To your first point, I am trying to remove IBL. Maybe I shouldn’t be. My goal is to flatten the lighting curve. Right now if I take the AVP into bright sunlight every material is way too bright. I would like to put a limit on how bright materials can be which I think requires overriding the IBL. I’ve tried to implement your suggestions but it is not working. Please look at my current shader and tell me what I’m missing. Again, my goal is just to reproduce a lit shader so that I can thing manipulate the lighting. But before changing lighting settings I’m trying to reproduce the current lit shader lighting.

If you want to remove the IBL, then use an Unlit target and don’t use the Environment Radiance node at all: just use the PolySpatial Lighting node.

Kapolka, my statement about removing IBL may not have been correct. I’m not sure which light is which. From what I can tell there is IBL, diffused, and specular that all come from the AVP. I only want to remove whichever light source is the one that blows out colors in bright sun. I want my shader to do everything that the lit shader does on AVP minus the super bright light.

I’m not sure what might be blowing out your colors, but the visionOS IBL has two components: one from the camera and one that is a fixed pattern of white highlights. You can change/remove the fixed pattern (the “system IBL”) using the ImageBasedLight[Receiver] components, if that helps.

Thanks but unfortunately it’s the other one. I’ve been using the ibl receiver with no inputs and the issue still exists. I turned to the shader work thinking that I could parse our the different lights and then adjust them from there but cannot get it figured out.

In that case, it’s worth sending feedback to Apple via their Feedback Assistant. If it’s impossible to get the lighting you want in daylight conditions with just their material types (PhysicallyBasedMaterial), I think they’d want to know that.