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
FieldsModifier and TypeFieldDescriptionfloatbooleanAdd also color even if texture is presentfloat[]float[]Height scale in internal units.com.badlogic.gdx.math.Vector2float[]protected static final PFMTextureLoader.PFMTextureParameterstatic CubemapComponentfloatfloat[]com.badlogic.gdx.utils.Array<VirtualTextureComponent>booleanbooleanprotected static final OwnTextureLoader.OwnTextureParameterDefault texture parametersprotected static final OwnTextureLoader.OwnTextureParameterDefault texture parametersFields inherited from class gaiasky.scene.record.NamedComponent
name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VirtualTextureComponentconvertToComponent(Map<Object, Object> map) voidcopyFrom(MaterialComponent other) voiddispose()voiddisposeCubemap(com.badlogic.gdx.assets.AssetManager manager, Material mat, int attributeIndex, CubemapComponent cubemap) voiddisposeTexture(com.badlogic.gdx.assets.AssetManager manager, Material material, String name, String nameUnpacked, int attributeIndex, com.badlogic.gdx.graphics.Texture tex) voiddisposeTextures(com.badlogic.gdx.assets.AssetManager manager) Disposes and unloads all currently loaded textures immediatelybooleanbooleanhasSVT()voidinitialize(String name) voidinitialize(String name, com.badlogic.gdx.assets.AssetManager manager) voidinitMaterial(com.badlogic.gdx.assets.AssetManager manager, IntModelInstance instance, float[] diffuseCol, boolean culling) voidinitMaterial(com.badlogic.gdx.assets.AssetManager manager, Material mat, Material ring, float[] diffuseCol, boolean culling) booleanisFinishedLoading(com.badlogic.gdx.assets.AssetManager manager) voidEvent notification call.voidprint(Logger.Log log) voidrandomizeAll(long seed, double bodySize) voidvoidDeprecated.voidsetBiomehueshift(Double hueShift) voidsetBiomelut(String biomeLookupTex) voidsetColorIfTexture(Boolean colorIfTexture) voidsetDiffuse(String diffuse) voidsetDiffuseCubemap(String cubemap) voidsetDiffuseSVT(VirtualTextureComponent virtualTextureComponent) voidsetDiffuseSVT(Map<Object, Object> virtualTexture) voidsetEmissive(double[] emissive) voidsetEmissive(Double emissive) voidsetEmissive(String emissive) voidsetEmissiveColormap(String cubemap) voidsetEmissiveSVT(VirtualTextureComponent virtualTextureComponent) voidsetEmissiveSVT(Map<Object, Object> virtualTexture) voidsetGenerated(boolean generated) voidvoidsetHeightCubemap(String cubemap) voidsetHeightMapTopKm(Double heightMapTopKm) voidsetHeightMapTopM(Double heightMapTopM) voidsetHeightScale(Double heightScale) voidsetHeightScaleKm(Double heightScale) voidsetHeightScaleM(Double heightScale) voidsetHeightSVT(VirtualTextureComponent virtualTextureComponent) voidsetHeightSVT(Map<Object, Object> virtualTexture) voidsetMetallic(Double metallicColor) voidsetMetallic(String metallic) voidsetMetallicCubemap(String cubemap) voidsetMetallicSVT(VirtualTextureComponent virtualTextureComponent) voidsetMetallicSVT(Map<Object, Object> virtualTexture) voidDeprecated.usesetEmissive(String)insteadvoidsetNoise(NoiseComponent noise) voidvoidsetNormalCubemap(String cubemap) voidsetNormalSVT(VirtualTextureComponent virtualTextureComponent) voidsetNormalSVT(Map<Object, Object> virtualTexture) voidsetReflection(double[] metallic) voidsetReflection(Double metallicColor) Deprecated.usesetMetallic(String)insteadvoidsetReflectionCubemap(String reflectionCubemap) voidvoidsetRingnormal(String ringnormal) voidsetRoughness(Double roughness) voidsetRoughness(String roughness) voidsetRoughnessCubemap(String cubemap) voidsetRoughnessSVT(VirtualTextureComponent virtualTextureComponent) voidsetRoughnessSVT(Map<Object, Object> virtualTexture) voidvoidsetSpecular(double[] specular) voidsetSpecular(Double specular) voidsetSpecular(String specular) voidsetSpecularCubemap(String cubemap) voidsetSpecularSVT(VirtualTextureComponent virtualTextureComponent) voidsetSpecularSVT(Map<Object, Object> virtualTexture) toString()voidupdateWith(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:
initializein interfaceIComponent- Overrides:
initializein 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:
getMaterialin 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:IObserverEvent notification call. -
getTexturesString
-
toString
-
copyFrom
-
randomizeAll
public void randomizeAll(long seed, double bodySize) -
print
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
updateWith
- Specified by:
updateWithin interfaceIUpdatable<MaterialComponent>
-
setDiffuse(String)instead