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(); } }