-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a ChoiceBox for water shader (#1634)
* Use a ChoiceBox for water shader * Rename legacy water shading to tiled normal map. * Improve water shading tooltip. --------- Co-authored-by: Maik Marschner <[email protected]>
- Loading branch information
1 parent
355f76d
commit c89be36
Showing
10 changed files
with
211 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
chunky/src/java/se/llbit/chunky/renderer/WaterShadingStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* Copyright (c) 2023 Chunky Contributors | ||
* | ||
* This file is part of Chunky. | ||
* | ||
* Chunky is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Chunky is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with Chunky. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package se.llbit.chunky.renderer; | ||
|
||
import se.llbit.util.Registerable; | ||
|
||
public enum WaterShadingStrategy implements Registerable { | ||
SIMPLEX("Simplex", "Uses configurable noise to shade the water, which prevents tiling at great distances."), | ||
TILED_NORMALMAP("Tiled normal map", "Uses a built-in tiled normal map to shade the water"), | ||
STILL("Still", "Renders the water surface as flat."); | ||
|
||
private final String displayName; | ||
private final String description; | ||
|
||
WaterShadingStrategy(String displayName, String description) { | ||
this.displayName = displayName; | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return this.displayName; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return this.description; | ||
} | ||
|
||
@Override | ||
public String getId() { | ||
return this.name(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
chunky/src/java/se/llbit/chunky/renderer/scene/StillWaterShader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* Copyright (c) 2012-2023 Chunky contributors | ||
* | ||
* This file is part of Chunky. | ||
* | ||
* Chunky is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Chunky is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with Chunky. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package se.llbit.chunky.renderer.scene; | ||
|
||
import se.llbit.chunky.model.minecraft.WaterModel; | ||
import se.llbit.json.JsonObject; | ||
import se.llbit.math.Ray; | ||
|
||
public class StillWaterShader implements WaterShader { | ||
@Override | ||
public void doWaterShading(Ray ray, double animationTime) { | ||
} | ||
|
||
@Override | ||
public WaterShader clone() { | ||
return new StillWaterShader(); | ||
} | ||
|
||
@Override | ||
public void save(JsonObject json) { | ||
} | ||
|
||
@Override | ||
public void load(JsonObject json) { | ||
} | ||
} |
Oops, something went wrong.