Compare commits
2 Commits
main
...
0a57ea0ad7
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a57ea0ad7 | |||
| 8584b5163d |
6
package-lock.json
generated
6
package-lock.json
generated
@@ -11673,9 +11673,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/qs": {
|
"node_modules/qs": {
|
||||||
"version": "6.14.1",
|
"version": "6.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz",
|
||||||
"integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",
|
"integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export const routes: Routes = [
|
|||||||
{ path: RouterConstants.GOL.PATH, component: RouterConstants.GOL.COMPONENT},
|
{ path: RouterConstants.GOL.PATH, component: RouterConstants.GOL.COMPONENT},
|
||||||
{ path: RouterConstants.LABYRINTH.PATH, component: RouterConstants.LABYRINTH.COMPONENT},
|
{ path: RouterConstants.LABYRINTH.PATH, component: RouterConstants.LABYRINTH.COMPONENT},
|
||||||
{ path: RouterConstants.FRACTAL.PATH, component: RouterConstants.FRACTAL.COMPONENT},
|
{ path: RouterConstants.FRACTAL.PATH, component: RouterConstants.FRACTAL.COMPONENT},
|
||||||
{ path: RouterConstants.FRACTAL3d.PATH, component: RouterConstants.FRACTAL3d.COMPONENT}
|
{ path: RouterConstants.FRACTAL3d.PATH, component: RouterConstants.FRACTAL3d.COMPONENT},
|
||||||
|
{ path: RouterConstants.PATH_TRACING.PATH, component: RouterConstants.PATH_TRACING.COMPONENT}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {ConwayGolComponent} from '../pages/algorithms/conway-gol/conway-gol.comp
|
|||||||
import {LabyrinthComponent} from '../pages/algorithms/pathfinding/labyrinth/labyrinth.component';
|
import {LabyrinthComponent} from '../pages/algorithms/pathfinding/labyrinth/labyrinth.component';
|
||||||
import {FractalComponent} from '../pages/algorithms/fractal/fractal.component';
|
import {FractalComponent} from '../pages/algorithms/fractal/fractal.component';
|
||||||
import {Fractal3dComponent} from '../pages/algorithms/fractal3d/fractal3d.component';
|
import {Fractal3dComponent} from '../pages/algorithms/fractal3d/fractal3d.component';
|
||||||
|
import {PathTracingComponent} from '../pages/algorithms/path-tracing/path-tracing.component';
|
||||||
|
|
||||||
export class RouterConstants {
|
export class RouterConstants {
|
||||||
|
|
||||||
@@ -65,6 +66,12 @@ export class RouterConstants {
|
|||||||
COMPONENT: Fractal3dComponent
|
COMPONENT: Fractal3dComponent
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static readonly PATH_TRACING = {
|
||||||
|
PATH: 'algorithms/pathtracing',
|
||||||
|
LINK: '/algorithms/pathtracing',
|
||||||
|
COMPONENT: PathTracingComponent
|
||||||
|
};
|
||||||
|
|
||||||
static readonly IMPRINT = {
|
static readonly IMPRINT = {
|
||||||
PATH: 'imprint',
|
PATH: 'imprint',
|
||||||
LINK: '/imprint',
|
LINK: '/imprint',
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<mat-card class="container">
|
||||||
|
<mat-card-header>
|
||||||
|
<mat-card-title>{{ 'PATH_TRACING.TITLE' | translate }}</mat-card-title>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content>
|
||||||
|
<app-information [algorithmInformation]="algoInformation"/>
|
||||||
|
<app-babylon-canvas
|
||||||
|
[config]="fractalConfig"
|
||||||
|
[renderCallback]="onRender"
|
||||||
|
/>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
10
src/app/pages/algorithms/path-tracing/path-tracing.shader.ts
Normal file
10
src/app/pages/algorithms/path-tracing/path-tracing.shader.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export const PATH_TRACING_VERTEX_SHADER = /* glsl */`
|
||||||
|
attribute vec3 position;
|
||||||
|
attribute vec2 uv;
|
||||||
|
varying vec2 vUV;
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
gl_Position = vec4(position, 1.0);
|
||||||
|
vUV = uv;
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -44,6 +44,12 @@ export class AlgorithmsService {
|
|||||||
title: 'ALGORITHM.FRACTAL3D.TITLE',
|
title: 'ALGORITHM.FRACTAL3D.TITLE',
|
||||||
description: 'ALGORITHM.FRACTAL3D.DESCRIPTION',
|
description: 'ALGORITHM.FRACTAL3D.DESCRIPTION',
|
||||||
routerLink: RouterConstants.FRACTAL3d.LINK
|
routerLink: RouterConstants.FRACTAL3d.LINK
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'pathTracing',
|
||||||
|
title: 'ALGORITHM.PATH_TRACING.TITLE',
|
||||||
|
description: 'ALGORITHM.PATH_TRACING.DESCRIPTION',
|
||||||
|
routerLink: RouterConstants.PATH_TRACING.LINK
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -415,6 +415,9 @@
|
|||||||
"DISCLAIMER_4": "Licht & Schatten: Um die Tiefe sichtbar zu machen, werden Lichtreflexionen und Schatten (Ambient Occlusion) basierend auf der Krümmung der Formel simuliert."
|
"DISCLAIMER_4": "Licht & Schatten: Um die Tiefe sichtbar zu machen, werden Lichtreflexionen und Schatten (Ambient Occlusion) basierend auf der Krümmung der Formel simuliert."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"PATH_TRACING": {
|
||||||
|
"TITLE": "Path Tracing"
|
||||||
|
},
|
||||||
"ALGORITHM": {
|
"ALGORITHM": {
|
||||||
"TITLE": "Algorithmen",
|
"TITLE": "Algorithmen",
|
||||||
"PATHFINDING": {
|
"PATHFINDING": {
|
||||||
@@ -441,6 +444,10 @@
|
|||||||
"TITLE": "Fraktale 3D",
|
"TITLE": "Fraktale 3D",
|
||||||
"DESCRIPTION": "3D-Visualisierung von komplexe, geometrische Mustern, die sich selbst in immer kleineren Maßstäben ähneln (Selbstähnlichkeit)."
|
"DESCRIPTION": "3D-Visualisierung von komplexe, geometrische Mustern, die sich selbst in immer kleineren Maßstäben ähneln (Selbstähnlichkeit)."
|
||||||
},
|
},
|
||||||
|
"PATH_TRACING": {
|
||||||
|
"TITLE": "Path Tracing ",
|
||||||
|
"DESCRIPTION": "Path Tracing ist ein Algorithmus zur Bildsynthese, der die Simulation der globalen Beleuchtung ermöglicht."
|
||||||
|
},
|
||||||
"NOTE": "HINWEIS",
|
"NOTE": "HINWEIS",
|
||||||
"GRID_HEIGHT": "Höhe",
|
"GRID_HEIGHT": "Höhe",
|
||||||
"GRID_WIDTH": "Beite"
|
"GRID_WIDTH": "Beite"
|
||||||
|
|||||||
@@ -414,6 +414,9 @@
|
|||||||
"DISCLAIMER_4": "Light & Shadow: To visualize depth, light reflections and shadows (Ambient Occlusion) are simulated based on the curvature of the formula."
|
"DISCLAIMER_4": "Light & Shadow: To visualize depth, light reflections and shadows (Ambient Occlusion) are simulated based on the curvature of the formula."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"PATH_TRACING": {
|
||||||
|
"TITLE": "Path Tracing"
|
||||||
|
},
|
||||||
"ALGORITHM": {
|
"ALGORITHM": {
|
||||||
"TITLE": "Algorithms",
|
"TITLE": "Algorithms",
|
||||||
"PATHFINDING": {
|
"PATHFINDING": {
|
||||||
@@ -440,6 +443,10 @@
|
|||||||
"TITLE": "Fractals 3D",
|
"TITLE": "Fractals 3D",
|
||||||
"DESCRIPTION": "3D Visualisation of complex geometric patterns that resemble each other on increasingly smaller scales (self-similarity)."
|
"DESCRIPTION": "3D Visualisation of complex geometric patterns that resemble each other on increasingly smaller scales (self-similarity)."
|
||||||
},
|
},
|
||||||
|
"PATH_TRACING": {
|
||||||
|
"TITLE": "Path Tracing ",
|
||||||
|
"DESCRIPTION": "Path tracing is a rendering algorithm in computer graphics that simulates how light interacts with objects, voxels, and participating media to generate realistic (physically plausible) images."
|
||||||
|
},
|
||||||
"NOTE": "Note",
|
"NOTE": "Note",
|
||||||
"GRID_HEIGHT": "Height",
|
"GRID_HEIGHT": "Height",
|
||||||
"GRID_WIDTH": "Width"
|
"GRID_WIDTH": "Width"
|
||||||
|
|||||||
Reference in New Issue
Block a user