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