Made alpha a power function of density for gases to produce better visuals for low densities.

This commit is contained in:
Chicken Bones committed 2013-08-02 02:04:19 +10:00
1 parent b16ad2115b
commit 5184abc23c
1 file changed
+7 -2
+7 -2
View File
@@ -277,6 +277,11 @@ public class RenderUtils
{
renderFluidCuboid(stack, bound, density, res);
}
public static double fluidDensityToAlpha(double density)
{
return Math.pow(density, 0.4);
}
/**
* Renders a fluid within a bounding box.
@@ -295,7 +300,7 @@ public class RenderUtils
int alpha = 255;
if(stack.getFluid().isGaseous())
alpha = (int) (density*255);
alpha = (int) (fluidDensityToAlpha(density)*255);
else
bound.max.y = bound.min.y+(bound.max.y-bound.min.y)*density;
@@ -313,7 +318,7 @@ public class RenderUtils
int alpha = 255;
if(stack.getFluid().isGaseous())
alpha = (int) (density*255);
alpha = (int) (fluidDensityToAlpha(density)*255);
else
{
int height = (int) (rect.h*density);