mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
More support for negative glow
This commit is contained in:
parent
6d90cf5b70
commit
c013cddc92
@ -36,6 +36,7 @@ CPT(RenderAttrib) MaterialAttrib::
|
|||||||
make(Material *material) {
|
make(Material *material) {
|
||||||
MaterialAttrib *attrib = new MaterialAttrib;
|
MaterialAttrib *attrib = new MaterialAttrib;
|
||||||
attrib->_material = material;
|
attrib->_material = material;
|
||||||
|
material->set_attrib_lock();
|
||||||
return return_new(attrib);
|
return return_new(attrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +182,6 @@ make_from_bam(const FactoryParams ¶ms) {
|
|||||||
|
|
||||||
parse_params(params, scan, manager);
|
parse_params(params, scan, manager);
|
||||||
attrib->fillin(scan, manager);
|
attrib->fillin(scan, manager);
|
||||||
|
|
||||||
return attrib;
|
return attrib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,13 +755,13 @@ synthesize_shader(const RenderState *rs) {
|
|||||||
text << "\t // Begin model-space light summation\n";
|
text << "\t // Begin model-space light summation\n";
|
||||||
if (_have_emission) {
|
if (_have_emission) {
|
||||||
if (_map_index_glow >= 0) {
|
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 {
|
} else {
|
||||||
text << "\t result = attr_material[2];\n";
|
text << "\t result = attr_material[2];\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (_map_index_glow >= 0) {
|
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 {
|
} else {
|
||||||
text << "\t result = float4(0,0,0,0);\n";
|
text << "\t result = float4(0,0,0,0);\n";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user