/** * Create an abstract shadow renderer. Subclasses invoke this constructor. * * @param assetManager the application asset manager * @param shadowMapSize the size of the rendered shadow maps (512,1024,2048, * etc...) * @param nbShadowMaps the number of shadow maps rendered (the more shadow * maps the more quality, the fewer fps). */ protected AbstractShadowRendererVR(AssetManager assetManager, int shadowMapSize, int nbShadowMaps) { this.assetManager = assetManager; this.nbShadowMaps = nbShadowMaps; this.shadowMapSize = shadowMapSize; init(assetManager, nbShadowMaps, shadowMapSize); }
/** * De-serialize this instance, for example when loading from a J3O file. * * @param im importer (not null) */ public void read(JmeImporter im) throws IOException { InputCapsule ic = (InputCapsule) im.getCapsule(this); assetManager = im.getAssetManager(); nbShadowMaps = ic.readInt("nbShadowMaps", 1); shadowMapSize = ic.readFloat("shadowMapSize", 0f); shadowIntensity = ic.readFloat("shadowIntensity", 0.7f); edgeFilteringMode = ic.readEnum("edgeFilteringMode", EdgeFilteringMode.class, EdgeFilteringMode.Bilinear); shadowCompareMode = ic.readEnum("shadowCompareMode", CompareMode.class, CompareMode.Hardware); init(assetManager, nbShadowMaps, (int) shadowMapSize); edgesThickness = ic.readFloat("edgesThickness", 1.0f); postshadowMat.setFloat("PCFEdge", edgesThickness); }