It seems like base::file_texture.tint is doing some unexpected intensity scaling (?)
I have a very simplistic material which compares using a gradient from uvw coordinates vs a linear gradient from a texture file (see attachment - it is a gradient from black at the bottom to white at the top (linear in RGB space), with RGB=128|128|128 at half-point, and a small white border). This is the material:
mdl 1.6;
import ::df::*;
import ::state::*;
import ::math::*;
import ::base::*;
import ::tex::*;
export material gradient_test()
= let{
base::texture_return tex = base::file_texture(texture_2d("gradient-linear-black-white.png"));
float3 uvw = state::texture_coordinate(0);
} in
material(
thin_walled: true,
surface: material_surface(
scattering:
df::diffuse_reflection_bsdf(
roughness: 0,
tint: uvw.x < 0.5 ? color(uvw.y) : tex.tint
)
)
);
I would expect the left half and the right half to behave the same, but they do not.
The texture-based tint does not generate any returns for very dark shades (RGB < 20), and the scaling seems to be completely different in the left half.
I have double-checked the gradient image and the texture coordinates of the target (simple square facet). The difference can be reproduced regardless of image format (png/bmp, RGB or grayscale).
Am i missing something? Does base::texture_return make some internal scaling that is not documented? I am currently extremely confused and open for any suggestions/hints/guesses as to what is happening here.
Attachment: gradient Texture file: