Skip to content

Commit

Permalink
Implement Support For HDR (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
datacrystals committed Apr 14, 2022
1 parent d2ab7df commit 4b9522f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/EditorAssets/Projects/DefaultProject/10036.ERS
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ void main()




15 changes: 15 additions & 0 deletions Source/EditorAssets/Projects/DefaultProject/10037.ERS
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct STRUCT_SampledData {
vec4 NormalTextureColor;
vec4 HeightTextureColor;
vec4 EmissiveTextureColor;
vec4 OpacityTextureColor;

};

Expand All @@ -98,6 +99,7 @@ uniform sampler2D texture_specular1;
uniform sampler2D texture_normals1;
uniform sampler2D texture_height1;
uniform sampler2D texture_emissive1;
uniform sampler2D texture_opacity1;
uniform float Shinyness;


Expand Down Expand Up @@ -191,6 +193,11 @@ void main()
Result += SampledData.EmissiveTextureColor;
}

// Multiply By Opacity
//if (HasOpacity) {
// Result.a = SampledData.OpacityTextureColor.r;
//}

// Apply Gamma Correction
FragColor = GammaCorrectResult(Result, GammaCorrectionEnabled_);

Expand Down Expand Up @@ -228,6 +235,13 @@ STRUCT_SampledData SetSampledData() {
SampledData.EmissiveTextureColor = vec4(0.0f);
}

// Handle Opacity Textures
if (HasEmissive) {
SampledData.OpacityTextureColor = texture(texture_opacity1, Object.TexCoords);
} else {
SampledData.OpacityTextureColor = vec4(0.0f);
}

return SampledData;

}
Expand Down Expand Up @@ -343,3 +357,4 @@ vec4 CalculateSpotLight(STRUCT_SpotLight Light, STRUCT_SampledData SampledData,




0 comments on commit 4b9522f

Please sign in to comment.