MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / setupMaterialGallery

Function setupMaterialGallery

examples/renderer-test/main.ts:265–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

263// difference will be immediately visible on these spheres.
264
265function setupMaterialGallery(): void {
266 const roughSteps = [0.05, 0.15, 0.3, 0.45, 0.6, 0.8, 1.0];
267
268 // Row colors [r, g, b] and metalness
269 // Metals (metalness=1): reflections, Fresnel, specular color = albedo
270 // Dielectrics (metalness=0): diffuse dominant, white specular
271 const rows: number[][] = [
272 // R G B metal
273 [1.00, 0.76, 0.33, 1.0], // Gold
274 [0.95, 0.64, 0.54, 1.0], // Copper
275 [0.91, 0.92, 0.92, 1.0], // Silver / Chrome
276 [0.80, 0.05, 0.05, 0.0], // Red plastic
277 [0.90, 0.88, 0.82, 0.0], // White ceramic
278 ];
279
280 // Pedestal under the gallery
281 placeCube(0, -0.15, 0, 14, 0.3, 10, 0.15, 0.15, 0.17, 0.9, 0.0);
282
283 for (let row = 0; row < 5; row = row + 1) {
284 const mat = rows[row];
285 for (let col = 0; col < 7; col = col + 1) {
286 const x = (col - 3) * 1.8;
287 const z = (row - 2) * 1.8;
288 placeSphere(x, 0.6, z, 1.0, mat[0], mat[1], mat[2], roughSteps[col], mat[3]);
289 }
290 }
291}
292
293// ============================================================
294// Zone 2: Multi-Light Arena (centered at x=28)

Callers 1

main.tsFile · 0.85

Calls 2

placeCubeFunction · 0.85
placeSphereFunction · 0.85

Tested by

no test coverage detected