Jump to content

Shadow Generations Shaders - Common dpnm: Difference between revisions

From HedgeDocs
Justin113D (talk | contribs)
Corrected information on how the diffuse color is applied
Justin113D (talk | contribs)
Updated formatting
Line 10: Line 10:
== Behavior ==
== Behavior ==


* Supports [[Hedgehog Engine 2 - Deferred Rendering|deferred rendering]]
* Supports all [[Mesh Layers|mesh layers]]
* Supports compute instancing
* Uses [[Shadow_Generations_Shader_Models|Shader model 2 (Standard)]]
* Supports [[Mesh Layers#Transparent|transparency blending]]
* Supports [[Mesh Layers#Punch-through|transparency clipping]]
* Uses the [[Hedgehog Engine 2 - Physically Based Rendering (PBR)|PBR lighting model]]
* Uses [[Hedgehog Engine 2 - Weather|weather effects]]
* Uses the default shading model
* Vertex colors, including alpha, get combined with the diffuse texture via multiplication. (Only if they are not already used for vertex animation textures)


== Textures ==
== Textures ==


{| class="wikitable" width="100%"
{{Shader Texture Table Header}}
|+
 
! width=10% |Name
!<code>diffuse</code>
! width=1% |Index
|0||0||[[Hedgehog Engine 2 - Textures#Albedo|Albedo]]
!Info
|colspan="3"|[[Hedgehog_Engine_2_-_Physically_Based_Rendering_(PBR)#Albedo|Albedo]] color
|Transparency
 
|-
|-
|<code>diffuse</code>
|0
|A standard [[Hedgehog Engine 2 - Textures#Albedo|albedo]] texture.


Uses alpha channel for transparency.
!<code>diffuse</code>
|1||0||Mask
|Controls the visibility of the diffuse parameter color
|N/A||N/A||N/A


Uses the 1st UV channel.
|-
|-
|<code>diffuse</code>
|1
|A mask texture.


Uses the red channel to control the visibility of the diffuse parameter color.
!<code>specular</code>
|0||0||[[Hedgehog Engine 2 - Textures#PRM|PRM]]
| [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Specular|Specular]] factor (multiplied by 0.25)
| [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Smoothness|Smoothness]] factor
| [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Metallic|Metallic]] factor
| [[Hedgehog Engine 2 - Physically Based Rendering (PBR)#Ambient Occlusion|Ambient Occlusion]]


Uses the 1st UV channel.
|-
|-
|<code>specular</code>
|0
|A standard [[Hedgehog Engine 2 - Textures#PRM|PRM]] texture.


Uses the 1st UV channel.
!<code>normal</code>
|-
|0||0||[[Hedgehog Engine 2 - Textures#Normal map|Normal map]]
|<code>normal</code>
|colspan="2"|Normal map direction
|0
|N/A||N/A
|A standard [[Hedgehog Engine 2 - Textures#Normal map|normal map]] texture.


Uses the 1st UV channel.
|}
|}
Uses the red channel to control the visibility of the diffuse parameter color.


== Parameters ==
== Parameters ==


{| class="wikitable" width="100%"
{{Shader Parameter Table Header}}
|+
! width=10% |Name
! X
! Y
! Z
! W
|-
|<code>diffuse</code>
|<code>diffuse</code>
|colspan="3"| (RGB) Color multiplied with the sampled diffuse texture color (based on the mask)
|colspan="3"| (RGB) Color multiplied with the sampled diffuse texture color based on <code>diffuse [1]</code>
| N/A
| N/A
|}
|}
== Vertex Colors ==
* Color is multiplied into the <code>diffuse</code> texture color*
** *Exception: The model is using vertex animation textures
* Alpha is multiplied into the <code>diffuse</code> texture alpha.


== Technical ==
== Technical ==
Uses the default vertex shader.
 
Uses the [[Shadow_Generations_Shaders_-_common_vs|default vertex shader]].


{| class="mw-collapsible mw-collapsed wikitable" width="300px"
{| class="mw-collapsible mw-collapsed wikitable" width="300px"

Revision as of 09:44, 8 August 2025

Return to shaders list

A standard PBR shader, with an additional color mask texture. The color mask controls the visibility of the diffuse parameter, which gets multiplied with the diffuse texture color. This is useful if you want to animate specific regions of a material.

Related shaders

Behavior

Textures

Name

Index

UV Index

Kind

Red

Green

Blue

Alpha

diffuse 0 0 Albedo Albedo color Transparency
diffuse 1 0 Mask Controls the visibility of the diffuse parameter color N/A N/A N/A
specular 0 0 PRM Specular factor (multiplied by 0.25) Smoothness factor Metallic factor Ambient Occlusion
normal 0 0 Normal map Normal map direction N/A N/A


Uses the red channel to control the visibility of the diffuse parameter color.


Parameters

Name

X

Y

Z

W

diffuse (RGB) Color multiplied with the sampled diffuse texture color based on diffuse [1] N/A

Vertex Colors

  • Color is multiplied into the diffuse texture color*
    • *Exception: The model is using vertex animation textures
  • Alpha is multiplied into the diffuse texture alpha.

Technical

Uses the default vertex shader.

Shader Features
is_compute_instancing
is_use_tex_srt_anim
enable_deferred_rendering
enable_alpha_threshold
is_use_gi_prt
is_use_gi_sg
is_use_gi

Gallery

Cookies help us deliver our services. By using our services, you agree to our use of cookies.