Package gaiasky.scene.record
Class MaterialComponent
java.lang.Object
gaiasky.scene.record.NamedComponent
gaiasky.scene.record.MaterialComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IObserver
,IUpdatable<MaterialComponent>
,IComponent
,IMaterialProvider
public class MaterialComponent
extends NamedComponent
implements IObserver, IMaterialProvider, IUpdatable<MaterialComponent>
A basic component that fully describes the material of an object.
It contains basic textures (diffuse, specular, reflection, emissive, etc.),
cubemaps (same as textures), and even some sparse virtual texture trees (SVT).
-
Field Summary
Modifier and TypeFieldDescriptionfloat
boolean
Add also color even if texture is presentfloat[]
float[]
Height scale in internal units.com.badlogic.gdx.math.Vector2
float[]
protected static final PFMTextureLoader.PFMTextureParameter
static CubemapComponent
float
float[]
com.badlogic.gdx.utils.Array<VirtualTextureComponent>
boolean
boolean
protected static final OwnTextureLoader.OwnTextureParameter
Default texture parametersprotected static final OwnTextureLoader.OwnTextureParameter
Default texture parametersFields inherited from class gaiasky.scene.record.NamedComponent
name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic VirtualTextureComponent
convertToComponent
(Map<Object, Object> map) void
copyFrom
(MaterialComponent other) void
dispose()
void
disposeCubemap
(com.badlogic.gdx.assets.AssetManager manager, Material mat, int attributeIndex, CubemapComponent cubemap) void
disposeTexture
(com.badlogic.gdx.assets.AssetManager manager, Material material, String name, String nameUnpacked, int attributeIndex, com.badlogic.gdx.graphics.Texture tex) void
disposeTextures
(com.badlogic.gdx.assets.AssetManager manager) Disposes and unloads all currently loaded textures immediatelyboolean
boolean
hasSVT()
void
initialize
(String name) void
initialize
(String name, com.badlogic.gdx.assets.AssetManager manager) void
initMaterial
(com.badlogic.gdx.assets.AssetManager manager, IntModelInstance instance, float[] diffuseCol, boolean culling) void
initMaterial
(com.badlogic.gdx.assets.AssetManager manager, Material mat, Material ring, float[] diffuseCol, boolean culling) boolean
isFinishedLoading
(com.badlogic.gdx.assets.AssetManager manager) void
Event notification call.void
print
(Logger.Log log) void
randomizeAll
(long seed, double bodySize) void
void
Deprecated.void
setBiomehueshift
(Double hueShift) void
setBiomelut
(String biomeLookupTex) void
setColorIfTexture
(Boolean colorIfTexture) void
setDiffuse
(String diffuse) void
setDiffuseCubemap
(String cubemap) void
setDiffuseSVT
(VirtualTextureComponent virtualTextureComponent) void
setDiffuseSVT
(Map<Object, Object> virtualTexture) void
setEmissive
(double[] emissive) void
setEmissive
(Double emissive) void
setEmissive
(String emissive) void
setEmissiveColormap
(String cubemap) void
setEmissiveSVT
(VirtualTextureComponent virtualTextureComponent) void
setEmissiveSVT
(Map<Object, Object> virtualTexture) void
setGenerated
(boolean generated) void
void
setHeightCubemap
(String cubemap) void
setHeightMapTopKm
(Double heightMapTopKm) void
setHeightMapTopM
(Double heightMapTopM) void
setHeightScale
(Double heightScale) void
setHeightScaleKm
(Double heightScale) void
setHeightScaleM
(Double heightScale) void
setHeightSVT
(VirtualTextureComponent virtualTextureComponent) void
setHeightSVT
(Map<Object, Object> virtualTexture) void
setMetallic
(Double metallicColor) void
setMetallic
(String metallic) void
setMetallicCubemap
(String cubemap) void
setMetallicSVT
(VirtualTextureComponent virtualTextureComponent) void
setMetallicSVT
(Map<Object, Object> virtualTexture) void
Deprecated.usesetEmissive(String)
insteadvoid
setNoise
(NoiseComponent noise) void
void
setNormalCubemap
(String cubemap) void
setNormalSVT
(VirtualTextureComponent virtualTextureComponent) void
setNormalSVT
(Map<Object, Object> virtualTexture) void
setReflection
(double[] metallic) void
setReflection
(Double metallicColor) Deprecated.usesetMetallic(String)
insteadvoid
setReflectionCubemap
(String reflectionCubemap) void
void
setRingnormal
(String ringnormal) void
setRoughness
(Double roughness) void
setRoughness
(String roughness) void
setRoughnessCubemap
(String cubemap) void
setRoughnessSVT
(VirtualTextureComponent virtualTextureComponent) void
setRoughnessSVT
(Map<Object, Object> virtualTexture) void
void
setSpecular
(double[] specular) void
setSpecular
(Double specular) void
setSpecular
(String specular) void
setSpecularCubemap
(String cubemap) void
setSpecularSVT
(VirtualTextureComponent virtualTextureComponent) void
setSpecularSVT
(Map<Object, Object> virtualTexture) toString()
void
updateWith
(MaterialComponent object) Methods inherited from class gaiasky.scene.record.NamedComponent
createModelParameters, gaussian, gaussian, gaussian
-
Field Details
-
textureParamsMipMap
Default texture parameters -
textureParams
Default texture parameters -
pfmTextureParams
-
reflectionCubemap
-
texInitialised
public boolean texInitialised -
texLoading
public boolean texLoading -
diffuse
-
specular
-
normal
-
emissive
-
ring
-
height
-
ringnormal
-
roughness
-
metallic
-
ao
-
diffuseUnpacked
-
specularUnpacked
-
normalUnpacked
-
emissiveUnpacked
-
ringUnpacked
-
heightUnpacked
-
ringnormalUnpacked
-
roughnessUnapcked
-
metallicUnpacked
-
aoUnapcked
-
diffuseColor
public float[] diffuseColor -
specularColor
public float[] specularColor -
metallicColor
public float[] metallicColor -
emissiveColor
public float[] emissiveColor -
roughnessColor
public float roughnessColor -
heightScale
Height scale in internal units. The mapping value of white in the height map (maximum height value in this body). Black is mapped to 0. -
heightSize
public com.badlogic.gdx.math.Vector2 heightSize -
heightData
-
nc
-
diffuseSvt
-
specularSvt
-
heightSvt
-
normalSvt
-
emissiveSvt
-
roughnessSvt
-
metallicSvt
-
svts
-
diffuseCubemap
-
specularCubemap
-
normalCubemap
-
emissiveCubemap
-
heightCubemap
-
roughnessCubemap
-
metallicCubemap
-
biomeLUT
-
biomeHueShift
public float biomeHueShift -
colorIfTexture
public boolean colorIfTextureAdd also color even if texture is present
-
-
Constructor Details
-
MaterialComponent
public MaterialComponent()
-
-
Method Details
-
initialize
-
initialize
- Specified by:
initialize
in interfaceIComponent
- Overrides:
initialize
in classNamedComponent
-
isFinishedLoading
public boolean isFinishedLoading(com.badlogic.gdx.assets.AssetManager manager) -
hasSVT
public boolean hasSVT() -
initMaterial
public void initMaterial(com.badlogic.gdx.assets.AssetManager manager, IntModelInstance instance, float[] diffuseCol, boolean culling) -
initMaterial
-
setGenerated
public void setGenerated(boolean generated) -
getMaterial
- Specified by:
getMaterial
in interfaceIMaterialProvider
-
getRingMaterial
-
setBase
Deprecated.usesetDiffuse(String)
instead -
setDiffuse
-
setSpecular
-
setSpecular
-
setSpecular
public void setSpecular(double[] specular) -
setNormal
-
setNight
Deprecated.usesetEmissive(String)
instead -
setEmissive
-
setEmissive
-
setEmissive
public void setEmissive(double[] emissive) -
setRing
-
setRingnormal
-
setHeight
-
setHeightScaleKm
-
setHeightScaleM
-
setHeightScale
-
setHeightMapTopKm
-
setHeightMapTopM
-
setColorIfTexture
-
setNoise
-
setBiomelut
-
setBiomehueshift
-
setReflection
Deprecated.usesetMetallic(String)
instead -
setMetallic
-
setMetallic
-
setReflection
public void setReflection(double[] metallic) -
setRoughness
-
setRoughness
-
setAo
-
setDiffuseCubemap
-
setNormalCubemap
-
setSpecularCubemap
-
setEmissiveColormap
-
setHeightCubemap
-
setMetallicCubemap
-
setRoughnessCubemap
-
setReflectionCubemap
-
setSkybox
-
setDiffuseSVT
-
setDiffuseSVT
-
setSpecularSVT
-
setSpecularSVT
-
setNormalSVT
-
setNormalSVT
-
setHeightSVT
-
setHeightSVT
-
setEmissiveSVT
-
setEmissiveSVT
-
setMetallicSVT
-
setMetallicSVT
-
setRoughnessSVT
-
setRoughnessSVT
-
convertToComponent
-
hasHeight
public boolean hasHeight() -
disposeTexture
-
disposeCubemap
public void disposeCubemap(com.badlogic.gdx.assets.AssetManager manager, Material mat, int attributeIndex, CubemapComponent cubemap) -
disposeTextures
public void disposeTextures(com.badlogic.gdx.assets.AssetManager manager) Disposes and unloads all currently loaded textures immediately- Parameters:
manager
- The asset manager
-
notify
Description copied from interface:IObserver
Event notification call. -
getTexturesString
-
toString
-
copyFrom
-
randomizeAll
public void randomizeAll(long seed, double bodySize) -
print
-
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
-
updateWith
- Specified by:
updateWith
in interfaceIUpdatable<MaterialComponent>
-
setDiffuse(String)
instead