50 FT_nearest_mipmap_nearest,
53 FT_linear_mipmap_nearest,
56 FT_nearest_mipmap_linear,
60 FT_linear_mipmap_linear,
127 INLINE
static bool is_mipmap(FilterType type);
135 INLINE
bool operator == (
const SamplerState &other)
const;
136 INLINE
bool operator != (
const SamplerState &other)
const;
137 INLINE
bool operator < (
const SamplerState &other)
const;
149 void output(std::ostream &out)
const;
150 void write(std::ostream &out,
int indent)
const;
153 LColor _border_color;
154 PN_stdfloat _min_lod;
155 PN_stdfloat _max_lod;
156 PN_stdfloat _lod_bias;
161 FilterType _minfilter : 4;
162 FilterType _magfilter : 4;
163 WrapMode _wrap_u : 4;
164 WrapMode _wrap_v : 4;
165 WrapMode _wrap_w : 4;
166 int _anisotropic_degree : 12;
178 static void init_type() {
181 TypedObject::get_class_type());
190 static TypeHandle _type_handle;
197INLINE std::ostream &operator << (std::ostream &out,
const SamplerState &m) {
202INLINE std::ostream &operator << (std::ostream &out, SamplerState::FilterType ft) {
206INLINE std::istream &operator >> (std::istream &in, SamplerState::FilterType &ft) {
213INLINE std::ostream &operator << (std::ostream &out, SamplerState::WrapMode wm) {
217INLINE std::istream &operator >> (std::istream &in, SamplerState::WrapMode &wm) {
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This class specializes ConfigVariable as an enumerated type.
This is a convenience class to specialize ConfigVariable as an integer type.
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A table of objects that are saved within the graphics context for reference by handle later.
This is a special class object that holds a handle to the sampler state object given by the graphics ...
Represents a set of settings that indicate how a texture is sampled.
get_max_lod
Returns the maximum level of detail that will be observed when sampling this texture.
static bool is_mipmap(FilterType type)
Returns true if the indicated filter type requires the use of mipmaps, or false if it does not.
set_wrap_v
This setting determines what happens when the SamplerState is sampled with a V value outside the rang...
set_max_lod
Sets the maximum level of detail that will be used when sampling this texture.
void prepare(PreparedGraphicsObjects *prepared_objects) const
Indicates that the sampler should be enqueued to be prepared in the indicated prepared_objects at the...
static const SamplerState & get_default()
Returns a reference to the global default immutable SamplerState object.
get_minfilter
Returns the filter mode of the texture for minification.
static FilterType string_filter_type(const std::string &str)
Returns the FilterType value associated with the given string representation, or FT_invalid if the st...
get_wrap_v
Returns the wrap mode of the texture in the V direction.
set_anisotropic_degree
Specifies the level of anisotropic filtering to apply to the SamplerState.
void write_datagram(Datagram &destination) const
Encodes the sampler state into a datagram.
set_border_color
Specifies the solid color of the SamplerState's border.
get_anisotropic_degree
Returns the degree of anisotropic filtering that should be applied to the texture.
set_wrap_w
The W wrap direction is only used for 3-d SamplerStates.
void release(PreparedGraphicsObjects *prepared_objects) const
Frees the texture context only on the indicated object, if it exists there.
get_magfilter
Returns the filter mode of the texture for magnification.
get_wrap_w
Returns the wrap mode of the texture in the W direction.
void read_datagram(DatagramIterator &source, BamReader *manager)
Reads the sampler state from the datagram that has been previously written using write_datagram.
set_min_lod
Sets the minimum level of detail that will be used when sampling this texture.
set_minfilter
Sets the filtering method that should be used when viewing the SamplerState from a distance.
set_wrap_u
This setting determines what happens when the SamplerState is sampled with a U value outside the rang...
SamplerState()
Creates a new SamplerState initialized to the default values.
bool uses_mipmaps() const
Returns true if the minfilter settings on this sampler indicate the use of mipmapping,...
get_effective_magfilter
Returns the filter mode of the texture for magnification, with special treatment for FT_default.
get_lod_bias
Returns the bias that will be added to the texture level of detail when sampling this texture.
set_magfilter
Sets the filtering method that should be used when viewing the SamplerState up close.
static std::string format_filter_type(FilterType ft)
Returns the indicated FilterType converted to a string word.
get_min_lod
Returns the minimum level of detail that will be observed when sampling this texture.
SamplerContext * prepare_now(PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg) const
Creates a context for the sampler on the particular GSG, if it does not already exist.
int compare_to(const SamplerState &other) const
Returns a number less than zero if this sampler sorts before the other one, greater than zero if it s...
get_effective_minfilter
Returns the filter mode of the texture for minification, with special treatment for FT_default.
static WrapMode string_wrap_mode(const std::string &str)
Returns the WrapMode value associated with the given string representation, or WM_invalid if the stri...
get_effective_anisotropic_degree
Returns the degree of anisotropic filtering that should be applied to the texture.
get_wrap_u
Returns the wrap mode of the texture in the U direction.
set_lod_bias
Sets the value that will be added to the level of detail when sampling the texture.
bool is_prepared(PreparedGraphicsObjects *prepared_objects) const
Returns true if the sampler has already been prepared or enqueued for preparation on the indicated GS...
static std::string format_wrap_mode(WrapMode wm)
Returns the indicated WrapMode converted to a string word.
get_border_color
Returns the solid color of the texture's border.
TypeHandle is the identifier used to differentiate C++ class types.
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.