mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-26 17:30:52 +01:00
Fix the material error
This commit is contained in:
parent
1602b4c5fc
commit
9e50ea0afe
@ -68,6 +68,8 @@ export class PlaneVisualizationLayer
|
|||||||
const b = (this._color & 0xFF);
|
const b = (this._color & 0xFF);
|
||||||
const hasColor = ((r < 0xFF) || (g < 0xFF) || (b < 0xFF));
|
const hasColor = ((r < 0xFF) || (g < 0xFF) || (b < 0xFF));
|
||||||
|
|
||||||
|
if(this._material)
|
||||||
|
{
|
||||||
const bitmapData = this._material.render(planeId, textureCache, hasColor ? null : canvas, width, height, normal, useTexture, offsetX, (offsetY + this.offset), (this.align === PlaneVisualizationLayer.ALIGN_TOP));
|
const bitmapData = this._material.render(planeId, textureCache, hasColor ? null : canvas, width, height, normal, useTexture, offsetX, (offsetY + this.offset), (this.align === PlaneVisualizationLayer.ALIGN_TOP));
|
||||||
|
|
||||||
if(bitmapData && hasColor)
|
if(bitmapData && hasColor)
|
||||||
@ -78,6 +80,13 @@ export class PlaneVisualizationLayer
|
|||||||
|
|
||||||
textureCache.writeToRenderTexture(sprite, canvas, false);
|
textureCache.writeToRenderTexture(sprite, canvas, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const bitmapData = textureCache.createAndFillRenderTexture(width, height, planeId, this._color);
|
||||||
|
|
||||||
|
textureCache.writeToRenderTexture(new Sprite(bitmapData), canvas, false);
|
||||||
|
}
|
||||||
|
|
||||||
return canvas;
|
return canvas;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user