summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl
diff options
context:
space:
mode:
authormobserveur <mobserveur@gmail.com>2025-08-30 01:59:43 +0200
committerErik Kundiman <erik@megapahit.org>2025-09-09 07:07:09 +0800
commit317dcdea1ca8d1f540187af47fc23a36ad8232aa (patch)
tree5bdea032c8c2476760efd8b861f72ad3b37c6538 /indra/newview/app_settings/shaders/class1/effects/bloomExtractF.glsl
parent03140ed619c5d49eb3851284ae53bbea73a8b831 (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.glsl81
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