Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add pluginagentmarketplace/custom-plugin-game-developer --skill "graphics-rendering"
Install specific skill from multi-skill repository
# Description
|
# SKILL.md
name: graphics-rendering
version: "2.0.0"
description: |
3D graphics, shaders, VFX, lighting, rendering optimization.
Create stunning visuals with production-ready techniques.
sasmp_version: "1.3.0"
bonded_agent: 03-graphics-rendering
bond_type: PRIMARY_BOND
parameters:
- name: technique
type: string
required: false
validation:
enum: [pbr, toon, cel, realistic, stylized]
- name: platform
type: string
required: false
validation:
enum: [pc, mobile, console, vr]
retry_policy:
enabled: true
max_attempts: 3
backoff: exponential
observability:
log_events: [start, complete, error]
metrics: [draw_calls, frame_time_ms, gpu_memory]
Graphics & Rendering
Rendering Pipeline
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RENDERING PIPELINE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β VERTEX STAGE: β
β Model Space β World Space β View Space β Clip Space β
β β β
β RASTERIZATION: Triangles β Fragments β
β β β
β FRAGMENT STAGE: Color, Lighting, Texturing β
β β β
β OUTPUT: Final pixel color to framebuffer β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Shader Programming
Standard PBR Shader (HLSL)
// β
Production-Ready: PBR Surface Shader
struct SurfaceData
{
float3 Albedo;
float3 Normal;
float Metallic;
float Roughness;
float AO;
};
float3 FresnelSchlick(float cosTheta, float3 F0)
{
return F0 + (1.0 - F0) * pow(1.0 - cosTheta, 5.0);
}
float DistributionGGX(float3 N, float3 H, float roughness)
{
float a = roughness * roughness;
float a2 = a * a;
float NdotH = max(dot(N, H), 0.0);
float NdotH2 = NdotH * NdotH;
float denom = (NdotH2 * (a2 - 1.0) + 1.0);
return a2 / (PI * denom * denom);
}
float4 PBRLighting(SurfaceData surface, float3 viewDir, float3 lightDir)
{
float3 H = normalize(viewDir + lightDir);
float3 F0 = lerp(0.04, surface.Albedo, surface.Metallic);
float D = DistributionGGX(surface.Normal, H, surface.Roughness);
float3 F = FresnelSchlick(max(dot(H, viewDir), 0.0), F0);
float3 diffuse = surface.Albedo * (1.0 - surface.Metallic);
float3 specular = D * F;
return float4((diffuse + specular) * surface.AO, 1.0);
}
Toon/Cel Shader
// β
Production-Ready: Toon Shader
float4 ToonShading(float3 normal, float3 lightDir, float4 baseColor)
{
float NdotL = dot(normal, lightDir);
// Step function for cel shading
float toonRamp;
if (NdotL > 0.7) toonRamp = 1.0;
else if (NdotL > 0.3) toonRamp = 0.6;
else if (NdotL > 0.0) toonRamp = 0.3;
else toonRamp = 0.1;
return baseColor * toonRamp;
}
// Outline pass (inverted hull method)
float4 OutlineVertex(float4 position, float3 normal, float outlineWidth)
{
position.xyz += normal * outlineWidth;
return position;
}
Visual Effects (VFX)
Particle System Setup
PARTICLE SYSTEM ARCHITECTURE:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EMITTER: Rate, Bursts, Shape β
β β β
β SPAWN: Initial velocity, Size, Color, Lifetime β
β β β
β UPDATE: Forces, Collisions, Color over life β
β β β
β RENDER: Billboard, Mesh, Trail β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
COMMON VFX RECIPES:
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββ
β Fire β OrangeβYellow gradient, upward velocity β
β Smoke β Gray billboards, turbulence noise β
β Sparks β Point emitter, gravity, short lifetime β
β Magic β Spiral path, glow, color cycling β
β Blood β Burst, gravity, decal on collision β
ββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββ
Optimization Techniques
| Technique | Draw Call Reduction | When to Use |
|---|---|---|
| Static Batching | 90%+ | Static geometry |
| Dynamic Batching | 50-80% | Small moving objects |
| GPU Instancing | 95%+ | Many identical objects |
| LOD System | 40-60% | Distant objects |
| Occlusion Culling | 30-70% | Indoor scenes |
LOD Configuration
LOD DISTANCE SETUP:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LOD0 (100% tris): 0-20m β Full detail β
β LOD1 (50% tris): 20-50m β Reduced detail β
β LOD2 (25% tris): 50-100m β Low detail β
β LOD3 (10% tris): 100m+ β Billboard/Impostor β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π§ Troubleshooting
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PROBLEM: Too many draw calls (>2000) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β SOLUTIONS: β
β β Enable GPU instancing for repeated objects β
β β Use texture atlases β
β β Merge static meshes β
β β Implement LOD system β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PROBLEM: Shader artifacts / visual glitches β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β SOLUTIONS: β
β β Check for division by zero β
β β Validate normal vectors β
β β Use saturate() on color outputs β
β β Check texture sampling modes β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Platform Guidelines
| Platform | Max Draw Calls | Shader Complexity | Texture Size |
|---|---|---|---|
| Mobile | 100-200 | Low | 1024px max |
| Console | 2000-3000 | High | 4096px |
| PC | 3000-5000 | Very High | 8192px |
| VR | 100-150 | Low | 2048px |
Use this skill: When creating shaders, optimizing visuals, or implementing effects.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.