RealityShaders is an HLSL shader overhaul for Project Reality: Battlefield 2. RealityShaders introduces many graphical updates that did not make it into the Refactor 2 Engine.
RealityShaders also includes .fxh files that contain algorithms used in the collection.
- Distance-Based Fog: This fogging method eliminates "corner-peeking".
- Half-Lambert Lighting: Valve Software's smoother version of the Lambertian Term used in lighting.
- Logarithmic Depth Buffer: Logarithmic depth buffering eliminates flickering within distant objects.
- Modernized Post-Processing: This shader package includes updated thermal and suppression effects.
- Optional Bicubic Lightmapping: A smoother interpolation method to eliminate blockiness and noticeable seams in baked lighting. Credit to Felix Westin.
- Per-Pixel Lighting: Per-pixel lighting allows sharper lighting and smoother fogging.
- Procedural Sampling: No more visible texture repetition off-map terrain.
- Shader Model 3.0: Shader Model 3.0 allows modders to add more grapical updates into the game.
- Sharpened Filtering: Support for 16x anisotropic filtering.
- Updated BF2Editor Shaders: The Shader Model 3.0 update allows BF2Editor to support updated dependencies and Large Address Aware.
- Click on the green
<> Codedrop-down button and selectDownload ZIP. - Unpack the downloaded
RealityShaders-main.zipfile. - Locate your
\mods\prdirectory in your Project Reality: Battlefield 2 installation. - In the
\mods\prdirectory, create a backup of theshaders_client.zipfile. Name the backup something likeshaders_client_backup.zip - Open the original
shaders_client.zipfile. - Copy the files from the
\pr\shadersfolder of the unpacked zip file intoshaders_client.zip.
- File path:
shared/common/RealityLib.fxh - Function name:
Common_RealityLib_FunctionName() - Example:
shared/common/RealityLib.fxh->Common_RealityLib_FunctionName()
State parameters:
BlendOp = ADD;
System semantics:
float4 SV_POSITION;
Preprocessor definitions:
#define SHADER_VERSION
Preprocessor macros:
#define EXAMPLE_MACRO()
Preprocessor macro arguments
#define EXAMPLE_MACRO(EXAMPLE_ARG)
Uniform variables:
uniform float _Example
Function arguments:
void Function(int ArgumentOne)
Global variables:
static const float4 GlobalVariable = 1.0;
void Function()
{
return GlobalVariable;
}
Local variables:
void Function()
{
float4 LocalVariable = 1.0;
return LocalVariable;
}
Textures and samplers:
texture2D ExampleTex(...)
sampler2D SampleExampleTex(...)
struct datatypes:
struct APP2VS_Foobar { ... };
struct VS2PS_Foobar { ... };
struct PS2FB_Foobar { ... };
struct PS2MRT_Foobar { ... };
VertexShader and PixelShader
VertexShader = VS_Example(...);
PixelShader = PS_Example(...);
-
Major knowledge-base and inspiration.
-
- Consultation and for sharing his test of features for Battlefield 2 graphics enhancements
- Bicubic lightmapping implementation
-
Lt. Fred for testing and suggestions!