fuckingtech/public/assets/glsl/lygia/lighting/toShininess.hlsl
Elias Rhouzlane bf76c6b086 fix: code
2025-04-06 17:23:52 +02:00

20 lines
No EOL
673 B
HLSL

/*
contributors: Patricio Gonzalez Vivo
description: Convertes from PBR roughness/metallic to a shininess factor (typaclly use on diffuse/specular/ambient workflow)
use: float toShininess(<float> roughness, <float> metallic)
license:
- Copyright (c) 2021 Patricio Gonzalez Vivo under Prosperity License - https://prosperitylicense.com/versions/3.0.0
- Copyright (c) 2021 Patricio Gonzalez Vivo under Patron License - https://lygia.xyz/license
*/
#ifndef FNC_TOSHININESS
#define FNC_TOSHININESS
float toShininess(float roughness, float metallic) {
float s = .95 - roughness * 0.5;
s *= s;
s *= s;
return s * (80. + 160. * (1.0-metallic));
}
#endif