import { Component } from '@angular/core';
import {BabylonCanvas, RenderCallback, RenderConfig} from '../../../shared/rendering/canvas/babylon-canvas.component';
import {Information} from '../information/information';
import {MatCard, MatCardContent, MatCardHeader, MatCardTitle} from '@angular/material/card';
import {TranslatePipe} from '@ngx-translate/core';
import {AlgorithmInformation} from '../information/information.models';
import {PATH_TRACING_VERTEX_SHADER} from './path-tracing.shader';

@Component({
  selector: 'app-path-tracing',
  imports: [
    BabylonCanvas,
    Information,
    MatCard,
    MatCardContent,
    MatCardHeader,
    MatCardTitle,
    TranslatePipe
  ],
  templateUrl: './path-tracing.component.html',
  styleUrl: './path-tracing.component.scss',
})
export class PathTracingComponent {

  algoInformation: AlgorithmInformation = {
    title: '',
    entries: [
    ],
    disclaimer: '',
    disclaimerBottom: '',
    disclaimerListEntry: ['']
  };

  fractalConfig: RenderConfig = {
    mode: '3D',
    initialViewSize: 4,
    vertexShader: PATH_TRACING_VERTEX_SHADER,
    fragmentShader: '',
    uniformNames: ["time", "power", "fractalType"]
  };

  private time = 0;

  onRender: RenderCallback = () => {
    this.time += 0.005;
  };

}
