Skip to content

Commit 492a3e7

Browse files
authored
Added support for emissive in standard shader (#582)
Added support for emissive map, color, and intensity
1 parent 7b85b7f commit 492a3e7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Resources/Engine/Shaders/Standard.ovfx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ uniform vec4 u_Albedo = vec4(1.0);
7777
uniform sampler2D u_AmbientOcclusionMap;
7878
uniform sampler2D u_MaskMap;
7979

80+
uniform sampler2D u_EmissiveMap;
81+
uniform vec3 u_EmissiveColor = vec3(1.0, 1.0, 1.0);
82+
uniform float u_EmissiveIntensity = 0.0;
83+
8084
#if defined(SPECULAR_WORKFLOW)
8185
uniform sampler2D u_SpecularMap;
8286
uniform float u_Specular = 1.0;
@@ -205,6 +209,9 @@ void main()
205209
pbr = mix(pbr, pbr / (pbr + vec3(1.0)), u_BuiltInToneMapping);
206210
pbr = mix(pbr, pow(pbr, vec3(1.0 / 2.2)), u_BuiltInGammaCorrection);
207211

212+
const vec3 emissive = texture(u_EmissiveMap, texCoords).rgb * u_EmissiveColor * u_EmissiveIntensity;
213+
pbr += emissive;
214+
208215
FRAGMENT_COLOR = vec4(pbr, albedo.a);
209216
#endif
210217
}

0 commit comments

Comments
 (0)