mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
Add normal_gloss texture mode (requested by wezu)
This commit is contained in:
parent
3bb89ff4eb
commit
949395a4cc
@ -16,6 +16,7 @@ it is likely to contain bugs.
|
||||
* Ambient occlusion generation for terrain
|
||||
* Fixed bug where Windows installer wipes %PATH% when it's too long
|
||||
* Added fog support to the shader generator
|
||||
* Added normal_gloss texture mode
|
||||
* Added a custom color option to the cartoon filter
|
||||
* Support for texture arrays in shaders
|
||||
* Better shader support in pandadx9
|
||||
|
@ -774,7 +774,8 @@ recompute_tangent_binormal_auto() {
|
||||
for (eti = texs.begin(); eti != texs.end(); eti++) {
|
||||
EggTexture *eggtex = (*eti);
|
||||
if ((eggtex->get_env_type() == EggTexture::ET_normal)||
|
||||
(eggtex->get_env_type() == EggTexture::ET_normal_height)) {
|
||||
(eggtex->get_env_type() == EggTexture::ET_normal_height)||
|
||||
(eggtex->get_env_type() == EggTexture::ET_normal_gloss)) {
|
||||
string uv = eggtex->get_uv_name();
|
||||
vector_string::iterator it = find(names.begin(), names.end(), uv);
|
||||
if (it == names.end()) {
|
||||
|
@ -585,6 +585,7 @@ affects_polygon_alpha() const {
|
||||
case ET_glow:
|
||||
case ET_gloss:
|
||||
case ET_height:
|
||||
case ET_normal_gloss:
|
||||
return false;
|
||||
|
||||
case ET_selector:
|
||||
@ -925,6 +926,9 @@ string_env_type(const string &string) {
|
||||
} else if (cmp_nocase_uh(string, "selector") == 0) {
|
||||
return ET_selector;
|
||||
|
||||
} else if (cmp_nocase_uh(string, "normal_gloss") == 0) {
|
||||
return ET_normal_gloss;
|
||||
|
||||
} else {
|
||||
return ET_unspecified;
|
||||
}
|
||||
@ -1376,6 +1380,9 @@ ostream &operator << (ostream &out, EggTexture::EnvType type) {
|
||||
|
||||
case EggTexture::ET_selector:
|
||||
return out << "selector";
|
||||
|
||||
case EggTexture::ET_normal_gloss:
|
||||
return out << "normal_gloss";
|
||||
}
|
||||
|
||||
nassertr(false, out);
|
||||
|
@ -106,6 +106,7 @@ PUBLISHED:
|
||||
ET_gloss,
|
||||
ET_height,
|
||||
ET_selector,
|
||||
ET_normal_gloss,
|
||||
};
|
||||
enum CombineMode {
|
||||
CM_unspecified,
|
||||
|
@ -1506,6 +1506,10 @@ make_texture_stage(const EggTexture *egg_tex) {
|
||||
stage->set_mode(TextureStage::M_selector);
|
||||
break;
|
||||
|
||||
case EggTexture::ET_normal_gloss:
|
||||
stage->set_mode(TextureStage::M_normal_gloss);
|
||||
break;
|
||||
|
||||
case EggTexture::ET_unspecified:
|
||||
break;
|
||||
}
|
||||
|
@ -542,6 +542,9 @@ operator << (ostream &out, TextureStage::Mode mode) {
|
||||
|
||||
case TextureStage::M_selector:
|
||||
return out << "selector";
|
||||
|
||||
case TextureStage::M_normal_gloss:
|
||||
return out << "normal_gloss";
|
||||
}
|
||||
|
||||
return out << "**invalid Mode(" << (int)mode << ")**";
|
||||
|
@ -65,6 +65,7 @@ PUBLISHED:
|
||||
M_gloss, // Rarely used: modulate_gloss is more efficient.
|
||||
M_height, // Rarely used: normal_height is more efficient.
|
||||
M_selector,
|
||||
M_normal_gloss,
|
||||
};
|
||||
|
||||
enum CombineMode {
|
||||
|
@ -766,6 +766,7 @@ make_texture_layer(const NodePath &render,
|
||||
case TextureStage::M_gloss:
|
||||
case TextureStage::M_height:
|
||||
case TextureStage::M_selector:
|
||||
case TextureStage::M_normal_gloss:
|
||||
// Don't know what to do with these funny modes. We should
|
||||
// probably raise an exception or something. Fall through for
|
||||
// now.
|
||||
|
@ -290,7 +290,9 @@ analyze_renderstate(const RenderState *rs) {
|
||||
for (int i=0; i<_num_textures; i++) {
|
||||
TextureStage *stage = texture->get_on_stage(i);
|
||||
TextureStage::Mode mode = stage->get_mode();
|
||||
if ((mode == TextureStage::M_normal)||(mode == TextureStage::M_normal_height)) {
|
||||
if ((mode == TextureStage::M_normal)||
|
||||
(mode == TextureStage::M_normal_height)||
|
||||
(mode == TextureStage::M_normal_gloss)) {
|
||||
_map_index_normal = i;
|
||||
}
|
||||
if ((mode == TextureStage::M_height)||(mode == TextureStage::M_normal_height)) {
|
||||
@ -299,7 +301,9 @@ analyze_renderstate(const RenderState *rs) {
|
||||
if ((mode == TextureStage::M_glow)||(mode == TextureStage::M_modulate_glow)) {
|
||||
_map_index_glow = i;
|
||||
}
|
||||
if ((mode == TextureStage::M_gloss)||(mode == TextureStage::M_modulate_gloss)) {
|
||||
if ((mode == TextureStage::M_gloss)||
|
||||
(mode == TextureStage::M_modulate_gloss)||
|
||||
(mode == TextureStage::M_normal_gloss)) {
|
||||
_map_index_gloss = i;
|
||||
}
|
||||
if (mode == TextureStage::M_height) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user