yuphin / Lumen

A Vulkan Raytracing framework for various bidirectional path tracing techniques
MIT License
449 stars 29 forks source link

what BSDF_FLAG_GLOSSY do? #36

Closed tigrazone closed 8 months ago

tigrazone commented 8 months ago

in previous bsdf implementation GLOSSY was used but in new implementation BSDF_FLAG_GLOSSY used only in src\RayTracer\LumenScene.cpp but nowhere in shaders.

is it issue? how to fix it?

yuphin commented 8 months ago

Since both is_specular() and is_diffuse() have use cases in shaders, there exists a range of materials in between those two. So we just call them Glossy instead of something like NotSpecularNorDiffuse. Plus, it might have some other use cases in the future as well.

tigrazone commented 8 months ago
// BSDF Props
#define BSDF_FLAG_DIFFUSE 1 << 0
#define BSDF_FLAG_SPECULAR 1 << 1
#define BSDF_FLAG_GLOSSY 1 << 2
#define BSDF_FLAG_REFLECTION 1 << 3
#define BSDF_FLAG_TRANSMISSION 1 << 4

i.e. BSDF_FLAG_GLOSSY not used in shaders

tigrazone commented 8 months ago
#define BSDF_FLAG_LAMBERTIAN 1 << 5
#define BSDF_FLAG_DISNEY 1 << 6
#define BSDF_FLAG_FROSTBITE 1 << 7

also not used and can be removed

tigrazone commented 8 months ago

is ok to define

define BSDF_FLAG_GLOSSY BSDF_FLAG_DIFFUSE | BSDF_FLAG_SPECULAR | BSDF_FLAG_REFLECTION

or better

define BSDF_FLAG_GLOSSY BSDF_FLAG_ALL

?

yuphin commented 8 months ago

I've removed those flags. I think it's fine to have a separate glossy flag.