AO hinzugefügt
This commit is contained in:
@@ -17,10 +17,10 @@ public class GraphicsSettings {
|
|||||||
* lambda/zExtend/zFade/backface können zur Laufzeit angepasst werden.
|
* lambda/zExtend/zFade/backface können zur Laufzeit angepasst werden.
|
||||||
*/
|
*/
|
||||||
public enum ShadowQuality {
|
public enum ShadowQuality {
|
||||||
// mapSize splits lambda zExtend zFade backface
|
// mapSize splits lambda zExtend zFade backface ssaoR ssaoI
|
||||||
LOW ( 1024, 2, 0.70f, 40f, 5f, false),
|
LOW ( 1024, 2, 0.70f, 40f, 5f, false, 0f, 0f ),
|
||||||
MEDIUM ( 2048, 3, 0.75f, 60f, 8f, true ),
|
MEDIUM ( 2048, 3, 0.75f, 60f, 8f, true, 1.0f, 1.5f),
|
||||||
HIGH ( 4096, 4, 0.80f, 80f, 10f, true );
|
HIGH ( 4096, 4, 0.80f, 80f, 10f, true, 1.5f, 2.5f);
|
||||||
|
|
||||||
public final int shadowMapSize;
|
public final int shadowMapSize;
|
||||||
public final int splits;
|
public final int splits;
|
||||||
@@ -28,15 +28,20 @@ public class GraphicsSettings {
|
|||||||
public final float zExtend;
|
public final float zExtend;
|
||||||
public final float zFade;
|
public final float zFade;
|
||||||
public final boolean backface;
|
public final boolean backface;
|
||||||
|
public final float ssaoRadius;
|
||||||
|
public final float ssaoIntensity;
|
||||||
|
|
||||||
ShadowQuality(int shadowMapSize, int splits, float lambda,
|
ShadowQuality(int shadowMapSize, int splits, float lambda,
|
||||||
float zExtend, float zFade, boolean backface) {
|
float zExtend, float zFade, boolean backface,
|
||||||
|
float ssaoRadius, float ssaoIntensity) {
|
||||||
this.shadowMapSize = shadowMapSize;
|
this.shadowMapSize = shadowMapSize;
|
||||||
this.splits = splits;
|
this.splits = splits;
|
||||||
this.lambda = lambda;
|
this.lambda = lambda;
|
||||||
this.zExtend = zExtend;
|
this.zExtend = zExtend;
|
||||||
this.zFade = zFade;
|
this.zFade = zFade;
|
||||||
this.backface = backface;
|
this.backface = backface;
|
||||||
|
this.ssaoRadius = ssaoRadius;
|
||||||
|
this.ssaoIntensity = ssaoIntensity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -736,6 +736,15 @@ public class WorldScene extends BaseAppState {
|
|||||||
// Schatten als Filter – vermeidet das Setzen von ShadowMap-Texturen in Scene-Materialien
|
// Schatten als Filter – vermeidet das Setzen von ShadowMap-Texturen in Scene-Materialien
|
||||||
fpp.addFilter(shadowFilter);
|
fpp.addFilter(shadowFilter);
|
||||||
|
|
||||||
|
// SSAO – Stärke und Radius abhängig von Schattenqualität (LOW = kein SSAO)
|
||||||
|
if (graphicsSettings.shadowQuality.ssaoRadius > 0f) {
|
||||||
|
com.jme3.post.ssao.SSAOFilter ssao = new com.jme3.post.ssao.SSAOFilter(
|
||||||
|
graphicsSettings.shadowQuality.ssaoRadius,
|
||||||
|
graphicsSettings.shadowQuality.ssaoIntensity,
|
||||||
|
0.2f, 0.05f);
|
||||||
|
ssao.setApproximateNormals(true);
|
||||||
|
fpp.addFilter(ssao);
|
||||||
|
}
|
||||||
|
|
||||||
// Globales Wasser bei Y=0 (bedeckt die gesamte Karte unterhalb der Wasserlinie)
|
// Globales Wasser bei Y=0 (bedeckt die gesamte Karte unterhalb der Wasserlinie)
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user