Hello. I’m trying to make a simple Fresnel Shader that uses a Normal Map. It takes the normal map transforms it to world space and does a dot product with view vector. Now, It looks fine in Unity, but on Vision it looks really bad. I tried looking into the USD file for the shader and noticed that I got better results making sure things were set to Linear and not srgb where it made sense.
But I have no clue if this is the actual problem, but perhaps setting the texture sampler to NormalMap doesn’t set the sampler in RealityKit to Linear?
Hello! Could you submit a repro case and let me know the incident number (IN-#####)? That would help me compare the results between Unity and visionOS, and find out whether this is a color space issue as you suggest.
Another bug I found is that I can’t set material parameters through code if the shader param isn’t exposed. Often I want to hide params that are set with code from artists.
That’s not enough information for me to see what’s going wrong. If I make the equivalent shader and visualize the output of the dot product, I get the same result on Unity and visionOS.
However, it’s entirely possible that there’s something else in your setup that we’re not anticipating. Notably, there are some differences in the “world space” returned by nodes like View Direction versus the transforms available to the Transform node. You might have better luck doing the dot product in another coordinate space, such as view space.
Right; we typically expect non-exposed properties to be used as globals only. Because unexposed properties aren’t included in the properties available from Shader.GetProperty/Material.GetPropertyNames, they’re not picked up by PolySpatial at runtime. That’s something we could potentially fix at some point.
Alright, thanks for taking the time. I should have just uploaded the full. There’s also a float input parameter on the shader that is always zero on Vision, which is awfully weird.