diff options
author | mobserveur <mobserveur@gmail.com> | 2025-08-30 01:59:43 +0200 |
---|---|---|
committer | mobserveur <mobserveur@gmail.com> | 2025-08-30 01:59:43 +0200 |
commit | 7f0c81918575d3f05e4eadc160b600eaa8b383d1 (patch) | |
tree | 4c6bb40e93e38bb8a32964380f97ac2a06490b11 /indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl | |
parent | 03140ed619c5d49eb3851284ae53bbea73a8b831 (diff) |
Performance Optimisations, Bloom effect, Visuals Panel
This commit contains performance optimisations in the the pipeline,
framebuffer, vertexbuffer, reflection probes, shadows. It also fixes
many opengl errors, modifies the opengl debugging, and adds
a visuals effects panel.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl new file mode 100644 index 0000000000..8fb10d8698 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl @@ -0,0 +1,81 @@ +out vec4 frag_color; + +uniform sampler2D diffuseMap; +uniform sampler2D bloomExtractORM; // orm +uniform sampler2D bloomExtractEmissive; // emissive +uniform sampler2D bloomExtractEmissive2; // emissive 2 + +uniform float bloomExtractBrightness = 0.9; +uniform float bloomExtractMetal = 0.20; +uniform float bloomExtractNonMetal = 0.20; + +in vec2 vary_texcoord0; + +void main() +{ + vec4 col = texture(diffuseMap, vary_texcoord0.xy); + + //int valid = 0; + //float brightness = dot(col.rgb, vec3(0.2126, 0.7152, 0.0722)); + float brightness = dot(col.rgb, vec3(0.3, 0.5, 0.2)); + + if(brightness < bloomExtractBrightness) + { + discard; + return; + } + + vec3 emi = texture(bloomExtractEmissive, vary_texcoord0.xy).rgb; + if(emi.r + emi.g + emi.b > 0.01) + { + discard; + return; + } + + emi = texture(bloomExtractEmissive2, vary_texcoord0.xy).rgb; + if(emi.r + emi.g + emi.b > 0.01) + { + discard; + return; + } + + vec4 orm = texture(bloomExtractORM, vary_texcoord0.xy); + + if(orm.r < 0.7) + { + discard; + return; + } + + if(bloomExtractMetal == 1.0 && bloomExtractNonMetal == 1.0) + { + frag_color = vec4(col.rgb, 0.0); + return; + } + + if(orm.b < 0.15) + { + // non metal + if(orm.g > bloomExtractNonMetal) + { + discard; + return; + } + } + else if(orm.b > 0.8) + { + // metal + if(orm.g > bloomExtractMetal) + { + discard; + return; + } + } + else + { + discard; + return; + } + + frag_color = vec4(col.rgb, 0.0); +}
\ No newline at end of file |