package eu.jonahbauer.raytracing.render.material;

import eu.jonahbauer.raytracing.math.Ray;
import eu.jonahbauer.raytracing.render.texture.Color;
import eu.jonahbauer.raytracing.render.texture.Texture;
import eu.jonahbauer.raytracing.scene.HitResult;
import org.jetbrains.annotations.NotNull;

import java.util.Optional;
import java.util.random.RandomGenerator;

public record DiffuseLight(@NotNull Texture texture) implements Material {
    @Override
    public @NotNull Optional<ScatterResult> scatter(@NotNull Ray ray, @NotNull HitResult hit, @NotNull RandomGenerator random) {
        return Optional.empty();
    }

    @Override
    public @NotNull Color emitted(@NotNull HitResult hit) {
        return texture.get(hit);
    }
}
