From 87bdf96449df07e7b459b60d2c9f703ca03b836d Mon Sep 17 00:00:00 2001 From: Sungun Park Date: Thu, 30 Jan 2025 16:02:53 -0800 Subject: [PATCH] Refactor: Rename shader snippets w/ new naming convention (see README.md) (#8402) 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. --- filament/CMakeLists.txt | 8 +- .../backend/include/backend/DriverEnums.h | 2 +- filament/backend/src/metal/MetalDriver.mm | 4 +- filament/backend/src/vulkan/VulkanDriver.cpp | 4 +- filament/src/PostProcessManager.cpp | 2 +- filament/src/ShadowMap.cpp | 6 +- filament/src/details/MorphTargetBuffer.cpp | 2 +- filament/src/details/Renderer.cpp | 2 +- filament/src/details/SkinningBuffer.cpp | 2 +- .../materials/colorGrading/colorGrading.mat | 4 +- .../colorGrading/colorGradingAsSubpass.mat | 4 +- .../filamat/include/filamat/MaterialBuilder.h | 2 +- libs/filamat/src/MaterialBuilder.cpp | 12 +- libs/filamat/src/shaders/CodeGenerator.cpp | 169 +++++++++--------- libs/filamat/src/shaders/CodeGenerator.h | 48 ++--- libs/filamat/src/shaders/ShaderGenerator.cpp | 95 +++++----- libs/filamat/src/shaders/ShaderGenerator.h | 6 +- shaders/CMakeLists.txt | 70 ++++---- shaders/src/README.md | 34 ++++ .../src/{dithering.fs => inline_dithering.fs} | 0 .../src/{vignette.fs => inline_vignette.fs} | 0 .../{post_process.fs => post_process_main.fs} | 0 .../{post_process.vs => post_process_main.vs} | 0 ...lusion.fs => surface_ambient_occlusion.fs} | 0 shaders/src/{brdf.fs => surface_brdf.fs} | 0 .../{depth_main.fs => surface_depth_main.fs} | 4 +- shaders/src/{fog.fs => surface_fog.fs} | 0 .../src/{getters.cs => surface_getters.cs} | 0 .../src/{getters.fs => surface_getters.fs} | 0 .../src/{getters.vs => surface_getters.vs} | 0 ...nstancing.glsl => surface_instancing.glsl} | 0 ...tional.fs => surface_light_directional.fs} | 0 ..._indirect.fs => surface_light_indirect.fs} | 0 ..._punctual.fs => surface_light_punctual.fs} | 2 +- ...ctions.fs => surface_light_reflections.fs} | 0 ...common_lighting.fs => surface_lighting.fs} | 0 shaders/src/{main.cs => surface_main.cs} | 0 shaders/src/{main.fs => surface_main.fs} | 4 +- shaders/src/{main.vs => surface_main.vs} | 2 +- ...common_material.fs => surface_material.fs} | 0 ...l_inputs.fs => surface_material_inputs.fs} | 0 ...l_inputs.vs => surface_material_inputs.vs} | 0 ...{shading_lit.fs => surface_shading_lit.fs} | 0 ...ustom.fs => surface_shading_lit_custom.fs} | 0 ...loth.fs => surface_shading_model_cloth.fs} | 0 ...d.fs => surface_shading_model_standard.fs} | 4 +- ...fs => surface_shading_model_subsurface.fs} | 2 +- ...eters.fs => surface_shading_parameters.fs} | 0 ...ions.fs => surface_shading_reflections.fs} | 0 ...ding_unlit.fs => surface_shading_unlit.fs} | 0 .../{shadowing.fs => surface_shadowing.fs} | 0 ..._shadowing.glsl => surface_shadowing.glsl} | 0 .../{common_types.glsl => surface_types.glsl} | 0 .../{varyings.glsl => surface_varyings.glsl} | 2 +- 54 files changed, 262 insertions(+), 234 deletions(-) create mode 100644 shaders/src/README.md rename shaders/src/{dithering.fs => inline_dithering.fs} (100%) rename shaders/src/{vignette.fs => inline_vignette.fs} (100%) rename shaders/src/{post_process.fs => post_process_main.fs} (100%) rename shaders/src/{post_process.vs => post_process_main.vs} (100%) rename shaders/src/{ambient_occlusion.fs => surface_ambient_occlusion.fs} (100%) rename shaders/src/{brdf.fs => surface_brdf.fs} (100%) rename shaders/src/{depth_main.fs => surface_depth_main.fs} (97%) rename shaders/src/{fog.fs => surface_fog.fs} (100%) rename shaders/src/{getters.cs => surface_getters.cs} (100%) rename shaders/src/{getters.fs => surface_getters.fs} (100%) rename shaders/src/{getters.vs => surface_getters.vs} (100%) rename shaders/src/{common_instancing.glsl => surface_instancing.glsl} (100%) rename shaders/src/{light_directional.fs => surface_light_directional.fs} (100%) rename shaders/src/{light_indirect.fs => surface_light_indirect.fs} (100%) rename shaders/src/{light_punctual.fs => surface_light_punctual.fs} (99%) rename shaders/src/{light_reflections.fs => surface_light_reflections.fs} (100%) rename shaders/src/{common_lighting.fs => surface_lighting.fs} (100%) rename shaders/src/{main.cs => surface_main.cs} (100%) rename shaders/src/{main.fs => surface_main.fs} (96%) rename shaders/src/{main.vs => surface_main.vs} (99%) rename shaders/src/{common_material.fs => surface_material.fs} (100%) rename shaders/src/{material_inputs.fs => surface_material_inputs.fs} (100%) rename shaders/src/{material_inputs.vs => surface_material_inputs.vs} (100%) rename shaders/src/{shading_lit.fs => surface_shading_lit.fs} (100%) rename shaders/src/{shading_lit_custom.fs => surface_shading_lit_custom.fs} (100%) rename shaders/src/{shading_model_cloth.fs => surface_shading_model_cloth.fs} (100%) rename shaders/src/{shading_model_standard.fs => surface_shading_model_standard.fs} (97%) rename shaders/src/{shading_model_subsurface.fs => surface_shading_model_subsurface.fs} (95%) rename shaders/src/{shading_parameters.fs => surface_shading_parameters.fs} (100%) rename shaders/src/{shading_reflections.fs => surface_shading_reflections.fs} (100%) rename shaders/src/{shading_unlit.fs => surface_shading_unlit.fs} (100%) rename shaders/src/{shadowing.fs => surface_shadowing.fs} (100%) rename shaders/src/{common_shadowing.glsl => surface_shadowing.glsl} (100%) rename shaders/src/{common_types.glsl => surface_types.glsl} (100%) rename shaders/src/{varyings.glsl => surface_varyings.glsl} (97%) diff --git a/filament/CMakeLists.txt b/filament/CMakeLists.txt index 9f0364f94e..fae6565e68 100644 --- a/filament/CMakeLists.txt +++ b/filament/CMakeLists.txt @@ -385,16 +385,16 @@ endforeach() add_custom_command( OUTPUT "${MATERIAL_DIR}/colorGrading.filamat" - DEPENDS ../shaders/src/dithering.fs - DEPENDS ../shaders/src/vignette.fs + DEPENDS ../shaders/src/inline_dithering.fs + DEPENDS ../shaders/src/inline_vignette.fs DEPENDS src/materials/colorGrading/colorGrading.fs APPEND ) add_custom_command( OUTPUT "${MATERIAL_DIR}/colorGradingAsSubpass.filamat" - DEPENDS ../shaders/src/dithering.fs - DEPENDS ../shaders/src/vignette.fs + DEPENDS ../shaders/src/inline_dithering.fs + DEPENDS ../shaders/src/inline_vignette.fs DEPENDS src/materials/colorGrading/colorGrading.fs APPEND ) diff --git a/filament/backend/include/backend/DriverEnums.h b/filament/backend/include/backend/DriverEnums.h index 2b68ced9c1..726665e396 100644 --- a/filament/backend/include/backend/DriverEnums.h +++ b/filament/backend/include/backend/DriverEnums.h @@ -1302,7 +1302,7 @@ enum class Workaround : uint16_t { // for some uniform arrays, it's needed to do an initialization to avoid crash on adreno gpu ADRENO_UNIFORM_ARRAY_CRASH, // Workaround a Metal pipeline compilation error with the message: - // "Could not statically determine the target of a texture". See light_indirect.fs + // "Could not statically determine the target of a texture". See surface_light_indirect.fs METAL_STATIC_TEXTURE_TARGET_ERROR, // Adreno drivers sometimes aren't able to blit into a layer of a texture array. DISABLE_BLIT_INTO_TEXTURE_ARRAY, diff --git a/filament/backend/src/metal/MetalDriver.mm b/filament/backend/src/metal/MetalDriver.mm index a8eee36dcb..46f285213a 100644 --- a/filament/backend/src/metal/MetalDriver.mm +++ b/filament/backend/src/metal/MetalDriver.mm @@ -1134,8 +1134,8 @@ FeatureLevel MetalDriver::getFeatureLevel() { math::float2 MetalDriver::getClipSpaceParams() { // virtual and physical z-coordinate of clip-space is in [-w, 0] - // Note: this is actually never used (see: main.vs), but it's a backend API so we implement it - // properly. + // Note: this is actually never used (see: surface_main.vs), but it's a backend API so we + // implement it properly. return math::float2{ 1.0f, 0.0f }; } diff --git a/filament/backend/src/vulkan/VulkanDriver.cpp b/filament/backend/src/vulkan/VulkanDriver.cpp index 56c4a7a296..3443b1dfda 100644 --- a/filament/backend/src/vulkan/VulkanDriver.cpp +++ b/filament/backend/src/vulkan/VulkanDriver.cpp @@ -1091,8 +1091,8 @@ FeatureLevel VulkanDriver::getFeatureLevel() { math::float2 VulkanDriver::getClipSpaceParams() { // virtual and physical z-coordinate of clip-space is in [-w, 0] - // Note: this is actually never used (see: main.vs), but it's a backend API, so we implement it - // properly. + // Note: this is actually never used (see: surface_main.vs), but it's a backend API, so we + // implement it properly. return math::float2{ 1.0f, 0.0f }; } diff --git a/filament/src/PostProcessManager.cpp b/filament/src/PostProcessManager.cpp index d9ab8b0c16..469c0122ed 100644 --- a/filament/src/PostProcessManager.cpp +++ b/filament/src/PostProcessManager.cpp @@ -2661,7 +2661,7 @@ void PostProcessManager::TaaJitterCamera( // update projection matrix inoutCameraInfo->projection[2].xy -= jitterInClipSpace; // VERTEX_DOMAIN_DEVICE doesn't apply the projection, but it still needs this - // clip transform, so we apply it separately (see main.vs) + // clip transform, so we apply it separately (see surface_main.vs) inoutCameraInfo->clipTransform.zw -= jitterInClipSpace; } diff --git a/filament/src/ShadowMap.cpp b/filament/src/ShadowMap.cpp index b71345458d..4985c8ff08 100644 --- a/filament/src/ShadowMap.cpp +++ b/filament/src/ShadowMap.cpp @@ -253,7 +253,7 @@ ShadowMap::ShaderParameters ShadowMap::updateDirectional(FEngine& engine, // The model matrix below is in fact inverted to get the view matrix and passed to the // shader as 'viewFromWorldMatrix', and is used in the VSM case to compute the depth metric. - // (see depth_main.fs). Note that in the case of VSM, 'b' below is identity. + // (see surface_depth_main.fs). Note that in the case of VSM, 'b' below is identity. mCamera->setModelMatrix(FCamera::rigidTransformInverse(highPrecisionMultiplyd(Mv, b))); mCamera->setCustomProjection(mat4(Mn * F * WLMp), znear, zfar); @@ -315,7 +315,7 @@ ShadowMap::ShaderParameters ShadowMap::updatePunctual( // The model matrix below is in fact inverted to get the view matrix and passed to the // shader as 'viewFromWorldMatrix', and is used in the VSM case to compute the depth metric. - // (see depth_main.fs). Note that in the case of VSM, 'b' below is identity. + // (see surface_depth_main.fs). Note that in the case of VSM, 'b' below is identity. mCamera->setModelMatrix(FCamera::rigidTransformInverse(highPrecisionMultiplyd(Mv, b))); mCamera->setCustomProjection(highPrecisionMultiplyd(Mn, Mp), nearPlane, farPlane); @@ -719,7 +719,7 @@ mat4f ShadowMap::computeVsmLightSpaceMatrix(const mat4f& lightSpacePcf, // For VSM, we want to leave the z coordinate in linear light-space, normalized between [0, 1], // i.e. remapping [near, far] to [0, 1]. // When sampling a VSM shadow map, the shader follows suit, and doesn't divide by w for the z - // coordinate. See shadowing.fs. + // coordinate. See surface_shadowing.fs. // compute z' = -(Mv * position).z / (far - near) - (near / (far - near)) const float scale = 1.0f / (zfar - znear); mat4f lightSpaceVsm{ lightSpacePcf }; diff --git a/filament/src/details/MorphTargetBuffer.cpp b/filament/src/details/MorphTargetBuffer.cpp index c496d58b06..b65cd290a3 100644 --- a/filament/src/details/MorphTargetBuffer.cpp +++ b/filament/src/details/MorphTargetBuffer.cpp @@ -66,7 +66,7 @@ MorphTargetBuffer* MorphTargetBuffer::Builder::build(Engine& engine) { // ------------------------------------------------------------------------------------------------ // This value is limited by ES3.0, ES3.0 only guarantees 2048. -// When you change this value, you must change MAX_MORPH_TARGET_BUFFER_WIDTH at getters.vs +// When you change this value, you must change MAX_MORPH_TARGET_BUFFER_WIDTH at surface_getters.vs constexpr size_t MAX_MORPH_TARGET_BUFFER_WIDTH = 2048; static inline size_t getWidth(size_t const vertexCount) noexcept { diff --git a/filament/src/details/Renderer.cpp b/filament/src/details/Renderer.cpp index 186c6249c7..3abcfced58 100644 --- a/filament/src/details/Renderer.cpp +++ b/filament/src/details/Renderer.cpp @@ -781,7 +781,7 @@ void FRenderer::renderJob(RootArenaScope& rootArenaScope, FView& view) { cameraInfo.projection = highPrecisionMultiply(ts, cameraInfo.projection); // VERTEX_DOMAIN_DEVICE doesn't apply the projection, but it still needs this - // clip transform, so we apply it separately (see main.vs) + // clip transform, so we apply it separately (see surface_main.vs) cameraInfo.clipTransform = { ts[0][0], ts[1][1], ts[3].x, ts[3].y }; // adjust svp to the new, larger, rendering dimensions diff --git a/filament/src/details/SkinningBuffer.cpp b/filament/src/details/SkinningBuffer.cpp index 8386aab0b6..1b608a3aff 100644 --- a/filament/src/details/SkinningBuffer.cpp +++ b/filament/src/details/SkinningBuffer.cpp @@ -174,7 +174,7 @@ void FSkinningBuffer::setBones(FEngine& engine, Handle handle, } // This value is limited by ES3.0, ES3.0 only guarantees 2048. -// When you change this value, you must change MAX_SKINNING_BUFFER_WIDTH at getters.vs +// When you change this value, you must change MAX_SKINNING_BUFFER_WIDTH at surface_getters.vs constexpr size_t MAX_SKINNING_BUFFER_WIDTH = 2048; static inline size_t getSkinningBufferWidth(size_t const pairCount) noexcept { diff --git a/filament/src/materials/colorGrading/colorGrading.mat b/filament/src/materials/colorGrading/colorGrading.mat index 83712beafe..20315b5a62 100644 --- a/filament/src/materials/colorGrading/colorGrading.mat +++ b/filament/src/materials/colorGrading/colorGrading.mat @@ -83,8 +83,8 @@ vertex { fragment { -#include "../../../../shaders/src/dithering.fs" -#include "../../../../shaders/src/vignette.fs" +#include "../../../../shaders/src/inline_dithering.fs" +#include "../../../../shaders/src/inline_vignette.fs" #include "colorGrading.fs" void dummy(){} diff --git a/filament/src/materials/colorGrading/colorGradingAsSubpass.mat b/filament/src/materials/colorGrading/colorGradingAsSubpass.mat index 236ab4d407..0875d2a655 100644 --- a/filament/src/materials/colorGrading/colorGradingAsSubpass.mat +++ b/filament/src/materials/colorGrading/colorGradingAsSubpass.mat @@ -71,8 +71,8 @@ vertex { fragment { -#include "../../../../shaders/src/dithering.fs" -#include "../../../../shaders/src/vignette.fs" +#include "../../../../shaders/src/inline_dithering.fs" +#include "../../../../shaders/src/inline_vignette.fs" #include "colorGrading.fs" void dummy(){} diff --git a/libs/filamat/include/filamat/MaterialBuilder.h b/libs/filamat/include/filamat/MaterialBuilder.h index f21abe129e..d031722027 100644 --- a/libs/filamat/include/filamat/MaterialBuilder.h +++ b/libs/filamat/include/filamat/MaterialBuilder.h @@ -727,7 +727,7 @@ public: static constexpr size_t MAX_DEPTH_OUTPUT = 1; static_assert(MAX_COLOR_OUTPUT == 8, "When updating MRT::MAX_SUPPORTED_RENDER_TARGET_COUNT, manually update post_process_inputs.fs" - " and post_process.fs"); + " and post_process_main.fs"); // Preview the first shader generated by the given CodeGenParams. // This is used to run Static Code Analysis before generating a package. diff --git a/libs/filamat/src/MaterialBuilder.cpp b/libs/filamat/src/MaterialBuilder.cpp index 3a8061e4de..3d6f3af542 100644 --- a/libs/filamat/src/MaterialBuilder.cpp +++ b/libs/filamat/src/MaterialBuilder.cpp @@ -937,15 +937,15 @@ bool MaterialBuilder::generateShaders(JobSystem& jobSystem, const std::vector= alpha) { discard; @@ -49,7 +49,7 @@ void main() { #endif #if defined(VARIANT_HAS_VSM) - // interpolated depth is stored in vertex_worldPosition.w (see main.vs) + // interpolated depth is stored in vertex_worldPosition.w (see surface_main.vs) // we always compute the "negative" side of ELVSM because the cost is small, and this allows // EVSM/ELVSM choice to be done on the CPU side more easily. highp float depth = vertex_worldPosition.w; diff --git a/shaders/src/fog.fs b/shaders/src/surface_fog.fs similarity index 100% rename from shaders/src/fog.fs rename to shaders/src/surface_fog.fs diff --git a/shaders/src/getters.cs b/shaders/src/surface_getters.cs similarity index 100% rename from shaders/src/getters.cs rename to shaders/src/surface_getters.cs diff --git a/shaders/src/getters.fs b/shaders/src/surface_getters.fs similarity index 100% rename from shaders/src/getters.fs rename to shaders/src/surface_getters.fs diff --git a/shaders/src/getters.vs b/shaders/src/surface_getters.vs similarity index 100% rename from shaders/src/getters.vs rename to shaders/src/surface_getters.vs diff --git a/shaders/src/common_instancing.glsl b/shaders/src/surface_instancing.glsl similarity index 100% rename from shaders/src/common_instancing.glsl rename to shaders/src/surface_instancing.glsl diff --git a/shaders/src/light_directional.fs b/shaders/src/surface_light_directional.fs similarity index 100% rename from shaders/src/light_directional.fs rename to shaders/src/surface_light_directional.fs diff --git a/shaders/src/light_indirect.fs b/shaders/src/surface_light_indirect.fs similarity index 100% rename from shaders/src/light_indirect.fs rename to shaders/src/surface_light_indirect.fs diff --git a/shaders/src/light_punctual.fs b/shaders/src/surface_light_punctual.fs similarity index 99% rename from shaders/src/light_punctual.fs rename to shaders/src/surface_light_punctual.fs index fa55b05728..a4d1f91257 100644 --- a/shaders/src/light_punctual.fs +++ b/shaders/src/surface_light_punctual.fs @@ -115,7 +115,7 @@ float getAngleAttenuation(const highp vec3 lightDir, const highp vec3 l, const h } /** - * Returns a Light structure (see common_lighting.fs) describing a point or spot light. + * Returns a Light structure (see surface_lighting.fs) describing a point or spot light. * The colorIntensity field will store the *pre-exposed* intensity of the light * in the w component. * diff --git a/shaders/src/light_reflections.fs b/shaders/src/surface_light_reflections.fs similarity index 100% rename from shaders/src/light_reflections.fs rename to shaders/src/surface_light_reflections.fs diff --git a/shaders/src/common_lighting.fs b/shaders/src/surface_lighting.fs similarity index 100% rename from shaders/src/common_lighting.fs rename to shaders/src/surface_lighting.fs diff --git a/shaders/src/main.cs b/shaders/src/surface_main.cs similarity index 100% rename from shaders/src/main.cs rename to shaders/src/surface_main.cs diff --git a/shaders/src/main.fs b/shaders/src/surface_main.fs similarity index 96% rename from shaders/src/main.fs rename to shaders/src/surface_main.fs index c0d6bdb61f..c9383a7bb0 100644 --- a/shaders/src/main.fs +++ b/shaders/src/surface_main.fs @@ -43,11 +43,11 @@ void main() { initObjectUniforms(); - // See shading_parameters.fs + // See surface_shading_parameters.fs // Computes global variables we need to evaluate material and lighting computeShadingParams(); - // Initialize the inputs to sensible default values, see material_inputs.fs + // Initialize the inputs to sensible default values, see surface_material_inputs.fs MaterialInputs inputs; initMaterial(inputs); diff --git a/shaders/src/main.vs b/shaders/src/surface_main.vs similarity index 99% rename from shaders/src/main.vs rename to shaders/src/surface_main.vs index bbb9230fc8..c8882de005 100644 --- a/shaders/src/main.vs +++ b/shaders/src/surface_main.vs @@ -33,7 +33,7 @@ void main() { initObjectUniforms(); - // Initialize the inputs to sensible default values, see material_inputs.vs + // Initialize the inputs to sensible default values, see surface_material_inputs.vs #if defined(USE_OPTIMIZED_DEPTH_VERTEX_SHADER) // In USE_OPTIMIZED_DEPTH_VERTEX_SHADER mode, we can even skip this if we're already in diff --git a/shaders/src/common_material.fs b/shaders/src/surface_material.fs similarity index 100% rename from shaders/src/common_material.fs rename to shaders/src/surface_material.fs diff --git a/shaders/src/material_inputs.fs b/shaders/src/surface_material_inputs.fs similarity index 100% rename from shaders/src/material_inputs.fs rename to shaders/src/surface_material_inputs.fs diff --git a/shaders/src/material_inputs.vs b/shaders/src/surface_material_inputs.vs similarity index 100% rename from shaders/src/material_inputs.vs rename to shaders/src/surface_material_inputs.vs diff --git a/shaders/src/shading_lit.fs b/shaders/src/surface_shading_lit.fs similarity index 100% rename from shaders/src/shading_lit.fs rename to shaders/src/surface_shading_lit.fs diff --git a/shaders/src/shading_lit_custom.fs b/shaders/src/surface_shading_lit_custom.fs similarity index 100% rename from shaders/src/shading_lit_custom.fs rename to shaders/src/surface_shading_lit_custom.fs diff --git a/shaders/src/shading_model_cloth.fs b/shaders/src/surface_shading_model_cloth.fs similarity index 100% rename from shaders/src/shading_model_cloth.fs rename to shaders/src/surface_shading_model_cloth.fs diff --git a/shaders/src/shading_model_standard.fs b/shaders/src/surface_shading_model_standard.fs similarity index 97% rename from shaders/src/shading_model_standard.fs rename to shaders/src/surface_shading_model_standard.fs index ca71d1de0f..0931fda63d 100644 --- a/shaders/src/shading_model_standard.fs +++ b/shaders/src/surface_shading_model_standard.fs @@ -91,7 +91,7 @@ vec3 diffuseLobe(const PixelParams pixel, float NoV, float NoL, float LoH) { * Surface BRDF * The surface BRDF uses a diffuse lobe and a specular lobe to render both * dielectrics and conductors. The specular lobe is based on the Cook-Torrance - * micro-facet model (see brdf.fs for more details). In addition, the specular + * micro-facet model (see surface_brdf.fs for more details). In addition, the specular * can be either isotropic or anisotropic. * * Clear coat BRDF @@ -99,7 +99,7 @@ vec3 diffuseLobe(const PixelParams pixel, float NoV, float NoL, float LoH) { * top of the surface. Its IOR is set to 1.5 (polyutherane) to simplify * our computations. This BRDF only contains a specular lobe and while based * on the Cook-Torrance microfacet model, it uses cheaper terms than the surface - * BRDF's specular lobe (see brdf.fs). + * BRDF's specular lobe (see surface_brdf.fs). */ vec3 surfaceShading(const PixelParams pixel, const Light light, float occlusion) { vec3 h = normalize(shading_view + light.l); diff --git a/shaders/src/shading_model_subsurface.fs b/shaders/src/surface_shading_model_subsurface.fs similarity index 95% rename from shaders/src/shading_model_subsurface.fs rename to shaders/src/surface_shading_model_subsurface.fs index c29c62a410..d608edafa3 100644 --- a/shaders/src/shading_model_subsurface.fs +++ b/shaders/src/surface_shading_model_subsurface.fs @@ -1,6 +1,6 @@ /** * Evalutes lit materials with the subsurface shading model. This model is a - * combination of a BRDF (the same used in shading_model_standard.fs, refer to that + * combination of a BRDF (the same used in surface_shading_model_standard.fs, refer to that * file for more information) and of an approximated BTDF to simulate subsurface * scattering. The BTDF itself is not physically based and does not represent a * correct interpretation of transmission events. diff --git a/shaders/src/shading_parameters.fs b/shaders/src/surface_shading_parameters.fs similarity index 100% rename from shaders/src/shading_parameters.fs rename to shaders/src/surface_shading_parameters.fs diff --git a/shaders/src/shading_reflections.fs b/shaders/src/surface_shading_reflections.fs similarity index 100% rename from shaders/src/shading_reflections.fs rename to shaders/src/surface_shading_reflections.fs diff --git a/shaders/src/shading_unlit.fs b/shaders/src/surface_shading_unlit.fs similarity index 100% rename from shaders/src/shading_unlit.fs rename to shaders/src/surface_shading_unlit.fs diff --git a/shaders/src/shadowing.fs b/shaders/src/surface_shadowing.fs similarity index 100% rename from shaders/src/shadowing.fs rename to shaders/src/surface_shadowing.fs diff --git a/shaders/src/common_shadowing.glsl b/shaders/src/surface_shadowing.glsl similarity index 100% rename from shaders/src/common_shadowing.glsl rename to shaders/src/surface_shadowing.glsl diff --git a/shaders/src/common_types.glsl b/shaders/src/surface_types.glsl similarity index 100% rename from shaders/src/common_types.glsl rename to shaders/src/surface_types.glsl diff --git a/shaders/src/varyings.glsl b/shaders/src/surface_varyings.glsl similarity index 97% rename from shaders/src/varyings.glsl rename to shaders/src/surface_varyings.glsl index a0478838de..7c1432ef98 100644 --- a/shaders/src/varyings.glsl +++ b/shaders/src/surface_varyings.glsl @@ -32,7 +32,7 @@ LAYOUT_LOCATION(10) VARYING highp vec4 vertex_uv01; LAYOUT_LOCATION(11) VARYING highp vec4 vertex_lightSpacePosition; #endif -// Note that fragColor is an output and is not declared here; see main.fs and depth_main.fs +// Note that fragColor is an output and is not declared here; see surface_main.fs and surface_depth_main.fs #if defined(VARIANT_HAS_STEREO) && defined(FILAMENT_STEREO_INSTANCED) #if defined(GL_ES) && defined(FILAMENT_GLSLANG)