/** * Sets the filtering mode for shadow edges. See {@link EdgeFilteringMode} * for more info. * * @param filterMode the desired filter mode (not null) */ final public void setEdgeFilteringMode(EdgeFilteringMode filterMode) { if (filterMode == null) { throw new NullPointerException(); } this.edgeFilteringMode = filterMode; postshadowMat.setInt("FilterMode", filterMode.getMaterialParamValue()); postshadowMat.setFloat("PCFEdge", edgesThickness); if (shadowCompareMode == CompareMode.Hardware) { for (Texture2D shadowMap : shadowMaps) { if (filterMode == EdgeFilteringMode.Bilinear) { shadowMap.setMagFilter(MagFilter.Bilinear); shadowMap.setMinFilter(MinFilter.BilinearNoMipMaps); } else { shadowMap.setMagFilter(MagFilter.Nearest); shadowMap.setMinFilter(MinFilter.NearestNoMipMaps); } } } }
filteringIndex = plsr.getEdgeFilteringMode().ordinal(); filteringIndex = (filteringIndex + 1) % EdgeFilteringMode.values().length; EdgeFilteringMode m = EdgeFilteringMode.values()[filteringIndex]; plsr.setEdgeFilteringMode(m); plsf.setEdgeFilteringMode(m); shadowFilterText.setText(FILTERING_TEXT + m.toString());
shadowFilterText.setText(FILTERING_TEXT + plsr.getEdgeFilteringMode().toString()); shadowIntensityText.setText(INTENSITY_TEXT + plsr.getShadowIntensity());
/** * Sets the filtering mode for shadow edges. See {@link EdgeFilteringMode} * for more info. * * @param filterMode the desired filter mode (not null) */ final public void setEdgeFilteringMode(EdgeFilteringMode filterMode) { if (filterMode == null) { throw new NullPointerException(); } this.edgeFilteringMode = filterMode; postshadowMat.setInt("FilterMode", filterMode.getMaterialParamValue()); postshadowMat.setFloat("PCFEdge", edgesThickness); if (shadowCompareMode == CompareMode.Hardware) { for (Texture2D shadowMap : shadowMaps) { if (filterMode == EdgeFilteringMode.Bilinear) { shadowMap.setMagFilter(MagFilter.Bilinear); shadowMap.setMinFilter(MinFilter.BilinearNoMipMaps); } else { shadowMap.setMagFilter(MagFilter.Nearest); shadowMap.setMinFilter(MinFilter.NearestNoMipMaps); } } } }
private void setMatParams(GeometryList l) { //iteration throught all the geometries of the list to gather the materials buildMatCache(l); //iterating through the mat cache and setting the parameters for (Material mat : matCache) { mat.setFloat("ShadowMapSize", shadowMapSize); for (int j = 0; j < nbShadowMaps; j++) { mat.setMatrix4(lightViewStringCache[j], lightViewProjectionsMatrices[j]); } for (int j = 0; j < nbShadowMaps; j++) { mat.setTexture(shadowMapStringCache[j], shadowMaps[j]); } mat.setBoolean("HardwareShadows", shadowCompareMode == CompareMode.Hardware); mat.setInt("FilterMode", edgeFilteringMode.getMaterialParamValue()); mat.setFloat("PCFEdge", edgesThickness); mat.setFloat("ShadowIntensity", shadowIntensity); mat.setBoolean("BackfaceShadows", renderBackFacesShadows); if (fadeInfo != null) { mat.setVector2("FadeInfo", fadeInfo); } setMaterialParameters(mat); } //At least one material of the receiving geoms does not support the post shadow techniques //so we fall back to the forced material solution (transparent shadows won't be supported for these objects) if (needsfallBackMaterial) { setPostShadowParams(); } }
private void setMatParams(GeometryList l) { //iteration throught all the geometries of the list to gather the materials buildMatCache(l); //iterating through the mat cache and setting the parameters for (Material mat : matCache) { mat.setFloat("ShadowMapSize", shadowMapSize); for (int j = 0; j < nbShadowMaps; j++) { mat.setMatrix4(lightViewStringCache[j], lightViewProjectionsMatrices[j]); } for (int j = 0; j < nbShadowMaps; j++) { mat.setTexture(shadowMapStringCache[j], shadowMaps[j]); } mat.setBoolean("HardwareShadows", shadowCompareMode == CompareMode.Hardware); mat.setInt("FilterMode", edgeFilteringMode.getMaterialParamValue()); mat.setFloat("PCFEdge", edgesThickness); mat.setFloat("ShadowIntensity", shadowIntensity); mat.setBoolean("BackfaceShadows", renderBackFacesShadows); if (fadeInfo != null) { mat.setVector2("FadeInfo", fadeInfo); } setMaterialParameters(mat); } //At least one material of the receiving geoms does not support the post shadow techniques //so we fall back to the forced material solution (transparent shadows won't be supported for these objects) if (needsfallBackMaterial) { setPostShadowParams(); } }
/** * Sets the filtering mode for shadow edges. See {@link EdgeFilteringMode} * for more info. * * @param filterMode the desired filter mode (not null) */ final public void setEdgeFilteringMode(EdgeFilteringMode filterMode) { if (filterMode == null) { throw new NullPointerException(); } this.edgeFilteringMode = filterMode; postshadowMat.setInt("FilterMode", filterMode.getMaterialParamValue()); postshadowMat.setFloat("PCFEdge", edgesThickness); if (shadowCompareMode == CompareMode.Hardware) { for (Texture2D shadowMap : shadowMaps) { if (filterMode == EdgeFilteringMode.Bilinear) { shadowMap.setMagFilter(MagFilter.Bilinear); shadowMap.setMinFilter(MinFilter.BilinearNoMipMaps); } else { shadowMap.setMagFilter(MagFilter.Nearest); shadowMap.setMinFilter(MinFilter.NearestNoMipMaps); } } } }
private void setMatParams(GeometryList l) { //iteration throught all the geometries of the list to gather the materials buildMatCache(l); //iterating through the mat cache and setting the parameters for (Material mat : matCache) { mat.setFloat("ShadowMapSize", shadowMapSize); for (int j = 0; j < nbShadowMaps; j++) { mat.setMatrix4(lightViewStringCache[j], lightViewProjectionsMatrices[j]); } for (int j = 0; j < nbShadowMaps; j++) { mat.setTexture(shadowMapStringCache[j], shadowMaps[j]); } mat.setBoolean("HardwareShadows", shadowCompareMode == CompareMode.Hardware); mat.setInt("FilterMode", edgeFilteringMode.getMaterialParamValue()); mat.setFloat("PCFEdge", edgesThickness); mat.setFloat("ShadowIntensity", shadowIntensity); mat.setBoolean("BackfaceShadows", renderBackFacesShadows); if (fadeInfo != null) { mat.setVector2("FadeInfo", fadeInfo); } setMaterialParameters(mat); } //At least one material of the receiving geoms does not support the post shadow techniques //so we fall back to the forced material solution (transparent shadows won't be supported for these objects) if (needsfallBackMaterial) { setPostShadowParams(); } }