foliage placement fixes
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
745dbe224b
commit
786e96373d
@ -1127,6 +1127,7 @@ Small noise sampling refactor
|
|||||||
Fix test data for main menu render test
|
Fix test data for main menu render test
|
||||||
Change voxel weight reporting from server to align with foliage
|
Change voxel weight reporting from server to align with foliage
|
||||||
Use jenkins data for unit test temporarily
|
Use jenkins data for unit test temporarily
|
||||||
|
Disable tunnel noise to align foliage better + adjust manual value for foliage placement
|
||||||
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
@ -349,7 +349,7 @@ public class FoliageModel {
|
|||||||
//determine quadrant we're placing in
|
//determine quadrant we're placing in
|
||||||
double offsetY = 0;
|
double offsetY = 0;
|
||||||
boolean addBlade = false;
|
boolean addBlade = false;
|
||||||
double manualAdjustment = -0.55;
|
double manualAdjustment = -0.50;
|
||||||
// System.out.println(relativePositionOnGridX + " " + relativePositionOnGridZ);
|
// System.out.println(relativePositionOnGridX + " " + relativePositionOnGridZ);
|
||||||
//if we have heights for all four surrounding spots, interpolate for y value
|
//if we have heights for all four surrounding spots, interpolate for y value
|
||||||
offsetY =
|
offsetY =
|
||||||
|
|||||||
@ -51,12 +51,13 @@ public class NoiseVoxelGen implements VoxelGenerator {
|
|||||||
) {
|
) {
|
||||||
double strideMultiplier = Math.pow(2,stride);
|
double strideMultiplier = Math.pow(2,stride);
|
||||||
double heightDiff = realY - surfaceHeight;
|
double heightDiff = realY - surfaceHeight;
|
||||||
double sample = this.sampler.getValue(0, realX, realY, realZ);
|
double sample = 1.0;//this.sampler.getValue(0, realX, realY, realZ);
|
||||||
if(sample <= 0){
|
if(sample <= 0){
|
||||||
voxel.weight = (float)(sample * 2);
|
voxel.weight = (float)(sample * 2);
|
||||||
voxel.type = 0;
|
voxel.type = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
sample = Math.min(sample,1.0);
|
||||||
if(heightDiff < -strideMultiplier * SURFACE_VOXEL_WIDTH){
|
if(heightDiff < -strideMultiplier * SURFACE_VOXEL_WIDTH){
|
||||||
//below surface
|
//below surface
|
||||||
double finalSurface = sample;
|
double finalSurface = sample;
|
||||||
@ -77,8 +78,8 @@ public class NoiseVoxelGen implements VoxelGenerator {
|
|||||||
if(surfacePercent > 1.0 || surfacePercent < 0){
|
if(surfacePercent > 1.0 || surfacePercent < 0){
|
||||||
throw new Error("surfacePercent " + surfacePercent + " " + realY + " " + surfaceHeight + " " + heightDiff + " " + strideMultiplier);
|
throw new Error("surfacePercent " + surfacePercent + " " + realY + " " + surfaceHeight + " " + heightDiff + " " + strideMultiplier);
|
||||||
}
|
}
|
||||||
double finalHeight = sample * surfacePercent;
|
double finalHeight = sample * surfacePercent * 2 - 1;
|
||||||
voxel.weight = (float)finalHeight * 2 - 1;
|
voxel.weight = (float)(finalHeight * sample);
|
||||||
voxel.type = 2;
|
voxel.type = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user