More support for negative glow

This commit is contained in:
Josh Yelon 2008-04-30 22:23:14 +00:00
parent 6d90cf5b70
commit c013cddc92
2 changed files with 3 additions and 3 deletions

View File

@ -36,6 +36,7 @@ CPT(RenderAttrib) MaterialAttrib::
make(Material *material) {
MaterialAttrib *attrib = new MaterialAttrib;
attrib->_material = material;
material->set_attrib_lock();
return return_new(attrib);
}
@ -181,7 +182,6 @@ make_from_bam(const FactoryParams &params) {
parse_params(params, scan, manager);
attrib->fillin(scan, manager);
return attrib;
}

View File

@ -755,13 +755,13 @@ synthesize_shader(const RenderState *rs) {
text << "\t // Begin model-space light summation\n";
if (_have_emission) {
if (_map_index_glow >= 0) {
text << "\t result = attr_material[2] * tex" << _map_index_glow << ".a;\n";
text << "\t result = attr_material[2] * saturate(2 * (tex" << _map_index_glow << ".a - 0.5));\n";
} else {
text << "\t result = attr_material[2];\n";
}
} else {
if (_map_index_glow >= 0) {
text << "\t result = tex" << _map_index_glow << ".aaaa;\n";
text << "\t result = saturate(2 * (tex" << _map_index_glow << ".a - 0.5));\n";
} else {
text << "\t result = float4(0,0,0,0);\n";
}