Shadow Generations Shaders - DirectionBlend dpnndpn: Difference between revisions
Justin113D (talk | contribs) No edit summary |
Justin113D (talk | contribs) Added bug warnings |
||
Line 9: | Line 9: | ||
* [[Texture Blending#Distance blending|distance blending]] to [[Texture Blending#Normal map blending|blend]] a detail [[Hedgehog Engine 2 - Textures#Normal map|normal map]] into the first normal texture | * [[Texture Blending#Distance blending|distance blending]] to [[Texture Blending#Normal map blending|blend]] a detail [[Hedgehog Engine 2 - Textures#Normal map|normal map]] into the first normal texture | ||
| overview bugs = This shader has a bug where the second normal texture is not applied. | |||
| | |||
| related shaders = | | related shaders = | ||
Line 77: | Line 73: | ||
** Green and blue channels are unused | ** Green and blue channels are unused | ||
* Alpha is unused | * Alpha is unused | ||
| bugs = | |||
When the shader unpacks the <code>normal[2]</code> texture, the tangent and binormal vectors are left at 0, which results in no change by the normal map at all. | |||
<br/><b>Speculation:</b> | |||
The developers could have attempted to implement multi-tangent here, but must have compiled the shader before the multi-tangent system was properly implemented, which left the tangent and binormal at 0 and resulted in incorrectly unpacking the normal map. | |||
| textures = | | textures = |
Revision as of 12:15, 25 August 2025
Overview
[2] Standard (PBR)
Does not support:
An advanced PBR shader that uses
- directional blending to interpolate between two texture sets
- distance blending to blend a detail normal map into the first normal texture
Related shaders
- Blend_dpnbdpn
- Blend_dpndpn
- BlendDetail_dndnd
- BlendDetail_dpndpnn
- Detail_dpndpn
- Detail_dpnn
- DirectionBlend_dpndpn
- DirectionBlend_dpndpnn
- DistanceBlend_dpn
Behavior
Distance blending
Uses distance blending to interpolate
- from the
normal
texture - to the
normal
andnormal[1]
textures blended together
for the normal map of the first set of textures.
The shader uses detailDistance
and detailFadeRange
from the stage RFL to determine the detail range.
Directional blending
This shader has two sets of PBR textures:
diffuse
,specular
andnormal
diffuse[1]
,specular[1]
andnormal[2]
The shader uses a blend factor to interpolate from the first set of textures to second one.
This blend factor is calculated using directional blending.
This involves various inputs:
Input | Description |
---|---|
Normal map | The normal (afterdistance blending) texture is applied to the normal direction before calculating the directional blend factor
|
Red vertex color channel | The directional blend bias |
DirectionParam parameter
|
The directional blend direction |
NormalBlendParam parameter
|
The Directional blend intensity and offset |
diffuse and diffuse[1] (multiplied together)
|
The Directional blend limit |
Transparency
(For some reason) the directional blend factor is used for the transparency, and not any of the diffuse textures alpha channels, which makes for limited use cases.
Vertex Colors
- The colors...
- Red channel is used as the directional blend bias
- Green and blue channels are unused
- Alpha is unused
Bugs
normal[2]
texture, the tangent and binormal vectors are left at 0, which results in no change by the normal map at all.
Speculation:
Material Inputs
Textures
Name | Index | UV Index | Kind | Red | Green | Blue | Alpha |
---|---|---|---|---|---|---|---|
diffuse
|
0 | Any | Albedo | First Albedo color | directional blend limit | ||
diffuse
|
1 | Any | Albedo | Second Albedo color | directional blend limit | ||
specular
|
0 | Any | PRM | First Specular factor; Gets multiplied by 0.25 |
First Smoothness factor | First Metallic factor | First Ambient Occlusion |
specular
|
1 | Any | PRM | Second Specular factor; Gets multiplied by 0.25 |
Second Smoothness factor | Second Metallic factor | Second Ambient Occlusion |
normal
|
0 | Any | Normal map | First Normal map direction | N/A | N/A | |
normal
|
1 | Any | Detail Normal map | Detail Normal map direction | N/A | N/A | |
normal
|
2 | Any | Normal map | Second Normal map direction | N/A | N/A |
Parameters
Name | X | Y | Z | W |
---|---|---|---|---|
DetailFactor
|
UV scale for the normal[1] texture
|
N/A | N/A | N/A |
DirectionParam
|
Directional blend direction | N/A | ||
NormalBlendParam
|
Directional blend intensity | Directional blend offset | N/A | N/A |
Technical
For some reason using the IBL_CAPTURE
debug view the directional blend factor is set to 0.
Why this was done is unknown, and makes no sense.
Shader Features |
---|
is_compute_instancing
|
is_use_tex_srt_anim
|
enable_alpha_threshold
|
is_use_gi_prt
|
is_use_gi_sg
|
is_use_gi
|