From 61866272dcd7bd8a88c23faf55982b91a3ff34b3 Mon Sep 17 00:00:00 2001 From: hhhhkrx Date: Fri, 19 Jul 2024 22:27:08 +0800 Subject: [PATCH] refactor: shader name --- .../custom-material/src/advanced-shader/eye/Eye.gs | 2 +- .../src/advanced-shader/eye/EyeFunction.glsl | 10 +++++----- .../custom-material/src/advanced-shader/hair/Hair.gs | 8 ++++---- .../src/advanced-shader/hair/HairFunction.glsl | 8 ++++---- .../src/advanced-shader/hair/HairLightDirect.glsl | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/custom-material/src/advanced-shader/eye/Eye.gs b/packages/custom-material/src/advanced-shader/eye/Eye.gs index 89bddbfd..0ced413f 100644 --- a/packages/custom-material/src/advanced-shader/eye/Eye.gs +++ b/packages/custom-material/src/advanced-shader/eye/Eye.gs @@ -8,7 +8,7 @@ Shader "/eyes/Eye.gs" { material_ScleraNormalStrength("Sclera NormalStrength", Range(0, 5, 0.01)) = 1; material_ScleraTexture("Sclera Texture", Texture2D); material_ScleraNormal("Sclera NormalTexture", Texture2D); - material_Scleramask("Sclera Mask", Texture2D); + material_ScleraMask("Sclera Mask", Texture2D); } diff --git a/packages/custom-material/src/advanced-shader/eye/EyeFunction.glsl b/packages/custom-material/src/advanced-shader/eye/EyeFunction.glsl index 5345f345..0fa63b7d 100644 --- a/packages/custom-material/src/advanced-shader/eye/EyeFunction.glsl +++ b/packages/custom-material/src/advanced-shader/eye/EyeFunction.glsl @@ -17,7 +17,7 @@ vec4 material_IrisColor; #endif #ifdef MATERIAL_HAS_SCLERA_MASK - sampler2D material_Scleramask; + sampler2D material_ScleraMask; #endif #ifdef MATERIAL_HAS_IRIS_TEXTURE @@ -66,9 +66,9 @@ vec3 calculateEyeColor(Varyings varyings, mat3 tbn) // Get Mask float heighttexture = 0.0; #ifdef MATERIAL_HAS_SCLERA_MASK - vec3 irismasktex = (texture2D(material_Scleramask, irisSizeUV)).rgb; - float uvmask = 1.0 - (texture2D(material_Scleramask, varyings.uv )).b; - heighttexture = 1.0 - (texture2D(material_Scleramask, parallaxUV)).b; + vec3 irismasktex = (texture2D(material_ScleraMask, irisSizeUV)).rgb; + float uvmask = 1.0 - (texture2D(material_ScleraMask, varyings.uv )).b; + heighttexture = 1.0 - (texture2D(material_ScleraMask, parallaxUV)).b; #else vec3 irismasktex = vec3(1.0); float uvmask = 1.0; @@ -112,7 +112,7 @@ vec3 calculateEyeNormal(Varyings varyings, mat3 tbn, bool isFrontFacing) vec2 irisSizeUV = (varyings.uv * material_IrisSize) - ((material_IrisSize-1.0)/2.0); #ifdef MATERIAL_HAS_SCLERA_MASK - vec3 irismasktex = (texture2D(material_Scleramask, irisSizeUV)).rgb; + vec3 irismasktex = (texture2D(material_ScleraMask, irisSizeUV)).rgb; #else vec3 irismasktex = vec3(1.0); #endif diff --git a/packages/custom-material/src/advanced-shader/hair/Hair.gs b/packages/custom-material/src/advanced-shader/hair/Hair.gs index caa94e90..3be8aa81 100644 --- a/packages/custom-material/src/advanced-shader/hair/Hair.gs +++ b/packages/custom-material/src/advanced-shader/hair/Hair.gs @@ -15,10 +15,10 @@ Shader "hair/hair.gs" { Header("HairAnisotropy") { material_HairFirstWidth("HairFirstWidth", Range(0, 15, 0.01)) = 1; material_HairSecondWidth("HairSecondWidth", Range(0, 15, 0.01)) = 1; - material_HairsFirststrength("HairsFirstrength", Range(0, 5, 0.01)) = 1; - material_HairsSecondstrength("HairsSecondstrength", Range(0, 5, 0.01)) = 1; - material_HairFirstOffest("HairFirstOffest", Range(-1, 5, 0.01)) = 1; - material_HairSecondOffest("HairSecondOffest", Range(-1, 5, 0.01)) = 1; + material_HairFirstStrength("HairsFirstrength", Range(0, 5, 0.01)) = 1; + material_HairSecondStrength("HairsSecondstrength", Range(0, 5, 0.01)) = 1; + material_HairFirstOffset("HairFirstOffest", Range(-1, 5, 0.01)) = 1; + material_HairSecondOffset("HairSecondOffest", Range(-1, 5, 0.01)) = 1; material_HairFirstColor("HairFirstColor", Color) = (1,1,1,1); material_HairSecondColor("HairSecondColor", Color) = (1,1,1,1); material_HairAnisotropyTexture("HairAnisotropyTexture", Texture2D); diff --git a/packages/custom-material/src/advanced-shader/hair/HairFunction.glsl b/packages/custom-material/src/advanced-shader/hair/HairFunction.glsl index 5714aa9d..d73324f4 100644 --- a/packages/custom-material/src/advanced-shader/hair/HairFunction.glsl +++ b/packages/custom-material/src/advanced-shader/hair/HairFunction.glsl @@ -1,9 +1,9 @@ float material_HairFirstWidth; float material_HairSecondWidth; -float material_HairsFirststrength; -float material_HairsSecondstrength; -float material_HairFirstOffest; -float material_HairSecondOffest; +float material_HairFirstStrength; +float material_HairSecondStrength; +float material_HairFirstOffset; +float material_HairSecondOffset; vec4 material_HairFirstColor; vec4 material_HairSecondColor; diff --git a/packages/custom-material/src/advanced-shader/hair/HairLightDirect.glsl b/packages/custom-material/src/advanced-shader/hair/HairLightDirect.glsl index 3ff46d34..751ad376 100644 --- a/packages/custom-material/src/advanced-shader/hair/HairLightDirect.glsl +++ b/packages/custom-material/src/advanced-shader/hair/HairLightDirect.glsl @@ -15,14 +15,14 @@ void specularLobe_hair(Varyings varyings, SurfaceData surfaceData, BRDFData brdf float shift = 1.0; #endif - vec3 shiftTangent1 = shiftTangent(worldbitangentDir, surfaceData.normal, shift + material_HairFirstOffest); - vec3 shiftTangent2 = shiftTangent(worldbitangentDir, surfaceData.normal, shift + material_HairSecondOffest); + vec3 shiftTangent1 = shiftTangent(worldbitangentDir, surfaceData.normal, shift + material_HairFirstOffset); + vec3 shiftTangent2 = shiftTangent(worldbitangentDir, surfaceData.normal, shift + material_HairSecondOffset); vec3 firstcol = material_HairFirstColor.rgb; - vec3 firstSpecular = firstcol * anisotropySpecular(surfaceData, incidentDirection, material_HairFirstWidth*15.0, material_HairsFirststrength, shiftTangent1); + vec3 firstSpecular = firstcol * anisotropySpecular(surfaceData, incidentDirection, material_HairFirstWidth*15.0, material_HairFirstStrength, shiftTangent1); vec3 secondcol = material_HairSecondColor.rgb; - vec3 secondSpecular = secondcol * anisotropySpecular(surfaceData, incidentDirection, material_HairSecondWidth*15.0, material_HairsSecondstrength, shiftTangent2); + vec3 secondSpecular = secondcol * anisotropySpecular(surfaceData, incidentDirection, material_HairSecondWidth*15.0, material_HairSecondStrength, shiftTangent2); vec3 hairSpecular = clamp(firstSpecular + secondSpecular, 0.0, 1.0);