From 2aac7fe2017b627c6a6e4e2cc7d7967c58184e25 Mon Sep 17 00:00:00 2001 From: GuoLei1990 Date: Tue, 7 Dec 2021 18:07:53 +0800 Subject: [PATCH] fix: front face bug --- packages/core/src/RenderPipeline/RenderQueue.ts | 2 +- packages/core/src/shader/state/RasterState.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/RenderPipeline/RenderQueue.ts b/packages/core/src/RenderPipeline/RenderQueue.ts index fedfadf825..8c23ba65c8 100644 --- a/packages/core/src/RenderPipeline/RenderQueue.ts +++ b/packages/core/src/RenderPipeline/RenderQueue.ts @@ -137,7 +137,7 @@ export class RenderQueue { program.uploadUngroupTextures(); } } - material.renderState._apply(camera.engine,element.component.entity.transform._isFrontFaceInvert()); + material.renderState._apply(camera.engine, renderer.entity.transform._isFrontFaceInvert()); rhi.drawPrimitive(element.mesh, element.subMesh, program); } else { diff --git a/packages/core/src/shader/state/RasterState.ts b/packages/core/src/shader/state/RasterState.ts index 4c53588a2e..04672267f4 100644 --- a/packages/core/src/shader/state/RasterState.ts +++ b/packages/core/src/shader/state/RasterState.ts @@ -57,7 +57,7 @@ export class RasterState { } else { gl.frontFace(gl.CCW); } - lastState._frontFaceInvert == frontFaceInvert; + lastState._frontFaceInvert = frontFaceInvert; } // apply polygonOffset.