|
|
|
@ -1,8 +1,11 @@
|
|
|
|
|
package eu.jonahbauer.raytracing;
|
|
|
|
|
|
|
|
|
|
import eu.jonahbauer.raytracing.math.Vec3;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.spectral.colors.ColorSpaces;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.spectral.spectrum.RGBAlbedoSpectrum;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.spectral.spectrum.RGBIlluminantSpectrum;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.texture.CheckerTexture;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.texture.Color;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.spectral.colors.ColorRGB;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.camera.SimpleCamera;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.material.*;
|
|
|
|
|
import eu.jonahbauer.raytracing.render.texture.ImageTexture;
|
|
|
|
@ -49,13 +52,14 @@ public class Examples {
|
|
|
|
|
|
|
|
|
|
public static @NotNull Example getSimpleScene(int height) {
|
|
|
|
|
if (height <= 0) height = 675;
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
return new Example(
|
|
|
|
|
new Scene(getSkyBox(), List.of(
|
|
|
|
|
new Sphere(new Vec3(0, -100.5, -1.0), 100.0, new LambertianMaterial(new Color(0.8, 0.8, 0.0))),
|
|
|
|
|
new Sphere(new Vec3(0, 0, -1.2), 0.5, new LambertianMaterial(new Color(0.1, 0.2, 0.5))),
|
|
|
|
|
new Sphere(new Vec3(0, -100.5, -1.0), 100.0, new LambertianMaterial(new ColorRGB(0.8, 0.8, 0.0), cs)),
|
|
|
|
|
new Sphere(new Vec3(0, 0, -1.2), 0.5, new LambertianMaterial(new ColorRGB(0.1, 0.2, 0.5), cs)),
|
|
|
|
|
new Sphere(new Vec3(-1.0, 0, -1.2), 0.5, new DielectricMaterial(1.5)),
|
|
|
|
|
new Sphere(new Vec3(-1.0, 0, -1.2), 0.4, new DielectricMaterial(1 / 1.5)),
|
|
|
|
|
new Sphere(new Vec3(1.0, 0, -1.2), 0.5, new MetallicMaterial(new Color(0.8, 0.6, 0.2), 0.0))
|
|
|
|
|
new Sphere(new Vec3(1.0, 0, -1.2), 0.5, new MetallicMaterial(new ColorRGB(0.8, 0.6, 0.2), cs, 0.0))
|
|
|
|
|
)),
|
|
|
|
|
SimpleCamera.builder()
|
|
|
|
|
.withImage(height * 16 / 9, height)
|
|
|
|
@ -66,11 +70,16 @@ public class Examples {
|
|
|
|
|
public static @NotNull Example getSpheres(int height) {
|
|
|
|
|
if (height <= 0) height = 675;
|
|
|
|
|
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
|
|
|
|
|
var rng = new Random(1);
|
|
|
|
|
var objects = new ArrayList<Hittable>();
|
|
|
|
|
objects.add(new Sphere(
|
|
|
|
|
new Vec3(0, -1000, 0), 1000,
|
|
|
|
|
new LambertianMaterial(new CheckerTexture(0.32, new Color(.2, .3, .1), new Color(.9, .9, .9)))
|
|
|
|
|
new LambertianMaterial(new CheckerTexture(0.32,
|
|
|
|
|
new RGBAlbedoSpectrum(cs, new ColorRGB(.2, .3, .1)),
|
|
|
|
|
new RGBAlbedoSpectrum(cs, new ColorRGB(.9, .9, .9))
|
|
|
|
|
))
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
for (int a = -11; a < 11; a++) {
|
|
|
|
@ -82,13 +91,13 @@ public class Examples {
|
|
|
|
|
var rnd = rng.nextDouble();
|
|
|
|
|
if (rnd < 0.8) {
|
|
|
|
|
// diffuse
|
|
|
|
|
var albedo = Color.random(rng).times(Color.random(rng));
|
|
|
|
|
material = new LambertianMaterial(albedo);
|
|
|
|
|
var albedo = ColorRGB.random(rng).times(ColorRGB.random(rng));
|
|
|
|
|
material = new LambertianMaterial(albedo, cs);
|
|
|
|
|
} else if (rnd < 0.95) {
|
|
|
|
|
// metal
|
|
|
|
|
var albedo = Color.random(rng, 0.5, 1.0);
|
|
|
|
|
var albedo = ColorRGB.random(rng, 0.5, 1.0);
|
|
|
|
|
var fuzz = rng.nextDouble() * 0.5;
|
|
|
|
|
material = new MetallicMaterial(albedo, fuzz);
|
|
|
|
|
material = new MetallicMaterial(albedo, cs, fuzz);
|
|
|
|
|
} else {
|
|
|
|
|
// glass
|
|
|
|
|
material = new DielectricMaterial(1.5);
|
|
|
|
@ -99,8 +108,8 @@ public class Examples {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
objects.add(new Sphere(new Vec3(0, 1, 0), 1.0, new DielectricMaterial(1.5)));
|
|
|
|
|
objects.add(new Sphere(new Vec3(-4, 1, 0), 1.0, new LambertianMaterial(new Color(0.4, 0.2, 0.1))));
|
|
|
|
|
objects.add(new Sphere(new Vec3(4, 1, 0), 1.0, new MetallicMaterial(new Color(0.7, 0.6, 0.5))));
|
|
|
|
|
objects.add(new Sphere(new Vec3(-4, 1, 0), 1.0, new LambertianMaterial(new ColorRGB(0.4, 0.2, 0.1), cs)));
|
|
|
|
|
objects.add(new Sphere(new Vec3(4, 1, 0), 1.0, new MetallicMaterial(new ColorRGB(0.7, 0.6, 0.5), cs)));
|
|
|
|
|
|
|
|
|
|
var camera = SimpleCamera.builder()
|
|
|
|
|
.withImage(height * 16 / 9, height)
|
|
|
|
@ -116,13 +125,14 @@ public class Examples {
|
|
|
|
|
|
|
|
|
|
public static @NotNull Example getSquares(int height) {
|
|
|
|
|
if (height <= 0) height = 600;
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
return new Example(
|
|
|
|
|
new Scene(getSkyBox(), List.of(
|
|
|
|
|
new Parallelogram(new Vec3(-3, -2, 5), new Vec3(0, 0, -4), new Vec3(0, 4, 0), new LambertianMaterial(new Color(1.0, 0.2, 0.2))),
|
|
|
|
|
new Parallelogram(new Vec3(-2, -2, 0), new Vec3(4, 0, 0), new Vec3(0, 4, 0), new LambertianMaterial(new Color(0.2, 1.0, 0.2))),
|
|
|
|
|
new Parallelogram(new Vec3(3, -2, 1), new Vec3(0, 0, 4), new Vec3(0, 4, 0), new LambertianMaterial(new Color(0.2, 0.2, 1.0))),
|
|
|
|
|
new Parallelogram(new Vec3(-2, 3, 1), new Vec3(4, 0, 0), new Vec3(0, 0, 4), new LambertianMaterial(new Color(1.0, 0.5, 0.0))),
|
|
|
|
|
new Parallelogram(new Vec3(-2, -3, 5), new Vec3(4, 0, 0), new Vec3(0, 0, -4), new LambertianMaterial(new Color(0.2, 0.8, 0.8)))
|
|
|
|
|
new Parallelogram(new Vec3(-3, -2, 5), new Vec3(0, 0, -4), new Vec3(0, 4, 0), new LambertianMaterial(new ColorRGB(1.0, 0.2, 0.2), cs)),
|
|
|
|
|
new Parallelogram(new Vec3(-2, -2, 0), new Vec3(4, 0, 0), new Vec3(0, 4, 0), new LambertianMaterial(new ColorRGB(0.2, 1.0, 0.2), cs)),
|
|
|
|
|
new Parallelogram(new Vec3(3, -2, 1), new Vec3(0, 0, 4), new Vec3(0, 4, 0), new LambertianMaterial(new ColorRGB(0.2, 0.2, 1.0), cs)),
|
|
|
|
|
new Parallelogram(new Vec3(-2, 3, 1), new Vec3(4, 0, 0), new Vec3(0, 0, 4), new LambertianMaterial(new ColorRGB(1.0, 0.5, 0.0), cs)),
|
|
|
|
|
new Parallelogram(new Vec3(-2, -3, 5), new Vec3(4, 0, 0), new Vec3(0, 0, -4), new LambertianMaterial(new ColorRGB(0.2, 0.8, 0.8), cs))
|
|
|
|
|
)),
|
|
|
|
|
SimpleCamera.builder()
|
|
|
|
|
.withImage(height, height)
|
|
|
|
@ -135,12 +145,13 @@ public class Examples {
|
|
|
|
|
|
|
|
|
|
public static @NotNull Example getLight(int height) {
|
|
|
|
|
if (height <= 0) height = 225;
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
return new Example(
|
|
|
|
|
new Scene(List.of(
|
|
|
|
|
new Sphere(new Vec3(0, -1000, 0), 1000, new LambertianMaterial(new Color(0.2, 0.2, 0.2))),
|
|
|
|
|
new Sphere(new Vec3(0, 2, 0), 2, new LambertianMaterial(new Color(0.2, 0.2, 0.2))),
|
|
|
|
|
new Parallelogram(new Vec3(3, 1, -2), new Vec3(2, 0, 0), new Vec3(0, 2, 0), new DiffuseLight(new Color(4.0, 4.0, 4.0))),
|
|
|
|
|
new Sphere(new Vec3(0, 7, 0), 2, new DiffuseLight(new Color(4.0, 4.0, 4.0)))
|
|
|
|
|
new Sphere(new Vec3(0, -1000, 0), 1000, new LambertianMaterial(new ColorRGB(0.2, 0.2, 0.2), cs)),
|
|
|
|
|
new Sphere(new Vec3(0, 2, 0), 2, new LambertianMaterial(new ColorRGB(0.2, 0.2, 0.2), cs)),
|
|
|
|
|
new Parallelogram(new Vec3(3, 1, -2), new Vec3(2, 0, 0), new Vec3(0, 2, 0), new DiffuseLight(new ColorRGB(4.0, 4.0, 4.0), cs)),
|
|
|
|
|
new Sphere(new Vec3(0, 7, 0), 2, new DiffuseLight(new ColorRGB(4.0, 4.0, 4.0), cs))
|
|
|
|
|
)),
|
|
|
|
|
SimpleCamera.builder()
|
|
|
|
|
.withImage(height * 16 / 9, height)
|
|
|
|
@ -154,10 +165,11 @@ public class Examples {
|
|
|
|
|
public static @NotNull Example getCornellBox(int height) {
|
|
|
|
|
if (height <= 0) height = 600;
|
|
|
|
|
|
|
|
|
|
var red = new LambertianMaterial(new Color(.65, .05, .05));
|
|
|
|
|
var white = new LambertianMaterial(new Color(.73, .73, .73));
|
|
|
|
|
var green = new LambertianMaterial(new Color(.12, .45, .15));
|
|
|
|
|
var light = new DiffuseLight(new Color(15.0, 15.0, 15.0));
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
var red = new LambertianMaterial(new ColorRGB(.65, .05, .05), cs);
|
|
|
|
|
var white = new LambertianMaterial(new ColorRGB(.73, .73, .73), cs);
|
|
|
|
|
var green = new LambertianMaterial(new ColorRGB(.12, .45, .15), cs);
|
|
|
|
|
var light = new DiffuseLight(new ColorRGB(15.0, 15.0, 15.0), cs);
|
|
|
|
|
|
|
|
|
|
return new Example(
|
|
|
|
|
new Scene(List.of(
|
|
|
|
@ -181,10 +193,11 @@ public class Examples {
|
|
|
|
|
|
|
|
|
|
public static @NotNull Example getCornellBoxSmoke(int height) {
|
|
|
|
|
if (height <= 0) height = 600;
|
|
|
|
|
var red = new LambertianMaterial(new Color(.65, .05, .05));
|
|
|
|
|
var white = new LambertianMaterial(new Color(.73, .73, .73));
|
|
|
|
|
var green = new LambertianMaterial(new Color(.12, .45, .15));
|
|
|
|
|
var light = new DiffuseLight(new Color(7.0, 7.0, 7.0));
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
var red = new LambertianMaterial(new ColorRGB(.65, .05, .05), cs);
|
|
|
|
|
var white = new LambertianMaterial(new ColorRGB(.73, .73, .73), cs);
|
|
|
|
|
var green = new LambertianMaterial(new ColorRGB(.12, .45, .15), cs);
|
|
|
|
|
var light = new DiffuseLight(new ColorRGB(15.0, 15.0, 15.0), cs);
|
|
|
|
|
|
|
|
|
|
return new Example(
|
|
|
|
|
new Scene(List.of(
|
|
|
|
@ -194,13 +207,13 @@ public class Examples {
|
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 330, 165), white)
|
|
|
|
|
.rotateY(Math.toRadians(15))
|
|
|
|
|
.translate(new Vec3(265, 0, 295)),
|
|
|
|
|
0.01, new IsotropicMaterial(Color.BLACK)
|
|
|
|
|
0.01, new IsotropicMaterial(ColorRGB.BLACK, cs)
|
|
|
|
|
),
|
|
|
|
|
new ConstantMedium(
|
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 165, 165), white)
|
|
|
|
|
.rotateY(Math.toRadians(-18))
|
|
|
|
|
.translate(new Vec3(130, 0, 65)),
|
|
|
|
|
0.01, new IsotropicMaterial(Color.WHITE)
|
|
|
|
|
0.01, new IsotropicMaterial(ColorRGB.WHITE, cs)
|
|
|
|
|
)
|
|
|
|
|
)),
|
|
|
|
|
SimpleCamera.builder()
|
|
|
|
@ -215,10 +228,11 @@ public class Examples {
|
|
|
|
|
public static @NotNull Example getCornellBoxSphere(int height) {
|
|
|
|
|
if (height <= 0) height = 600;
|
|
|
|
|
|
|
|
|
|
var red = new LambertianMaterial(new Color(.65, .05, .05));
|
|
|
|
|
var white = new LambertianMaterial(new Color(.73, .73, .73));
|
|
|
|
|
var green = new LambertianMaterial(new Color(.12, .45, .15));
|
|
|
|
|
var light = new DiffuseLight(new Color(7.0, 7.0, 7.0));
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
var red = new LambertianMaterial(new ColorRGB(.65, .05, .05), cs);
|
|
|
|
|
var white = new LambertianMaterial(new ColorRGB(.73, .73, .73), cs);
|
|
|
|
|
var green = new LambertianMaterial(new ColorRGB(.12, .45, .15), cs);
|
|
|
|
|
var light = new DiffuseLight(new ColorRGB(7.0, 7.0, 7.0), cs);
|
|
|
|
|
var glass = new DielectricMaterial(1.5);
|
|
|
|
|
|
|
|
|
|
var room = new Box(new Vec3(0, 0, 0), new Vec3(555, 555, 555), white, white, red, green, white, null);
|
|
|
|
@ -242,17 +256,18 @@ public class Examples {
|
|
|
|
|
public static @NotNull Example getDiagramm(int height) {
|
|
|
|
|
if (height <= 0) height = 450;
|
|
|
|
|
|
|
|
|
|
record Partei(String name, Color color, double stimmen) { }
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
record Partei(String name, ColorRGB color, double stimmen) { }
|
|
|
|
|
var data = List.of(
|
|
|
|
|
new Partei("CDU", new Color(0x00, 0x4B, 0x76), 18.9),
|
|
|
|
|
new Partei("SPD", new Color(0xC0, 0x00, 0x3C), 25.7),
|
|
|
|
|
new Partei("AfD", new Color(0x80, 0xCD, 0xEC), 10.3),
|
|
|
|
|
new Partei("FDP", new Color(0xF7, 0xBB, 0x3D), 11.5),
|
|
|
|
|
new Partei("DIE LINKE", new Color(0x5F, 0x31, 0x6E), 4.9),
|
|
|
|
|
new Partei("GRÜNE", new Color(0x00, 0x85, 0x4A), 14.8),
|
|
|
|
|
new Partei("CSU", new Color(0x00, 0x77, 0xB6), 5.2)
|
|
|
|
|
new Partei("CDU", new ColorRGB(0x00, 0x4B, 0x76), 18.9),
|
|
|
|
|
new Partei("SPD", new ColorRGB(0xC0, 0x00, 0x3C), 25.7),
|
|
|
|
|
new Partei("AfD", new ColorRGB(0x80, 0xCD, 0xEC), 10.3),
|
|
|
|
|
new Partei("FDP", new ColorRGB(0xF7, 0xBB, 0x3D), 11.5),
|
|
|
|
|
new Partei("DIE LINKE", new ColorRGB(0x5F, 0x31, 0x6E), 4.9),
|
|
|
|
|
new Partei("GRÜNE", new ColorRGB(0x00, 0x85, 0x4A), 14.8),
|
|
|
|
|
new Partei("CSU", new ColorRGB(0x00, 0x77, 0xB6), 5.2)
|
|
|
|
|
);
|
|
|
|
|
var white = new LambertianMaterial(new Color(.99, .99, .99));
|
|
|
|
|
var white = new LambertianMaterial(new ColorRGB(.99, .99, .99), cs);
|
|
|
|
|
|
|
|
|
|
var count = data.size();
|
|
|
|
|
var size = 75d;
|
|
|
|
@ -272,12 +287,12 @@ public class Examples {
|
|
|
|
|
objects.add(new Box(
|
|
|
|
|
new Vec3((i + 1) * spacing + i * size, 0, spacing),
|
|
|
|
|
new Vec3((i + 1) * spacing + (i + 1) * size, partei.stimmen() * 15, spacing + size),
|
|
|
|
|
new DielectricMaterial(1.5, partei.color())
|
|
|
|
|
new DielectricMaterial(1.5, partei.color(), cs)
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new Example(
|
|
|
|
|
new Scene(new Color(1.25, 1.25, 1.25), objects),
|
|
|
|
|
new Scene(cs.illuminant().scale(1.25), objects),
|
|
|
|
|
SimpleCamera.builder()
|
|
|
|
|
.withImage(height * 16 / 9, height)
|
|
|
|
|
.withPosition(new Vec3(700, 250, 800))
|
|
|
|
@ -292,7 +307,7 @@ public class Examples {
|
|
|
|
|
|
|
|
|
|
return new Example(
|
|
|
|
|
new Scene(getSkyBox(), List.of(
|
|
|
|
|
new Sphere(Vec3.ZERO, 2, new LambertianMaterial(new ImageTexture("/eu/jonahbauer/raytracing/textures/earthmap.jpg")))
|
|
|
|
|
new Sphere(Vec3.ZERO, 2, new LambertianMaterial(new ImageTexture("earthmap.jpg", ColorSpaces.sRGB)))
|
|
|
|
|
)),
|
|
|
|
|
SimpleCamera.builder()
|
|
|
|
|
.withImage(height * 16 / 9, height)
|
|
|
|
@ -325,12 +340,13 @@ public class Examples {
|
|
|
|
|
public static @NotNull Example getFinal(int height) {
|
|
|
|
|
if (height <= 0) height = 400;
|
|
|
|
|
|
|
|
|
|
var cs = ColorSpaces.sRGB;
|
|
|
|
|
var objects = new ArrayList<Hittable>();
|
|
|
|
|
var random = new Random(1);
|
|
|
|
|
|
|
|
|
|
// boxes
|
|
|
|
|
var boxes = new ArrayList<Hittable>();
|
|
|
|
|
var ground = new LambertianMaterial(new Color(0.48, 0.83, 0.53));
|
|
|
|
|
var ground = new LambertianMaterial(new ColorRGB(0.48, 0.83, 0.53), cs);
|
|
|
|
|
for (int i = 0; i < 20; i++) {
|
|
|
|
|
for (int j = 0; j < 20; j++) {
|
|
|
|
|
var w = 100.0;
|
|
|
|
@ -348,31 +364,31 @@ public class Examples {
|
|
|
|
|
// light
|
|
|
|
|
objects.add(new Parallelogram(
|
|
|
|
|
new Vec3(123, 554, 147), new Vec3(300, 0, 0), new Vec3(0, 0, 265),
|
|
|
|
|
new DiffuseLight(new Color(7., 7., 7.))
|
|
|
|
|
new DiffuseLight(new ColorRGB(7., 7., 7.), cs)
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
// spheres with different materials
|
|
|
|
|
objects.add(new Sphere(new Vec3(400, 400, 200), 50, new LambertianMaterial(new Color(0.7, 0.3, 0.1))));
|
|
|
|
|
objects.add(new Sphere(new Vec3(400, 400, 200), 50, new LambertianMaterial(new ColorRGB(0.7, 0.3, 0.1), cs)));
|
|
|
|
|
objects.add(new Sphere(new Vec3(260, 150, 45), 50, new DielectricMaterial(1.5)));
|
|
|
|
|
objects.add(new Sphere(new Vec3(0, 150, 145), 50, new MetallicMaterial(new Color(0.8, 0.8, 0.9), 1.0)));
|
|
|
|
|
objects.add(new Sphere(new Vec3(0, 150, 145), 50, new MetallicMaterial(new ColorRGB(0.8, 0.8, 0.9), cs, 1.0)));
|
|
|
|
|
|
|
|
|
|
// glass sphere filled with gas
|
|
|
|
|
var boundary = new Sphere(new Vec3(360, 150, 145), 70, new DielectricMaterial(1.5));
|
|
|
|
|
objects.add(boundary);
|
|
|
|
|
objects.add(new ConstantMedium(boundary, 0.2, new IsotropicMaterial(new Color(0.2, 0.4, 0.9))));
|
|
|
|
|
objects.add(new ConstantMedium(boundary, 0.2, new IsotropicMaterial(new ColorRGB(0.2, 0.4, 0.9), cs)));
|
|
|
|
|
|
|
|
|
|
// put the world in a glass sphere
|
|
|
|
|
objects.add(new ConstantMedium(
|
|
|
|
|
new Sphere(new Vec3(0, 0, 0), 5000, new DielectricMaterial(1.5)),
|
|
|
|
|
0.0001, new IsotropicMaterial(new Color(1., 1., 1.))
|
|
|
|
|
0.0001, new IsotropicMaterial(new ColorRGB(1., 1., 1.), cs)
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
// textures spheres
|
|
|
|
|
objects.add(new Sphere(new Vec3(400, 200, 400), 100, new LambertianMaterial(new ImageTexture("/eu/jonahbauer/raytracing/textures/earthmap.jpg"))));
|
|
|
|
|
objects.add(new Sphere(new Vec3(400, 200, 400), 100, new LambertianMaterial(new ImageTexture("earthmap.jpg", cs))));
|
|
|
|
|
objects.add(new Sphere(new Vec3(220, 280, 300), 80, new LambertianMaterial(new PerlinTexture(0.2))));
|
|
|
|
|
|
|
|
|
|
// box from spheres
|
|
|
|
|
var white = new LambertianMaterial(new Color(.73, .73, .73));
|
|
|
|
|
var white = new LambertianMaterial(new ColorRGB(.73, .73, .73), cs);
|
|
|
|
|
var spheres = new ArrayList<Hittable>();
|
|
|
|
|
for (int j = 0; j < 1000; j++) {
|
|
|
|
|
spheres.add(new Sphere(new Vec3(random.nextDouble(165), random.nextDouble(165), random.nextDouble(165)), 10, white));
|
|
|
|
@ -391,6 +407,9 @@ public class Examples {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static @NotNull SkyBox getSkyBox() {
|
|
|
|
|
return SkyBox.gradient(new Color(0.5, 0.7, 1.0), Color.WHITE);
|
|
|
|
|
return SkyBox.gradient(
|
|
|
|
|
new RGBIlluminantSpectrum(ColorSpaces.sRGB, new ColorRGB(0.5, 0.7, 1.0)),
|
|
|
|
|
ColorSpaces.sRGB.illuminant()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|