Hey there, thanks for chiming in. The issue is that the texture sampler in the shader graph seems to see a (0.5,0,0) pixel in the texture image as something like (0.21,0,0) for example. The equivalent metal operation would be something like:
constexpr sampler s(address::clamp_to_edge, filter::linear);
float4 s = tex.sample(s, float2(0.4,0.2)); // expected float4(0.5, 0, 0), got float4(0.21, 0, 0);
Does lighting affect the value of the texture sampler?
Post
Replies
Boosts
Views
Activity
Here's a more direct example of the issue... in the image below, the upper gradient is a material that uses a textured image, the bottom gradient is generated from within the shader. The two gradients should be identical but the image textured material is noticably darker in the middle ranges. I imagine there's a reason for this, anybody know why the texture sampler behaves like this?
gradient image texture:
gradient shader graph:
Update on this issue: Unlit surfaces suggestion seemed to help, but also using an Image2D (RealityKit) node instead of the Image node and disabling MIP filter on the node also solved issues in other cases.