mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
gsg::set_texture_quality_override
This commit is contained in:
parent
bed33fb763
commit
fd1a56e232
@ -661,6 +661,38 @@ get_coordinate_system() const {
|
||||
return _coordinate_system;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::set_texture_quality_override
|
||||
// Access: Published
|
||||
// Description: Specifies the global quality_level to be imposed for
|
||||
// all Textures rendered by this GSG. This overrides
|
||||
// the value set on individual textures via
|
||||
// Texture::set_quality_level(). Set this to
|
||||
// Texture::QL_default in order to allow the individual
|
||||
// texture quality levels to be respected.
|
||||
//
|
||||
// This is mainly useful for the tinydisplay software
|
||||
// renderer. See Texture::set_quality_level().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void GraphicsStateGuardian::
|
||||
set_texture_quality_override(Texture::QualityLevel quality_level) {
|
||||
_texture_quality_override = quality_level;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::get_texture_quality_override
|
||||
// Access: Published
|
||||
// Description: Returns the global quality_level override specified
|
||||
// by set_texture_quality_override.
|
||||
//
|
||||
// This is mainly useful for the tinydisplay software
|
||||
// renderer. See Texture::set_quality_level().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Texture::QualityLevel GraphicsStateGuardian::
|
||||
get_texture_quality_override() const {
|
||||
return _texture_quality_override;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::reset_if_new
|
||||
// Access: Public
|
||||
|
@ -215,6 +215,7 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system,
|
||||
_shader_model = SM_00;
|
||||
|
||||
_gamma = 1.0f;
|
||||
_texture_quality_override = Texture::QL_default;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -158,6 +158,9 @@ PUBLISHED:
|
||||
virtual bool set_gamma(float gamma);
|
||||
float get_gamma(float gamma);
|
||||
virtual void restore_gamma();
|
||||
|
||||
INLINE void set_texture_quality_override(Texture::QualityLevel quality_level);
|
||||
INLINE Texture::QualityLevel get_texture_quality_override() const;
|
||||
|
||||
public:
|
||||
bool set_scene(SceneSetup *scene_setup);
|
||||
@ -418,6 +421,7 @@ protected:
|
||||
Shader::ShaderCaps _shader_caps;
|
||||
|
||||
float _gamma;
|
||||
Texture::QualityLevel _texture_quality_override;
|
||||
|
||||
public:
|
||||
// Statistics
|
||||
|
@ -1633,9 +1633,12 @@ do_issue_texture() {
|
||||
_texturing_state = 1; // textured (not perspective correct)
|
||||
}
|
||||
|
||||
Texture::QualityLevel quality_level = texture->get_quality_level();
|
||||
Texture::QualityLevel quality_level = _texture_quality_override;
|
||||
if (quality_level == Texture::QL_default) {
|
||||
quality_level = texture_quality_level;
|
||||
quality_level = texture->get_quality_level();
|
||||
if (quality_level == Texture::QL_default) {
|
||||
quality_level = texture_quality_level;
|
||||
}
|
||||
}
|
||||
|
||||
if (quality_level == Texture::QL_best) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user