Skip to content

Commit

Permalink
fix: shader name
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhhkrx committed Dec 11, 2024
1 parent f550f37 commit 1e76033
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions packages/shaderlab/src/shaders/PBR.gs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ Shader "PBR.gs" {
}

Header("Sheen"){
material_Sheen("SheenIntensity", Range(0, 1, 0.01)) = 0;
material_SheenColor("SheenColor", Color ) = (0, 0, 0, 0);
material_SheenRoughness("SheenRoughness", Range(0, 1, 0.01)) = 0;
material_SheenTexture("SheenTexture", Texture2D);
material_SheenRoughnessTexture("SheenRoughnessTexture", Texture2D);
UI_SheenIntensity("Intensity", Range(0, 1, 0.01)) = 0;
UI_SheenColor("Color", Color ) = (0, 0, 0, 0);
material_SheenRoughness("Roughness", Range(0, 1, 0.01)) = 0;
material_SheenTexture("ColorTexture", Texture2D);
material_SheenRoughnessTexture("RoughnessTexture", Texture2D);
}

Header("Common") {
Expand Down
13 changes: 6 additions & 7 deletions packages/shaderlab/src/shaders/shadingPBR/FragmentPBR.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ float material_OcclusionTextureCoord;

#ifdef MATERIAL_ENABLE_SHEEN
float material_SheenRoughness;
vec4 material_SheenColor;
vec3 material_SheenColor;
#ifdef MATERIAL_HAS_SHEEN_TEXTURE
sampler2D material_SheenTexture;
#endif
Expand Down Expand Up @@ -276,16 +276,15 @@ SurfaceData getSurfaceData(Varyings v, vec2 aoUV, bool isFrontFacing){
#endif

#ifdef MATERIAL_ENABLE_SHEEN
float sheen = material_SheenColor.a;
vec3 sheencolor = material_SheenColor.rgb * sheen;
vec3 sheenColor = material_SheenColor.rgb;
#ifdef MATERIAL_HAS_SHEEN_TEXTURE
vec4 sheenTexturecolor = texture2D(material_SheenTexture, uv);
vec4 sheenTextureColor = texture2D(material_SheenTexture, uv);
#ifndef ENGINE_IS_COLORSPACE_GAMMA
sheenTexturecolor = gammaToLinear(sheenTexturecolor);
sheenTextureColor = gammaToLinear(sheenTextureColor);
#endif
sheencolor *= sheenTexturecolor.rgb;
sheenColor *= sheenTextureColor.rgb;
#endif
surfaceData.sheenColor = sheencolor;
surfaceData.sheenColor = sheenColor;

surfaceData.sheenRoughness = material_SheenRoughness;
#ifdef MATERIAL_HAS_SHEEN_ROUGHNESS_TEXTURE
Expand Down

0 comments on commit 1e76033

Please sign in to comment.