Rendering Characters and Customizing Shaders in Game
This page explains how characters are rendered in our system, with a focus on performance, scalability, and flexibility. It covers the default shaders used for previsualization, how to customize them, and best practices for achieving better visual results.
Rendering Philosophy
Our character rendering system is designed for performance and scalability, making it ideal for previsualization and large crowds. It provides a customizable foundation built on Unity's Shader Graph, allowing you to edit and extend shaders to fit your project's visual style and technical needs.
The shaders
We provide a few sample shaders, but the two most important ones are:
- HDRPDidimoWithBlends - Used for any Deformable, like garments and hair. Based on Unity's standard HDRP lit shader, but with custom nodes to handle modifying the vertices to fit the shape of the character, as well as albedo color variation support
- HDRPDidimoSSSWithBlends - Used for rendering skin, also based on Unity's standard HDRP lit shader, has custom nodes to handle blending both the geometry of the character to accommodate for variation, as well as blending the skin, according to the character configuration.
These shaders are starting points and should be edited to adapt to your visual goals.
Key Considerations
- Purpose: The default shaders are for previsualization and performance, not final production quality.
- Customization is Key: Achieving your desired look requires customizing the shaders and assets. Feel free to modify the shaders we provide, while keeping our custom nodes for blending skin tones, modifying geometry, and applying albedo color variation.
- Sample Assets: The included hair assets are for demonstration purposes only.
- Performance Focus: The system is optimized for characters viewed from a distance.
Hair Rendering with Alpha Clipping
We use alpha clipping for hair to balance visual quality and performance. This method avoids transparency sorting issues and is well-suited for rendering numerous characters efficiently. It works best with stylized hair modeled in clumps, with few geometry cards, like the ones provided with our samples.
Best Practices for Hair Assets
To get the best results from the default hair shader:
- Textures: Combine albedo and alpha maps. Use high-contrast alpha channels to define clear hair shapes. Avoid soft or sparse transparency, as it will be clipped.
- Modeling: Favor clump-based hair geometry instead of fine, transparency-based hair cards.
- Customization: For advanced effects like soft blending or anisotropic highlights, customize our shaders to suit your needs.
Updated 1 day ago