mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
add max-texture-stages
This commit is contained in:
parent
a926c201af
commit
c152dfa441
@ -132,6 +132,17 @@ ConfigVariableBool prefer_single_buffer
|
|||||||
"false (since in that case the buffer can share a graphics context "
|
"false (since in that case the buffer can share a graphics context "
|
||||||
"with the window)."));
|
"with the window)."));
|
||||||
|
|
||||||
|
ConfigVariableInt max_texture_stages
|
||||||
|
("max-texture-stages", -1,
|
||||||
|
PRC_DESC("Set this to a positive integer to limit the number of "
|
||||||
|
"texture stages reported by the GSG. This can be used to limit "
|
||||||
|
"the amount of multitexturing Panda will attempt to use. "
|
||||||
|
"If this is zero or less, the GSG will report its honest number "
|
||||||
|
"of texture stages, allowing Panda the full use of the graphics "
|
||||||
|
"card; if it is 1 or more, then Panda will never allow more than "
|
||||||
|
"this number of texture stages simultaneously, regardless of "
|
||||||
|
"what the GSG says it can do."));
|
||||||
|
|
||||||
ConfigVariableBool support_render_texture
|
ConfigVariableBool support_render_texture
|
||||||
("support-render-texture", true,
|
("support-render-texture", true,
|
||||||
PRC_DESC("Set this true allow use of the render-to-a-texture feature, if it "
|
PRC_DESC("Set this true allow use of the render-to-a-texture feature, if it "
|
||||||
|
@ -49,6 +49,7 @@ extern EXPCL_PANDA_DISPLAY ConfigVariableBool prefer_texture_buffer;
|
|||||||
extern EXPCL_PANDA_DISPLAY ConfigVariableBool prefer_parasite_buffer;
|
extern EXPCL_PANDA_DISPLAY ConfigVariableBool prefer_parasite_buffer;
|
||||||
extern EXPCL_PANDA_DISPLAY ConfigVariableBool prefer_single_buffer;
|
extern EXPCL_PANDA_DISPLAY ConfigVariableBool prefer_single_buffer;
|
||||||
|
|
||||||
|
extern EXPCL_PANDA_DISPLAY ConfigVariableInt max_texture_stages;
|
||||||
extern EXPCL_PANDA_DISPLAY ConfigVariableBool support_render_texture;
|
extern EXPCL_PANDA_DISPLAY ConfigVariableBool support_render_texture;
|
||||||
extern EXPCL_PANDA_DISPLAY ConfigVariableBool support_rescale_normal;
|
extern EXPCL_PANDA_DISPLAY ConfigVariableBool support_rescale_normal;
|
||||||
extern EXPCL_PANDA_DISPLAY ConfigVariableBool copy_texture_inverted;
|
extern EXPCL_PANDA_DISPLAY ConfigVariableBool copy_texture_inverted;
|
||||||
|
@ -277,6 +277,9 @@ get_max_vertices_per_primitive() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE int GraphicsStateGuardian::
|
INLINE int GraphicsStateGuardian::
|
||||||
get_max_texture_stages() const {
|
get_max_texture_stages() const {
|
||||||
|
if (max_texture_stages > 0) {
|
||||||
|
return min(_max_texture_stages, (int)max_texture_stages);
|
||||||
|
}
|
||||||
return _max_texture_stages;
|
return _max_texture_stages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2068,7 +2068,8 @@ void GraphicsStateGuardian::
|
|||||||
determine_effective_texture() {
|
determine_effective_texture() {
|
||||||
nassertv(_target._texture != (TextureAttrib *)NULL &&
|
nassertv(_target._texture != (TextureAttrib *)NULL &&
|
||||||
_target._tex_gen != (TexGenAttrib *)NULL);
|
_target._tex_gen != (TexGenAttrib *)NULL);
|
||||||
_effective_texture = _target._texture->filter_to_max(_max_texture_stages);
|
int max_texture_stages = get_max_texture_stages();
|
||||||
|
_effective_texture = _target._texture->filter_to_max(max_texture_stages);
|
||||||
_effective_tex_gen = _target._tex_gen;
|
_effective_tex_gen = _target._tex_gen;
|
||||||
|
|
||||||
if (_has_texture_alpha_scale) {
|
if (_has_texture_alpha_scale) {
|
||||||
@ -2080,7 +2081,7 @@ determine_effective_texture() {
|
|||||||
(stage, TexGenAttrib::M_constant, TexCoord3f(_current_color_scale[3], 0.0f, 0.0f)));
|
(stage, TexGenAttrib::M_constant, TexCoord3f(_current_color_scale[3], 0.0f, 0.0f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
nassertv(_effective_texture->get_num_on_stages() <= _max_texture_stages);
|
nassertv(_effective_texture->get_num_on_stages() <= max_texture_stages);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user