This commit renames all shader snippet files to conform to the newly introduced naming convention outlined in README.md. The new naming convention uses a `prefix_name.suffix` format to clearly indicate the purpose and target shader stage of each snippet. This improves the overall organization and readability of the shader code, making it easier to understand how each snippet contributes to the shader generation process. No functional changes were made to the shader code itself or source code. This is purely a refactoring for clarity and maintainability.
24 lines
814 B
GLSL
24 lines
814 B
GLSL
/*
|
|
* screen-space reflection shading
|
|
*/
|
|
vec4 evaluateMaterial(const MaterialInputs material) {
|
|
|
|
#if defined(MATERIAL_HAS_REFLECTIONS)
|
|
PixelParams pixel;
|
|
getAnisotropyPixelParams(material, pixel);
|
|
vec4 color = vec4(0.0);
|
|
if (frameUniforms.ssrDistance > 0.0) {
|
|
vec3 r = getReflectedVector(pixel, shading_view, shading_normal);
|
|
// evaluateScreenSpaceReflections will set the value of color if there's a hit.
|
|
// color.a contains the reflection's contribution.
|
|
color = evaluateScreenSpaceReflections(r);
|
|
}
|
|
#else
|
|
// objects without reflections just erase the framebuffer, they need to be drawn in the
|
|
// reflection buffer because they could be partially occluding other objects with reflections.
|
|
const vec4 color = vec4(0.0);
|
|
#endif
|
|
|
|
return color;
|
|
}
|