05.01.2021
+ Bloom effect + PixelInformation + Many Summaries + Add-methods for CVectors + Exposure-Field in GenericCamera for HDR. ~ ColorAttachments now can have PixelInformation ~ Transformed MeshAttributes to a own class ~ Fixed the non-applying of transformations at texts ~ Added more information to the context ~ Improved Pipeline-Process. ~ Changed how Uniform takes arrays - Light system
This commit is contained in:
parent
9b917ac181
commit
4c18127c88
52 changed files with 697 additions and 373 deletions
30
SMCode/SM.Base/PostEffects/Shaders/bloom_blur.glsl
Normal file
30
SMCode/SM.Base/PostEffects/Shaders/bloom_blur.glsl
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#version 330
|
||||
|
||||
uniform sampler2D renderedTexture;
|
||||
|
||||
uniform bool Horizontal;
|
||||
|
||||
uniform float[32] Weights;
|
||||
uniform int WeightCount;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
vec4 GetRenderColorOffset(vec2 offset);
|
||||
|
||||
void main() {
|
||||
vec2 tex_offset = 1.0 / textureSize(renderedTexture, 0);
|
||||
vec3 result = GetRenderColorOffset(vec2(0)).rgb * Weights[0];
|
||||
|
||||
if (Horizontal) {
|
||||
for(int i = 1; i < WeightCount; i++) {
|
||||
result += GetRenderColorOffset(vec2(tex_offset.x * i, 0)).rgb * Weights[i];
|
||||
result += GetRenderColorOffset(vec2(-tex_offset.x * i, 0)).rgb * Weights[i];
|
||||
}
|
||||
} else {
|
||||
for(int i = 1; i < WeightCount; i++) {
|
||||
result += GetRenderColorOffset(vec2(0, tex_offset.x * i)).rgb * Weights[i];
|
||||
result += GetRenderColorOffset(vec2(0, -tex_offset.x * i)).rgb * Weights[i];
|
||||
}
|
||||
}
|
||||
color = vec4(result, 1);
|
||||
}
|
||||
21
SMCode/SM.Base/PostEffects/Shaders/bloom_merge.glsl
Normal file
21
SMCode/SM.Base/PostEffects/Shaders/bloom_merge.glsl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#version 330
|
||||
|
||||
in vec2 vTexture;
|
||||
|
||||
uniform sampler2D renderedTexture;
|
||||
uniform sampler2D Bloom;
|
||||
|
||||
uniform float Exposure;
|
||||
uniform bool HDR;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
void main() {
|
||||
vec3 result = texture(Bloom, vTexture).rgb;
|
||||
if (!HDR) {
|
||||
result = vec3(1.0) - exp(-result * Exposure);
|
||||
}
|
||||
result += texture(renderedTexture, vTexture).rgb;
|
||||
|
||||
color = vec4(result, 1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue