Skip to content

Commit 68ecf8b

Browse files
committed
Added credits
1 parent 0c93a3d commit 68ecf8b

File tree

3 files changed

+14
-177
lines changed

3 files changed

+14
-177
lines changed
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ export class SimpleIntegration {
2020
private frameCount: number = 0;
2121
private lastFrameNumber: number = 0;
2222
private debugVisualization: DebugVisualization;
23+
private addedCredits: Set<string> = new Set();
24+
25+
private addCreditToHTML(credit: any): void {
26+
const creditText = credit.text || credit.html || credit.toString();
27+
if (creditText && !this.addedCredits.has(creditText)) {
28+
this.addedCredits.add(creditText);
29+
const comment = document.createComment(` Credit: ${creditText} `);
30+
document.head.appendChild(comment);
31+
}
32+
}
2333

2434
constructor(babylonScene: any, camera: Camera, engine: Engine) {
2535
this.camera = camera;
@@ -201,10 +211,10 @@ export class SimpleIntegration {
201211
pass: (Cesium as any).Pass ? (Cesium as any).Pass.RENDER : 0,
202212
// Let Cesium use its default maximumScreenSpaceError for Google tiles
203213
tilesetPassState: this.renderTilesetPassState, // Required by CesiumTilesetDerived
204-
// CREDIT DISPLAY: Disabled to prevent image downloads
214+
// CREDIT DISPLAY: Add credits as HTML comments once
205215
creditDisplay: {
206-
addCreditToNextFrame: (_credit: any) => {
207-
// Don't process credits to avoid downloading credit images
216+
addCreditToNextFrame: (credit: any) => {
217+
this.addCreditToHTML(credit);
208218
},
209219
},
210220
// Additional properties from working commit 72dfb2e:

src/cesium3DTilesetConfig.ts

Lines changed: 0 additions & 173 deletions
This file was deleted.

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
StandardMaterial,
2020
Color3,
2121
} from '@babylonjs/core';
22-
import { SimpleIntegration } from './simpleIntegration';
22+
import { SimpleIntegration } from './SimpleIntegration';
2323
import { Cartesian3 as CesiumCartesian3, Ellipsoid } from 'cesium';
2424

2525
window.addEventListener('DOMContentLoaded', async () => {

0 commit comments

Comments
 (0)