CRYENGINE Community Edition 1.0 introduces support for loading custom full-screen .hlsl shaders directly into the engine. A prime example is the included Comics Shader, showcasing how this feature can be used to achieve unique visual styles. Currently, the engine supports one shader file at a time, making this functionality ideal for projects aiming to create a distinct, stylized look.
Use-case example – comics The Walking Dead like visuals:

Shader placement
The engine only supports loading shaders from your project’s asset folder. To use a custom .hlsl shader, place the file inside this folder. For organizational clarity, we’ve created a dedicated subfolder named Shaders.
Shader Placement Example Path:

Shader Skeleton
Below is a shader skeleton you can use as a starting point for creating your own .hlsl shader file. Maintaining this structure is essential, as the compiler relies on it to properly recognize and compile the shader.
//@entry ExecutePS
// Feature toggles
#define ENABLE_OUTLINES 1
#define ENABLE_POSTERIZE 1
#define ENABLE_HATCHING 1
#define ENABLE_GI_AWARE 0
// Global style scaler
#ifndef STYLE_BOOST
#define STYLE_BOOST 0.75
#endif
// Optional reversed depth
// #define REVERSED_DEPTH 1
cbuffer StyleCB : register(b0)
{
float4 P0; // x=EdgeDepthScale, y=EdgeLumaScale, z=EdgeThreshold, w=PosterizeLevels
float4 P1; // x=Unused, y=OutlineStrength, z=OutlineWidthPx, w=ColorSaturation
float4 P2; // x=ScreenWidth, y=ScreenHeight, z=TintStrength, w=StyleBlend
float4 Tint; // xyz=tint color, w=StrokeIntensity
}
// Resources
Texture2D SceneColor : register(t0);
Texture2D SceneDepth : register(t1);
SamplerState LinearClamp : register(s0);
SamplerState PointClamp : register(s1);
struct VSOut { float4 pos : SV_Position; float2 uv : TEXCOORD0; };
// ---- Utility (luma/saturation/posterize/noise/depth) ----
// Implement: Luma, AdjustSaturation, PosterizeRGB, PosterizeLuma, Hash12, FetchDepth
// ---- Sky/sun masks ----
// Implement: PureSkyMaskFromDepth, ComputeSkySunMask
// ---- Hatching ----
// Implement: LinePattern, RotHatch, HatchFactor
// ---- Edges ----
// Implement: EdgeFactor (combine luma + depth edges, optional dilation)
// ---- Grading/tint ----
// Implement: WarmCoolGradeSoft, ApplyTint
float4 ExecutePS(VSOut IN) : SV_Target
{
float3 original = SceneColor.SampleLevel(LinearClamp, IN.uv, 0).rgb;
float depth = FetchDepth(IN.uv);
float skyMask = PureSkyMaskFromDepth(depth);
float skySun = ComputeSkySunMask(IN.uv, original);
// Base styling
float styleBlend = P2.w;
float targetSat = lerp(1.0, P1.w, styleBlend);
float3 styled = AdjustSaturation(original, targetSat);
styled = WarmCoolGradeSoft(styled);
styled = ApplyTint(styled);
// Posterization
#if ENABLE_POSTERIZE
float levels = max(2.0, P0.w);
float3 pre = styled;
// Optional: add dither noise for sky areas
float3 post = PosterizeLuma(PosterizeRGB(pre, levels), levels * 0.6);
float posterBlend = saturate(styleBlend * 1.0 * STYLE_BOOST);
styled = lerp(styled, post, posterBlend * (1.0 - skyMask));
#endif
// Hatching
#if ENABLE_HATCHING
float shade = dot(styled, float3(0.299,0.587,0.114));
float hatch = HatchFactor(IN.uv, shade);
float hatchBlend = saturate(styleBlend * 1.0 * STYLE_BOOST);
styled = lerp(styled, styled * hatch, hatchBlend * (1.0 - skyMask));
#endif
// Outlines
float edge = 0.0;
#if ENABLE_OUTLINES
edge = EdgeFactor(IN.uv);
float outlineAlpha = edge * P1.y * 1.0 * STYLE_BOOST;
float3 ink = float3(0.04, 0.04, 0.045);
float3 base = styled;
float3 composed = base * (1.0 - outlineAlpha) + ink * outlineAlpha;
#else
float3 composed = styled;
#endif
// Restore sky if desired
composed = lerp(composed, original, skyMask);
return float4(saturate(composed), 1.0);
}
Shader Loading
- Open the Environment Editor via Tools → Environment Editor.
- Create a new environment preset or select an existing one.
- In the Constants section, navigate to Shader Loading.
- Enable Shader Loading by checking Enable Shader Loading.
- Load your desired shader file.
Once enabled, the shader will automatically be applied every time you use that environment preset.
Shader Loading in the environment editor:

