mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
Fix the material error
This commit is contained in:
parent
1602b4c5fc
commit
9e50ea0afe
@ -68,15 +68,24 @@ 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));
|
||||||
|
|
||||||
const bitmapData = this._material.render(planeId, textureCache, hasColor ? null : canvas, width, height, normal, useTexture, offsetX, (offsetY + this.offset), (this.align === PlaneVisualizationLayer.ALIGN_TOP));
|
if(this._material)
|
||||||
|
|
||||||
if(bitmapData && hasColor)
|
|
||||||
{
|
{
|
||||||
const sprite = new Sprite(bitmapData);
|
const bitmapData = this._material.render(planeId, textureCache, hasColor ? null : canvas, width, height, normal, useTexture, offsetX, (offsetY + this.offset), (this.align === PlaneVisualizationLayer.ALIGN_TOP));
|
||||||
|
|
||||||
if(hasColor) sprite.tint = this._color;
|
if(bitmapData && hasColor)
|
||||||
|
{
|
||||||
|
const sprite = new Sprite(bitmapData);
|
||||||
|
|
||||||
textureCache.writeToRenderTexture(sprite, canvas, false);
|
if(hasColor) sprite.tint = this._color;
|
||||||
|
|
||||||
|
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