* Added buffer for material properties of detail mateirals, storing them in a multi-indexed data vector. Updated shader with relevant struct and buffer, but the buffer will need to be moved out of the mateiral SRG to work. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Added buffer for material properties of detail mateirals, storing them in a multi-indexed data vector. Updated shader with relevant struct and buffer, but the buffer will need to be moved out of the mateiral SRG to work. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Added buffer for material properties of detail mateirals, storing them in a multi-indexed data vector. Updated shader with relevant struct and buffer, but the buffer will need to be moved out of the mateiral SRG to work. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * - Moved settings related to the detail material to a partial view srg owned by the terrain gem. - Added support for base color in detail materials. - Hooked up basic base color rendering of detail materials. - Corrected the way the material data was stored. - Added ref counting for detail materials so they can be released when no longer used. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Added buffer for material properties of detail mateirals, storing them in a multi-indexed data vector. Updated shader with relevant struct and buffer, but the buffer will need to be moved out of the mateiral SRG to work. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * - Moved settings related to the detail material to a partial view srg owned by the terrain gem. - Added support for base color in detail materials. - Hooked up basic base color rendering of detail materials. - Corrected the way the material data was stored. - Added ref counting for detail materials so they can be released when no longer used. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Detail materials now put textures into bindless array that's accessed in the shader. Shader now pulls all the detail materal information for a single mateiral but does no blending. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Correcting rebase merge problem. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Fix detail roughness fade out with distance. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Adding tests for new MultiIndexedDataVector functions Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Updates to move bindless array to separate SRG - Exposed BindSrg() in renderpass so it's possible to add additional SRGs to a pass - Created a TerrainSrg for use by the terrain forward shader - Moved the bindless array out of the partial view SRG to the TerrainSrg Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Moved more properties out of the view srg to the terrain srg. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Spelling fixes Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Fixing bug where the roughness min/max value were inverted. Also fixed bug where bad data would show for areas where there was no macro material. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Updates from PR review Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Fixing case issues and updating function name due to a recent fix. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>
There must be only one scenesrg.srgi and one viewsrg.srgi files per game project. They are always located in <DevFolder>/<Project>/ShaderLib, This location can not change, otherwise the asset processor won't be able to find the SceneSrg and the ViewSrg.
Each game project can customize the content of scenesrg.srgi and viewsrg.srgi as needed.
The preprocessor that works on behalf of the Shader Compiler defines the following priority for paths used to search for included files (ordered here from highest to lowest priority):
-
Paths defined in the file <DevFolder>/<Project>/Config/shader_global_build_options.json
1.1. Each path inside shader_global_build_options.json is relative to the <DevFolder>/ path. -
All valid scan folders returned by the Asset Processor with added "ShaderLib/" folder at the end. Here is a short summary of the folders that are scanned by the AP:
2.1. Folders specified in <DevFolder>/AssetProcessorPlatformConfig.ini
2.2. The Asset/ subdirectory within each Gem enabled for the Game Project. (Recursive). Examples:
2.2.1. <DevFolder>/Gems/Atom/Asset/
2.2.2. <DevFolder>/Gems/Camera/Asset/ 2.3. The root folder of each Gem enabled for the Game Project. (Non Recursive). Examples:
2.2.1. <DevFolder>/Gems/Atom/
2.2.2. <DevFolder>/Gems/Camera/ -
Finally, at the lowest priority is the folder: <DevFolder>/Gems/
With that being said, if a project doesn't provide its own shader_global_build_options.json then each time an azsl/azsli calls
#include <scenesrg.srgi>
it will default to
<DevFolder>/<Project>/ShaderLib/scenesrg.srgi
Similarly occurs with #include <viewsrg.srgi>
Because documents may become stale from time to time, the ultimate source of truth on how include paths are resolved is the source file
<DevFolder>/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.cpp
Function name: void InitializePreprocessorOptions(...)
And yes, even the location of that file may change in the future ;-).