Package org.sunflow.core
Class Texture
java.lang.Object
org.sunflow.core.Texture
Represents a 2D texture, typically used by
shaders
.-
Method Summary
Modifier and TypeMethodDescriptiongetBump
(float x, float y, OrthoNormalBasis basis, float scale) getNormal
(float x, float y, OrthoNormalBasis basis) getOpacity
(float x, float y) float
getOpacityAlpha
(float x, float y) getPixel
(float x, float y) Gets the color at location (x,y) in the texture.boolean
-
Method Details
-
getBitmap
-
getPixel
Gets the color at location (x,y) in the texture. The lookup is performed using the fractional component of the coordinates, treating the texture as a unit square tiled in both directions. Bicubic filtering is performed on the four nearest pixels to the lookup point.- Parameters:
x
- x coordinate into the texturey
- y coordinate into the texture- Returns:
- filtered color at location (x,y)
-
getOpacity
-
getOpacityAlpha
public float getOpacityAlpha(float x, float y) -
isTransparent
public boolean isTransparent() -
getNormal
-
getBump
-