HSR Style Toon Shader V21 - User Guide
For XNA Posing Studio (XPS) 11.8.9

🚀 1. Installation & Ussage
Extract the compressed file and put the "1 Toon Shader Ultimate.fx" inside the "shader" folder in XPS. (You can rename the .fx to whatever you ant, just leave the .fx at the end)

Open XPS and in the Control Windows go to the Shader Tab and choose the "User Written Shader" submenú Go to File > Load Shader and choose the 1 Toon Shader Ultimate.

🎮 2. Real-Time Controls (XPS Interface)
You do not need to edit the code to adjust the basic look. Use the standard XPS windows:

Lighting Parameters (Light 1, Light 2, Light 3):

Light 1 (Main Toon Light): Controls the primary illumination and shadow direction.

Light 2 (Secondary Toon + Shadow Tint): Acts as a secondary, independent Toon light source. Additionally, its color will subtly tint the shadows cast by Light 1, adding warmth or environmental hues to the dark areas.

Light 3 (Rim Light): Provides a backlight/rim light effect based on your camera angle. Useful for separating the character from dark backgrounds.

User Shader Parameters (UserParameter1 ~ UserParameter4):

UserParameter 1 (Outline Thickness): Controls the width of the black outline. 0.0 = No outline, 0.3 = Thin / Game-style, 1.0 = Thick.

UserParameter 2 (Specular Intensity): Controls the strength of the gloss/highlights on the model. 0.0 = Matte, 1.0 = Maximum metallic shine.

UserParameter 3 (Toon Shadow Area): Defines the size of the shadow region. 0.0 = Shadows cover a large area, 1.0 = Shadows are minimized or absent.

UserParameter 4 (Shadow Edge Softness): Controls the transition between light and shadow. 0.0 = Sharp, hard-edged Toon style, 1.0 = Blurred, soft gradient.

🛠️ 3. Advanced Configuration (Editing the Code)
If you want to customize the default shadow colors or disable outlines for specific parts of the model (Render Groups), open the .fx file with a text editor (like Notepad).

A. Changing the Global Shadow Color:
Look for the // --- SHADOW COLOR PRESETS --- section near the top of the file. We have included several commented presets.

To activate a preset, simply replace the line "static const float3 _GlobalDefaultShadowColor   = float3(0.22, 0.12, 0.105); // Fallback shadow for unlisted RGs." or just replace the "float3(0.22, 0.12, 0.105)


Example: To use a deep night shadow, copy the line without the // at the beggining "static const float3 _GlobalDefaultShadowColor = float3(0.05, 0.02, 0.02); and replace the line static const float3 _GlobalDefaultShadowColor   = float3(0.22, 0.12, 0.105); // Fallback shadow for unlisted RGs. The mst important section to replace is the "float3(0.05, 0.02, 0.02)" part which gives the color.

B. Per-Render Group Controls (Outlines & Custom Shadows):
The shader includes a comprehensive list of Render Groups (RG 00 to 49).

Outlines: For any RG, you can turn the outline on/off by changing the boolean value:
static const bool _RG01_Outline = true; -> change true to false to hide the outline on that group.

Per-Group Shadow Colors: By default, all groups use the Global Shadow Color. If you want a specific mesh (like Skin) to have a warmer, pinker shadow color:

Set _RGXX_UseCustomShadow = true; (change false to true).

Change the _RGXX_ShadowColor values. Example: static const float3 _RG05_ShadowColor = float3(0.75, 0.45, 0.50);.

💡 4. Quick Tips
Save your settings: Remember to save the .fx file in Notepad after making changes and reload it in XPS (File > Load Shader) to see the updates.

No shadows needed? Set the Shadow Depth slider of Light 1 to 0.0 in the XPS Lighting panel to completely remove the Toon shadow.