Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2015-02-01 21:28:17 +0000
committerStijn Buys <ingar@osirion.org>2015-02-01 21:28:17 +0000
commita0d8d44c93820754e887603ce6251c8ac135802e (patch)
tree61975f5b487fca7396779084e3ce50ea712b74db
parent5bbbdc24293ad1138a0b93628f7d28f8b249b92d (diff)
Parse the rgbgen directive in material files.
-rw-r--r--src/model/material.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/model/material.cc b/src/model/material.cc
index 93492f5..29dde49 100644
--- a/src/model/material.cc
+++ b/src/model/material.cc
@@ -332,6 +332,25 @@ void Material::load_shaderfile(const std::string &shadername)
} else if (firstword.compare("environment") == 0) {
layer->set_tcgen(Layer::TCGenEnvironment);
layer->set_texmap(Layer::TexMapEnvironment);
+ } else if (firstword.compare("rgbgen") == 0) {
+ if (linestream >> firstword) {
+ aux::to_lowercase(firstword);
+ if (firstword.compare("color") == 0) {
+ layer->set_rgbgen(Layer::RGBGenColor);
+ } else if (firstword.compare("engine") == 0) {
+ layer->set_rgbgen(Layer::RGBGenEngine);
+ } else if (firstword.compare("entity") == 0) {
+ layer->set_rgbgen(Layer::RGBGenPrimary);
+ } else if (firstword.compare("entitysecond") == 0) {
+ layer->set_rgbgen(Layer::RGBGenSecondary);
+ } else if (firstword.compare("entitythird") == 0) {
+ layer->set_rgbgen(Layer::RGBGenTertiary);
+ } else {
+ con_warn << shaderfile.name() << " unknown rgbgen function '" << firstword << "' at line " << linenumber << std::endl;
+ }
+ } else {
+ con_warn << shaderfile.name() << " missing rgbgen function at line " << linenumber << std::endl;
+ }
} else if (firstword.compare("blendfunc") == 0) {
if (linestream >> firstword) {
aux::to_lowercase(firstword);