mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
dont evaluate derivatives for empty slant palettes
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ public final class PaletteUtil {
|
|||||||
|
|
||||||
public static Palette getPalette(int x, int y, int z, Sampler3D sampler, PaletteInfo paletteInfo) {
|
public static Palette getPalette(int x, int y, int z, Sampler3D sampler, PaletteInfo paletteInfo) {
|
||||||
SlantHolder slant = paletteInfo.slantHolder();
|
SlantHolder slant = paletteInfo.slantHolder();
|
||||||
if(slant != null) {
|
if(!slant.isEmpty()) {
|
||||||
double slope = derivative(sampler, x, y, z);
|
double slope = derivative(sampler, x, y, z);
|
||||||
if(slope > slant.getMinSlope()) {
|
if(slope > slant.getMinSlope()) {
|
||||||
return slant.getPalette(slope).getPalette(y);
|
return slant.getPalette(slope).getPalette(y);
|
||||||
|
|||||||
+4
@@ -20,6 +20,10 @@ public class SlantHolder {
|
|||||||
this.minSlope = minSlope;
|
this.minSlope = minSlope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return layers.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
public PaletteHolder getPalette(double slope) {
|
public PaletteHolder getPalette(double slope) {
|
||||||
return layers.floorEntry(slope).getValue();
|
return layers.floorEntry(slope).getValue();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user