ospray icon indicating copy to clipboard operation
ospray copied to clipboard

Texture map documentation update

Open paulmelis opened this issue 3 years ago • 1 comments

All parameters (except Tf) can be textured by passing a texture handle, prefixed with “map_”. The fetched texels are multiplied by the respective parameter value. If only the texture is given (but not the corresponding parameter), only the texture is used (the default value of the parameter is not multiplied). The color textures map_Kd and map_Ks are typically in one of the sRGB gamma encoded formats, whereas textures map_Ns and map_d are usually in a linear format (and only the first component is used). Additionally, all textures support texture transformations.

Apparently, the correct names are map_kd, map_ks (fully lowercase). I don't see any references to map_Ns, map_ns and map_d in the code, as those supported at all?

paulmelis avatar Jul 22 '22 15:07 paulmelis

Hi Paul, apologies that the documentation has gotten a bit confusing, regarding the case of the material names. OSPRay 2.x+ names are, indeed, different than the older OSPRay 1.x and it appears the tables were updated (they look correct), whereas the prose was not.

Yes, map_ns and map_d are supported by the OBJ material. The code for those can be found here https://github.com/ospray/ospray/blob/fdda0889f9143a8b20f26389c22d1691f1a6a527/modules/cpu/render/materials/OBJ.cpp#L45 https://github.com/ospray/ospray/blob/fdda0889f9143a8b20f26389c22d1691f1a6a527/modules/cpu/render/materials/OBJ.cpp#L51 and here https://github.com/ospray/ospray/blob/fdda0889f9143a8b20f26389c22d1691f1a6a527/modules/cpu/render/materials/OBJ.ispc#L29 https://github.com/ospray/ospray/blob/fdda0889f9143a8b20f26389c22d1691f1a6a527/modules/cpu/render/materials/OBJ.ispc#L50

I'll file an internal issue against documentation and we'll get it cleaned up. Sorry for any confusion.

BruceCherniak avatar Jul 22 '22 16:07 BruceCherniak