Loads and loads of small improvements I added while developing on my game
This commit is contained in:
parent
41421b1df9
commit
a7c71e7ea1
107 changed files with 2278 additions and 1023 deletions
|
|
@ -1,10 +1,16 @@
|
|||
#version 330
|
||||
|
||||
in vec2 vTexture;
|
||||
in vec2 TransformedTexture;
|
||||
|
||||
uniform sampler2D renderedTexture;
|
||||
uniform sampler2D Scene;
|
||||
uniform sampler2D Bloom;
|
||||
|
||||
uniform float MinAmount;
|
||||
uniform float MaxAmount;
|
||||
uniform sampler2D AmountMap;
|
||||
uniform bool HasAmountMap;
|
||||
|
||||
uniform float Exposure;
|
||||
uniform bool HDR;
|
||||
|
||||
|
|
@ -12,10 +18,13 @@ layout(location = 0) out vec4 color;
|
|||
|
||||
void main() {
|
||||
vec3 result = texture(Bloom, vTexture).rgb;
|
||||
if (HasAmountMap) result *= clamp(length(texture(AmountMap, TransformedTexture).rgb) * (MaxAmount - MinAmount) + MinAmount, 0, 1);
|
||||
if (!HDR) {
|
||||
result = vec3(1.0) - exp(-result * Exposure);
|
||||
}
|
||||
result += texture(renderedTexture, vTexture).rgb;
|
||||
|
||||
|
||||
result = texture(Scene, vTexture).rgb + result;
|
||||
|
||||
color = vec4(result, 1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue