public static DirectionalLightShadowFilter cloneDirectionalLightShadowFilter(AssetManager assetManager, DirectionalLightShadowFilter filter){ DirectionalLightShadowFilter clone = new DirectionalLightShadowFilter(assetManager, 512, 3); clone.setLight(filter.getLight()); clone.setLambda(filter.getLambda()); clone.setShadowIntensity(filter.getShadowIntensity()); clone.setEdgeFilteringMode(filter.getEdgeFilteringMode()); // clone.setEnabled(filter.isEnabled()); return clone; }
/** * Sets the light to use to cast shadows * * @param light a DirectionalLight */ public void setLight(DirectionalLight light) { shadowRenderer.setLight(light); }
/** * Sets the shadow edges thickness. default is 1, setting it to lower values * can help to reduce the jagged effect of the shadow edges * * @param edgesThickness */ public void setEdgesThickness(int edgesThickness) { shadowRenderer.setEdgesThickness(edgesThickness); }
/** * returns the lambda parameter * * @see #setLambda(float lambda) * @return lambda */ public float getLambda() { return shadowRenderer.getLambda(); }
/** * Enables the stabilization of the shadow's edges. (default is true) * This prevents shadow edges from flickering when the camera moves. * However it can lead to some shadow quality loss in some particular scenes. * @param stabilize */ public void setEnabledStabilization(boolean stabilize) { shadowRenderer.setEnabledStabilization(stabilize); }
/** * Sets the light to use to cast shadows * * @param light a SpotLight */ public void setLight(SpotLight light) { shadowRenderer.setLight(light); }
/** * Set the shadowIntensity, the value should be between 0 and 1, a 0 value * gives a bright and invisible shadow, a 1 value gives a pitch black * shadow, default is 0.7 * * @param shadowIntensity the darkness of the shadow */ final public void setShadowIntensity(float shadowIntensity) { shadowRenderer.setShadowIntensity(shadowIntensity); }
/** * sets the shadow compare mode see {@link CompareMode} for more info * * @param compareMode */ final public void setShadowCompareMode(CompareMode compareMode) { shadowRenderer.setShadowCompareMode(compareMode); }
/** * returns the edge filtering mode * * @see EdgeFilteringMode * @return */ public EdgeFilteringMode getEdgeFilteringMode() { return shadowRenderer.getEdgeFilteringMode(); }
/** * Create a SpotLightShadowRenderer This use standard shadow mapping * * @param assetManager the application asset manager * @param shadowMapSize the size of the rendered shadowmaps (512,1024,2048, * etc...) the more quality, the less fps). */ public SpotLightShadowRenderer(AssetManager assetManager, int shadowMapSize) { super(assetManager, shadowMapSize, 1); init(shadowMapSize); }
/** * return the light used to cast shadows * * @return the SpotLight */ public SpotLight getLight() { return shadowRenderer.getLight(); }
/** * Set this to false if you want to use several PssmRenderers to have multiple shadows cast by multiple light sources. * Make sure the last PssmRenderer in the stack DOES flush the queues, but not the others * @param flushQueues */ public void setFlushQueues(boolean flushQueues) { pssmRenderer.setFlushQueues(flushQueues); }
/** * Check the rootScene against camera frustum and if intersects process it recursively. * The global OccludersExtractor variables need to be initialized first. * Variables are updated and used in {@link ShadowUtil#updateShadowCamera} at last. */ public int addOccluders(Spatial scene) { if ( scene != null ) process(scene); return casterCount; }
/** * Define the length over which the shadow will fade out when using a shadowZextend * @param length the fade length in world units */ public void setShadowZFadeLength(float length){ pssmRenderer.setShadowZFadeLength(length); }
/** * Creates a PointLightShadowRenderer * * @param assetManager the application asset manager * @param shadowMapSize the size of the rendered shadowmaps (512,1024,2048, * etc...) */ public PointLightShadowRenderer(AssetManager assetManager, int shadowMapSize) { super(assetManager, shadowMapSize, CAM_NUMBER); init(shadowMapSize); }
/** * if this filter renders back faces shadows * @return true if this filter renders back faces shadows */ public boolean isRenderBackFacesShadows() { return shadowRenderer.isRenderBackFacesShadows(); }
/** * returns the lambda parameter * * @see #setLambda(float lambda) * @return lambda */ public float getLambda() { return shadowRenderer.getLambda(); }
/** * Define the length over which the shadow will fade out when using a * shadowZextend * * @param length the fade length in world units */ public void setShadowZFadeLength(float length) { shadowRenderer.setShadowZFadeLength(length); }
/** * Set the shadowIntensity, the value should be between 0 and 1, a 0 value * gives a bright and invisible shadow, a 1 value gives a pitch black * shadow, default is 0.7 * * @param shadowIntensity the darkness of the shadow */ final public void setShadowIntensity(float shadowIntensity) { shadowRenderer.setShadowIntensity(shadowIntensity); }
/** * Get the pre-shadows pass render state. * use it to adjust the RenderState parameters of the pre shadow pass. * Note that this will be overridden if the preShadow technique in the material has a ForcedRenderState * @return the pre shadow render state. */ public RenderState getPreShadowForcedRenderState() { return shadowRenderer.getPreShadowForcedRenderState(); }