RealityShaders is a third-party HLSL shader overhaul for the game Project Reality: Battlefield 2. It modernizes the 2005 game's graphics by introducing features like Shader Model 3.0, 3D water and terrain, high-precision shading, and procedural effects.
The project is structured into two main directories:
bf2editor/: Contains shaders for the Battlefield 2 editor.pr/: Contains shaders for the Project Reality game itself.
The core logic is written in HLSL, with .fx files defining the shaders and .fxh files containing shared functions and definitions.
This project consists of HLSL shader files that are compiled by the game engine. There are no explicit build scripts or commands in this repository. The shaders are likely loaded and compiled at runtime by the game itself.
To use these shaders, you would typically need to:
- Install Project Reality: Battlefield 2.
- Replace the original shader files with the ones from this repository, backing up the originals first.
- Run the game.
The project follows a strict coding convention as outlined in the README.md file. Key aspects include:
- Case Styles:
ALLCAPSfor state parameters and system semantics.ALL_CAPSfor preprocessor macros._SnakeCasefor uniform variables.SnakeCasefor function arguments, global variables, and local variables.Snake_Casefor data subcategories.
- Prefixes:
structdatatypes are prefixed based on their usage (e.g.,APP2VS_,VS2PS_).VertexShadermethods are prefixed withVS_.PixelShadermethods are prefixed withPS_.
These conventions are crucial for maintaining consistency and readability across the shader codebase. Adhering to them is important when contributing to the project.