Class: Stagecraft::Textures::SamplerState
- Inherits:
-
Data
- Object
- Data
- Stagecraft::Textures::SamplerState
- Defined in:
- lib/stagecraft/textures/sampler_state.rb
Constant Summary collapse
- FILTERS =
%i[nearest linear].freeze
Instance Attribute Summary collapse
-
#compare ⇒ Object
readonly
Returns the value of attribute compare.
-
#lod_max ⇒ Object
readonly
Returns the value of attribute lod_max.
-
#lod_min ⇒ Object
readonly
Returns the value of attribute lod_min.
-
#mag_filter ⇒ Object
readonly
Returns the value of attribute mag_filter.
-
#max_anisotropy ⇒ Object
readonly
Returns the value of attribute max_anisotropy.
-
#min_filter ⇒ Object
readonly
Returns the value of attribute min_filter.
-
#mipmap_filter ⇒ Object
readonly
Returns the value of attribute mipmap_filter.
-
#wrap_u ⇒ Object
readonly
Returns the value of attribute wrap_u.
-
#wrap_v ⇒ Object
readonly
Returns the value of attribute wrap_v.
-
#wrap_w ⇒ Object
readonly
Returns the value of attribute wrap_w.
Instance Method Summary collapse
-
#initialize(wrap_u: :repeat, wrap_v: :repeat, wrap_w: :repeat, mag_filter: :linear, min_filter: :linear, mipmap_filter: :linear, lod_min: 0.0, lod_max: 32.0, compare: nil, max_anisotropy: 1) ⇒ SamplerState
constructor
A new instance of SamplerState.
Constructor Details
#initialize(wrap_u: :repeat, wrap_v: :repeat, wrap_w: :repeat, mag_filter: :linear, min_filter: :linear, mipmap_filter: :linear, lod_min: 0.0, lod_max: 32.0, compare: nil, max_anisotropy: 1) ⇒ SamplerState
Returns a new instance of SamplerState.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 11 def initialize(wrap_u: :repeat, wrap_v: :repeat, wrap_w: :repeat, mag_filter: :linear, min_filter: :linear, mipmap_filter: :linear, lod_min: 0.0, lod_max: 32.0, compare: nil, max_anisotropy: 1) super( wrap_u: normalize_wrap(wrap_u), wrap_v: normalize_wrap(wrap_v), wrap_w: normalize_wrap(wrap_w), mag_filter: mag_filter.to_sym, min_filter: min_filter.to_sym, mipmap_filter: mipmap_filter.to_sym, lod_min: Float(lod_min), lod_max: Float(lod_max), compare: compare&.to_sym, max_anisotropy: Integer(max_anisotropy) ) validate! end |
Instance Attribute Details
#compare ⇒ Object (readonly)
Returns the value of attribute compare
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def compare @compare end |
#lod_max ⇒ Object (readonly)
Returns the value of attribute lod_max
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def lod_max @lod_max end |
#lod_min ⇒ Object (readonly)
Returns the value of attribute lod_min
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def lod_min @lod_min end |
#mag_filter ⇒ Object (readonly)
Returns the value of attribute mag_filter
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def mag_filter @mag_filter end |
#max_anisotropy ⇒ Object (readonly)
Returns the value of attribute max_anisotropy
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def max_anisotropy @max_anisotropy end |
#min_filter ⇒ Object (readonly)
Returns the value of attribute min_filter
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def min_filter @min_filter end |
#mipmap_filter ⇒ Object (readonly)
Returns the value of attribute mipmap_filter
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def mipmap_filter @mipmap_filter end |
#wrap_u ⇒ Object (readonly)
Returns the value of attribute wrap_u
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def wrap_u @wrap_u end |
#wrap_v ⇒ Object (readonly)
Returns the value of attribute wrap_v
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def wrap_v @wrap_v end |
#wrap_w ⇒ Object (readonly)
Returns the value of attribute wrap_w
5 6 7 |
# File 'lib/stagecraft/textures/sampler_state.rb', line 5 def wrap_w @wrap_w end |