RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1.01k stars 182 forks source link

Texture map documentation update #535

Closed paulmelis closed 1 year ago

paulmelis commented 2 years ago

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?

BruceCherniak commented 2 years ago

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.