summaryrefslogtreecommitdiff
path: root/indra/llrender/llshadermgr.cpp
diff options
context:
space:
mode:
authorMichael Pohoreski <ptolemy@lindenlab.com>2022-06-23 15:43:16 +0000
committerMichael Pohoreski <ptolemy@lindenlab.com>2022-06-23 15:43:16 +0000
commit54edd8ba8b824241f3d6df9e3ffff7a7c926665d (patch)
treec106ca423af59f10077e91e1390acac45124a4b5 /indra/llrender/llshadermgr.cpp
parentd995ac67ae2b668d988dc395f28b219f5809c284 (diff)
parentac62a744586e4a6f1130dcdcb38f75a2d3247de1 (diff)
Merged in SL-17274_gbuffer_flags (pull request #1030)
SL-17274 gbuffer flags Approved-by: Dave Parks
Diffstat (limited to 'indra/llrender/llshadermgr.cpp')
-rw-r--r--indra/llrender/llshadermgr.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 9e28e18fee..09d3f95736 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -787,7 +787,14 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
extra_code_text[extra_code_count++] = strdup("#define shadow2DRect(a,b) vec2(texture(a,b))\n");
}
}
-
+
+ // Use alpha float to store bit flags
+ // See: C++: addDeferredAttachment(), shader: frag_data[2]
+ extra_code_text[extra_code_count++] = strdup("#define GBUFFER_FLAG_SKIP_ATMOS 0.0 \n"); // atmo kill
+ extra_code_text[extra_code_count++] = strdup("#define GBUFFER_FLAG_HAS_ATMOS 0.25\n"); // bit 0
+ extra_code_text[extra_code_count++] = strdup("#define GBUFFER_FLAG_HAS_PBR 0.50\n"); // bit 1
+ extra_code_text[extra_code_count++] = strdup("#define GET_GBUFFER_FLAG(flag) (mod(floor(norm.w/flag),2.0)>0.5)\n");
+
if (defines)
{
for (std::unordered_map<std::string,std::string>::iterator iter = defines->begin(); iter != defines->end(); ++iter)