Class BaseShaderPacksContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceInCampaign(com.fs.starfarer.api.campaign.SectorAPI sector, float amount) voidadvanceInCombat(com.fs.starfarer.api.combat.CombatEngineAPI engine, float amount) voidapplyAAPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap) voidapplyAfterIlluminationPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap, int auxFBO, int auxEmissive) voidapplyAreaLightShading(AreaLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) booleanvoidapplyBeforeIlluminationPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap, int auxFBO, int auxEmissive) booleanbooleanvoidapplyBeforeLowestLayerRender(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap, int auxFBO, int auxEmissive) booleanbooleanvoidapplyBloomPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, boolean isMultiPassBloom, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap, int auxFBO, int auxEmissive) voidapplyCombatUIPass(com.fs.starfarer.api.combat.ViewportAPI viewport) voidapplyInfiniteLightShading(InfiniteLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) voidapplyLinearLightShading(LinearLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) voidapplyPointLightShading(PointLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) voidapplyPostEffectPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign) voidapplySpotLightShading(SpotLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) byte[]applyTexturedAreaLightPreFiltering(int src, int preFiltering, boolean shouldAllocate) voidcleanupCampaign(boolean isSwitchToTitle) Will call if the LocationAPI of player fleet has changed, or join battle.voidCall in campaign, just for OpenGL resource cleanup.voidconfigLoad(org.json.JSONObject data) Atsaves/common/shaderpacks, file name is shader packs id.voidconfigSave(org.json.JSONObject data) Atsaves/common/shaderpacks, file name is shader packs id.voidvoidcreateDetailsPanel(com.fs.starfarer.api.ui.TooltipMakerAPI tooltip, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) With description and config option.voiddestroy()Will call it after switching and applied config to other shader packs, orinit()return false.booleandetailsPanelAdvance(float amount, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) booleandetailsPanelButtonPressed(Object buttonId, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) booleandetailsPanelProcessInput(List<com.fs.starfarer.api.input.InputEventAPI> events, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) voiddetailsPanelRender(float alpha, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) voiddetailsPanelRenderBelow(float alpha, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) final booleanintRecommended size: 256*128getID()final inthashCode()booleanForBaseIlluminantDatathat have custom instance data layout on this shader packs.booleaninit()Will call it after switching and applied config to this shader packs.voidinitCampaign(com.fs.starfarer.api.campaign.SectorAPI sector, boolean isCombatEnd, boolean init) Will call if the LocationAPI of player fleet has changed.voidinitCombat(com.fs.starfarer.api.combat.CombatEngineAPI engine) booleanTechnical hint.booleanTechnical hint.booleanTechnical hint.booleanTechnical hint.booleanTechnical hint.booleanTechnical hint.booleanTechnical hint.booleanisUsable(org.lwjgl.opengl.ContextCapabilities glContext) To tell players if this shader pack is usable in current hardware.final StringtoString()
-
Constructor Details
-
BaseShaderPacksContext
public BaseShaderPacksContext()
-
-
Method Details
-
configLoad
public void configLoad(@Nullable org.json.JSONObject data) Atsaves/common/shaderpacks, file name is shader packs id.- Parameters:
data- just load the values,nullfor load falied.Also call
configSave(JSONObject)before ifnull.
-
configSetDefault
public void configSetDefault() -
configSave
public void configSave(org.json.JSONObject data) throws org.json.JSONException Atsaves/common/shaderpacks, file name is shader packs id.- Parameters:
data- just set the values.- Throws:
org.json.JSONException
-
init
public boolean init()Will call it after switching and applied config to this shader packs.- Returns:
- false when initialization fails.
-
destroy
public void destroy()Will call it after switching and applied config to other shader packs, orinit()return false. -
applyTexturedAreaLightPreFiltering
public byte[] applyTexturedAreaLightPreFiltering(int src, int preFiltering, boolean shouldAllocate) - Parameters:
preFiltering- for implements, not required to delete it when failed.shouldAllocate- should re-allocate memory for pre-filtering texture when true.- Returns:
- byte[] result = {state, maxLevel};
state returns
BoxEnum.STATE_SUCCESSwhen success.return
BoxEnum.STATE_FAILEDwhen implements code(compute shader etc.) not supported.
-
initCampaign
public void initCampaign(com.fs.starfarer.api.campaign.SectorAPI sector, boolean isCombatEnd, boolean init) Will call if the LocationAPI of player fleet has changed.Also call after in-campaign quick load.
After
cleanupCampaign(boolean). -
initCombat
public void initCombat(com.fs.starfarer.api.combat.CombatEngineAPI engine) -
applyBeforeLowestLayerRender
public void applyBeforeLowestLayerRender(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap, int auxFBO, int auxEmissive) -
applyBeforeIlluminationPass
public void applyBeforeIlluminationPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap, int auxFBO, int auxEmissive) -
applyBeforeInfiniteLightShading
public boolean applyBeforeInfiniteLightShading()- Returns:
- ignore shading if false.
-
applyInfiniteLightShading
public void applyInfiniteLightShading(InfiniteLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) -
applyBeforePointLightShading
public boolean applyBeforePointLightShading()- Returns:
- ignore shading if false.
-
applyPointLightShading
public void applyPointLightShading(PointLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) -
applyBeforeSpotLightShading
public boolean applyBeforeSpotLightShading()- Returns:
- ignore shading if false.
-
applySpotLightShading
public void applySpotLightShading(SpotLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) -
applyBeforeLinearLightShading
public boolean applyBeforeLinearLightShading()- Returns:
- ignore shading if false.
-
applyLinearLightShading
public void applyLinearLightShading(LinearLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) -
applyBeforeAreaLightShading
public boolean applyBeforeAreaLightShading()- Returns:
- ignore shading if false.
-
applyAreaLightShading
public void applyAreaLightShading(AreaLight entity, boolean validInstanceData, boolean notDefaultInstanceDataType) -
applyAfterIlluminationPass
public void applyAfterIlluminationPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap, int auxFBO, int auxEmissive) -
applyAAPass
public void applyAAPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap) -
applyBloomPass
public void applyBloomPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign, boolean isMultiPassBloom, int fbo, int colorMap, int emissiveMap, int worldPosMap, int worldNormalMap, int worldTangentMap, int worldMaterialMap, int worldDataMap, int auxFBO, int auxEmissive) - Parameters:
isMultiPassBloom- if ture, draw to black screen.
-
applyPostEffectPass
public void applyPostEffectPass(com.fs.starfarer.api.combat.ViewportAPI viewport, boolean isCampaign) -
applyCombatUIPass
public void applyCombatUIPass(com.fs.starfarer.api.combat.ViewportAPI viewport) -
advanceInCombat
public void advanceInCombat(com.fs.starfarer.api.combat.CombatEngineAPI engine, float amount) -
cleanupCombat
public void cleanupCombat()Call in campaign, just for OpenGL resource cleanup. -
advanceInCampaign
public void advanceInCampaign(com.fs.starfarer.api.campaign.SectorAPI sector, float amount) -
cleanupCampaign
public void cleanupCampaign(boolean isSwitchToTitle) Will call if the LocationAPI of player fleet has changed, or join battle.Also call after in-campaign quick load.
-
getID
-
getDisplayName
-
getDisplayVersion
- Returns:
- returns
nullfor hidden.
-
getIconTextureID
public int getIconTextureID()Recommended size: 256*128- Returns:
- returns less than
0for none icon, equals for default icon.
-
getIconTextureColor
- Returns:
nullfor white, the raw texture.
-
isCombatIlluminationSupported
public boolean isCombatIlluminationSupported()Technical hint.Combat shading (or with shadowing), without VFX.
-
isCampaignIlluminationSupported
public boolean isCampaignIlluminationSupported()Technical hint.Campaign shading (or with shadowing), without VFX.
-
isBloomSupported
public boolean isBloomSupported()Technical hint. -
isAASupported
public boolean isAASupported()Technical hint. -
isBaseAnisotropySupported
public boolean isBaseAnisotropySupported()Technical hint.The anisotropy shading is only supports for infinite-light / point-light / spot-light, without area-light.
-
isTexturedAreaLightSupported
public boolean isTexturedAreaLightSupported()Technical hint. -
isCompleteAnisotropySupported
public boolean isCompleteAnisotropySupported()Technical hint.For real-time line/area lighting(based LTC, the Linearly-Transformed-Cosines), its high performance cost, difficult and complicated to implement it.
A compromised and easy way is only implements the anisotropic lighting for except area light(InfiniteLight, PointLight, SpotLight).
-
haveCustomInstanceDataLayout
public boolean haveCustomInstanceDataLayout()ForBaseIlluminantDatathat have custom instance data layout on this shader packs.- Returns:
- ture if the shader packs use specific instance data layout, like custom SSBOs, custom UBOs, custom TBOs, custom VBOs, storage to any texture object or any other.
-
getCustomInstanceDataLayout
- Returns:
- NOT
nullwhenhaveCustomInstanceDataLayout()returns true, and should implement all the methods.
-
isUsable
public boolean isUsable(org.lwjgl.opengl.ContextCapabilities glContext) To tell players if this shader pack is usable in current hardware. -
createDetailsPanel
public void createDetailsPanel(com.fs.starfarer.api.ui.TooltipMakerAPI tooltip, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) With description and config option. -
detailsPanelAdvance
public boolean detailsPanelAdvance(float amount, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) - Returns:
- returns ture for any valid setting has changed, by OR operation.
-
detailsPanelRender
public void detailsPanelRender(float alpha, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) -
detailsPanelRenderBelow
public void detailsPanelRenderBelow(float alpha, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) -
detailsPanelProcessInput
public boolean detailsPanelProcessInput(List<com.fs.starfarer.api.input.InputEventAPI> events, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) - Returns:
- returns ture for any valid setting has changed.
-
detailsPanelButtonPressed
public boolean detailsPanelButtonPressed(Object buttonId, com.fs.starfarer.api.ui.PositionAPI planePos, com.fs.starfarer.api.ui.PositionAPI elementPos) - Returns:
- returns ture for any valid setting has changed.
-
equals
-
toString
-
hashCode
public final int hashCode()
-