Package icyllis.arc3d.engine
Class SamplerDesc
java.lang.Object
icyllis.arc3d.engine.SamplerDesc
- All Implemented Interfaces:
IResourceKey
Represents the filtering and tile modes used to access a texture. It's packed as an
int
value.
- 0-4 bits: mag filter
- 4-8 bits: min filter
- 8-12 bits: mipmap mode
- 12-16 bits: address mode (x direction)
- 16-20 bits: address mode (y direction)
- 20-24 bits: address mode (z direction)
- 24-32 bits: max anisotropy (integer value)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Address modes, or wrap modes.static final int
Address modes, or wrap modes.static final int
Address modes, or wrap modes.static final int
Address modes, or wrap modes.static final SamplerDesc
Default value.static final int
Filters.static final int
Filters.static final int
Mipmap modes.static final int
Mipmap modes.static final int
Mipmap modes.static final SamplerDesc
Nearest value. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
boolean
int
int
int
int
int
int
int
int
hashCode()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Can the resource be held by multiple users at the same time? For example, pipelines, samplers, etc.static SamplerDesc
make
(int filter) Turn the sampler state into an integer for use as a key.static SamplerDesc
make
(int filter, int mipmap) Turn the sampler state into an integer for use as a key.static SamplerDesc
make
(int filter, int mipmap, int address) Turn the sampler state into an integer for use as a key.static SamplerDesc
make
(int magFilter, int minFilter, int mipmapMode, int addressModeX, int addressModeY, int addressModeZ) Turn the sampler state into an integer for use as a key.static SamplerDesc
makeAnisotropy
(int addressModeX, int addressModeY, int addressModeZ, int maxAnisotropy, boolean isMipmapped) Turn the sampler state into an integer for use as a key.Reset mipmap mode toMIPMAP_MODE_NONE
.
-
Field Details
-
FILTER_NEAREST
public static final int FILTER_NEARESTFilters.- See Also:
-
FILTER_LINEAR
public static final int FILTER_LINEARFilters.- See Also:
-
MIPMAP_MODE_NONE
public static final int MIPMAP_MODE_NONEMipmap modes.- See Also:
-
MIPMAP_MODE_NEAREST
public static final int MIPMAP_MODE_NEARESTMipmap modes.- See Also:
-
MIPMAP_MODE_LINEAR
public static final int MIPMAP_MODE_LINEARMipmap modes.- See Also:
-
ADDRESS_MODE_REPEAT
public static final int ADDRESS_MODE_REPEATAddress modes, or wrap modes. Specify behavior of sampling with texture coordinates outside an image.- See Also:
-
ADDRESS_MODE_MIRRORED_REPEAT
public static final int ADDRESS_MODE_MIRRORED_REPEATAddress modes, or wrap modes. Specify behavior of sampling with texture coordinates outside an image.- See Also:
-
ADDRESS_MODE_CLAMP_TO_EDGE
public static final int ADDRESS_MODE_CLAMP_TO_EDGEAddress modes, or wrap modes. Specify behavior of sampling with texture coordinates outside an image.- See Also:
-
ADDRESS_MODE_CLAMP_TO_BORDER
public static final int ADDRESS_MODE_CLAMP_TO_BORDERAddress modes, or wrap modes. Specify behavior of sampling with texture coordinates outside an image.- See Also:
-
NEAREST
Nearest value. mag filter nearest, min filter nearest, mipmap mode none, address mode clamp to edge, max anisotropy 1. -
DEFAULT
Default value. mag filter linear, min filter linear, mipmap mode none, address mode clamp to edge, max anisotropy 1.
-
-
Method Details
-
make
Turn the sampler state into an integer for use as a key.- Parameters:
filter
- the filter for mag and min
-
make
Turn the sampler state into an integer for use as a key.- Parameters:
filter
- the filter for mag and minmipmap
- the mipmap mode
-
make
Turn the sampler state into an integer for use as a key.- Parameters:
filter
- the filter for mag and minmipmap
- the mipmap modeaddress
- the address mode for x, y and z
-
make
@Contract(pure=true) public static SamplerDesc make(int magFilter, int minFilter, int mipmapMode, int addressModeX, int addressModeY, int addressModeZ) Turn the sampler state into an integer for use as a key.- Parameters:
magFilter
- the mag filterminFilter
- the min filtermipmapMode
- the mipmap modeaddressModeX
- the address mode XaddressModeY
- the address mode YaddressModeZ
- the address mode Z
-
makeAnisotropy
@Contract(pure=true) public static SamplerDesc makeAnisotropy(int addressModeX, int addressModeY, int addressModeZ, int maxAnisotropy, boolean isMipmapped) Turn the sampler state into an integer for use as a key.We require 'isMipmapped' for APIs that allow MIP filtering to be specified orthogonally to anisotropy.
- Parameters:
addressModeX
- the address mode XaddressModeY
- the address mode YaddressModeZ
- the address mode ZmaxAnisotropy
- the max anisotropy filtering level
-
getMagFilter
@Contract(pure=true) public int getMagFilter() -
getMinFilter
@Contract(pure=true) public int getMinFilter() -
getMipmapMode
@Contract(pure=true) public int getMipmapMode() -
getAddressModeX
@Contract(pure=true) public int getAddressModeX() -
getAddressModeY
@Contract(pure=true) public int getAddressModeY() -
getAddressModeZ
@Contract(pure=true) public int getAddressModeZ() -
isMipmapped
@Contract(pure=true) public boolean isMipmapped() -
isRepeatedX
@Contract(pure=true) public boolean isRepeatedX() -
isRepeatedY
@Contract(pure=true) public boolean isRepeatedY() -
isRepeatedZ
@Contract(pure=true) public boolean isRepeatedZ() -
isRepeated
@Contract(pure=true) public boolean isRepeated() -
getMaxAnisotropy
@Contract(pure=true) public int getMaxAnisotropy() -
isAnisotropy
@Contract(pure=true) public boolean isAnisotropy() -
resetMipmapMode
Reset mipmap mode toMIPMAP_MODE_NONE
. Return value is a valid sampler state. -
copy
- Specified by:
copy
in interfaceIResourceKey
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceIResourceKey
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceIResourceKey
- Overrides:
equals
in classObject
-