From 5377f1fe8f974736aaf7b62040028c51a6db438b Mon Sep 17 00:00:00 2001 From: Yuki Shimada Date: Sat, 21 Dec 2024 20:47:27 +0900 Subject: [PATCH] change the position of `#define RN_MATERIAL_TYPE_NAME ${materialTypeName}\n` --- src/foundation/materials/core/ShaderHandler.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/foundation/materials/core/ShaderHandler.ts b/src/foundation/materials/core/ShaderHandler.ts index 083764d87..3d26265b3 100644 --- a/src/foundation/materials/core/ShaderHandler.ts +++ b/src/foundation/materials/core/ShaderHandler.ts @@ -131,9 +131,7 @@ export function _createProgramAsSingleOperationWebGL( const webglResourceRepository = CGAPIResourceRepository.getWebGLResourceRepository(); const materialNode = material._materialContent; - const materialTypeName = material.materialTypeName; - let definitions = `#define RN_MATERIAL_TYPE_NAME ${materialTypeName}\n`; - definitions += materialNode.getDefinitions(); + let definitions = materialNode.getDefinitions(); const shaderDefines = material.getShaderDefines(); for (const shaderDefine of shaderDefines) { definitions += `#define ${shaderDefine}\n`; @@ -209,6 +207,7 @@ export function _setupGlobalShaderDefinitionWebGL(materialTypeName: string, prim definitions += '#define RN_IS_UBO_ENABLED\n'; } } + definitions += `#define RN_MATERIAL_TYPE_NAME ${materialTypeName}\n`; if (ProcessApproach.isDataTextureApproach(SystemState.currentProcessApproach)) { definitions += '#define RN_IS_DATATEXTURE_MODE\n'; } else {