Skip to content

Commit bdfa5b2

Browse files
fixed problem with greased line colours by using actual pbr materials
1 parent 8cb7584 commit bdfa5b2

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/dev/babylonjs/lib/api/bitbybit/draw.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export class Draw extends DrawCore {
4949
* @group draw async
5050
* @shortname draw async void
5151
* @disposableOutput true
52+
* @drawable true
5253
*/
5354
async drawAnyAsyncNoReturn(inputs: Inputs.Draw.DrawAny): Promise<void> {
5455
this.drawAnyAsync(inputs);
@@ -60,6 +61,7 @@ export class Draw extends DrawCore {
6061
* @returns BabylonJS Mesh Promise
6162
* @group draw async
6263
* @shortname draw async
64+
* @drawable true
6365
* @disposableOutput true
6466
*/
6567
async drawAnyAsync(inputs: Inputs.Draw.DrawAny): Promise<BABYLON.Mesh> {

packages/dev/babylonjs/lib/api/draw-helper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,13 @@ export class DrawHelper extends DrawHelperCore {
362362
},
363363
{
364364
width,
365+
materialType: BABYLON.GreasedLineMeshMaterialType.MATERIAL_TYPE_PBR,
365366
color,
366-
367+
createAndAssignMaterial: true,
367368
},
368369
this.context.scene
369370
);
371+
(result.material as BABYLON.PBRMaterial).albedoColor = color;
370372
result.material.alpha = visibility;
371373
return result as BABYLON.GreasedLineMesh;
372374
}

0 commit comments

Comments
 (0)