-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement ShaderLab PBR #2502
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Shader "PBR.gs" { | ||
EditorProperties { | ||
Shader "PBRShaderName" { | ||
Editor { | ||
Properties{ | ||
Header("Base"){ | ||
material_IOR("IOR", Range(0, 5, 0.01)) = 1.5; | ||
material_BaseColor("BaseColor", Color) = (1, 1, 1, 1); | ||
|
@@ -13,8 +14,9 @@ Shader "PBR.gs" { | |
} | ||
|
||
Header("Anisotropy") { | ||
material_AnisotropyInfo("AnisotropyInfo", Vector3) = (1, 0, 0); | ||
material_AnisotropyTexture("AnisotropyTexture", Texture2D); | ||
anisotropy("Intensity", Range(0, 1, 0.01)) = 0; | ||
anisotropyRotation("Rotation", Range(0, 360, 1)) = 0; | ||
material_AnisotropyTexture("Texture", Texture2D); | ||
} | ||
|
||
Header("Normal") { | ||
|
@@ -42,40 +44,67 @@ Shader "PBR.gs" { | |
} | ||
|
||
Header("Thin Film Iridescence"){ | ||
material_IridescenceInfo("IridescenceInfo", Vector4) = (0, 1.3, 100, 400); | ||
material_IridescenceThicknessTexture("IridescenceThicknessTexture", Texture2D); | ||
material_Iridescence("Iridescence", Range(0, 1, 0.01)) = 0; | ||
material_IridescenceIOR("IOR", Range(1, 5, 0.01)) = 1.3; | ||
material_IridescenceRange("ThicknessRange", Vector2) = (100,400); | ||
material_IridescenceThicknessTexture("ThicknessTexture", Texture2D); | ||
material_IridescenceTexture("IridescenceTexture", Texture2D); | ||
Comment on lines
+47
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Incomplete iridescence property refactoring detected The iridescence properties have been restructured in PBR.gs but the implementation hasn't been updated accordingly:
🔗 Analysis chainVerify impact of iridescence property restructuring. The iridescence properties have been significantly restructured:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for uses of old iridescence property
rg "material_IridescenceInfo"
Length of output: 872 Script: #!/bin/bash
# Search for new iridescence properties
echo "=== Searching for new properties ==="
rg "material_Iridescence[^I]" -A 2
echo -e "\n=== Searching for PBRMaterial.ts changes ==="
rg "material_Iridescence" packages/core/src/material/PBRMaterial.ts -A 2
Length of output: 3605 |
||
} | ||
|
||
Header("Sheen"){ | ||
ui_SheenIntensity("Intensity", Range(0, 1, 0.01)) = 0; | ||
ui_SheenColor("Color", Color ) = (0, 0, 0, 0); | ||
sheenColor("Color", Color ) = (0, 0, 0, 1); | ||
sheenIntensity("Intensity", Range(0, 1, 0.01)) = 1; | ||
material_SheenRoughness("Roughness", Range(0, 1, 0.01)) = 0; | ||
material_SheenTexture("ColorTexture", Texture2D); | ||
material_SheenRoughnessTexture("RoughnessTexture", Texture2D); | ||
} | ||
Header("Transmission"){ | ||
|
||
Header("Transmission") { | ||
material_Transmission("Transmission", Range(0, 1, 0.01)) = 0; | ||
material_TransmissionTexture("TransmissionTexture", Texture2D); | ||
material_AttenuationColor("AttenuationColor", Color ) = (1, 1, 1, 1); | ||
material_AttenuationDistance("AttenuationDistance", Range(0, 1, 0.01)) = 0; | ||
material_Thickness("Thickness", Range(0, 5, 0.01)) = 0; | ||
material_ThicknessTexture("ThicknessTexture", Texture2D); | ||
refractionMode("RefractionMode", Enum(Sphere:0, Planar:1)) = 1; | ||
material_AttenuationColor("AttenuationColor", Color ) = (1, 1, 1, 1); | ||
material_AttenuationDistance("AttenuationDistance", Range(0, 1, 0.01)) = 0; | ||
} | ||
|
||
Header("Common") { | ||
isTransparent("Transparent", Boolean) = false; | ||
renderFace("Render Face", Enum(Front:0, Back:1, Double:2)) = 0; | ||
blendMode("Blend Mode", Enum(Normal:0, Additive:1)) = 0; | ||
material_AlphaCutoff( "AlphaCutoff", Range(0, 1, 0.01) ) = 0; | ||
material_TilingOffset("TilingOffset", Vector4) = (1, 1, 0, 0); | ||
} | ||
} | ||
|
||
UIScript "UIScriptPath"; | ||
} | ||
|
||
SubShader "Default" { | ||
UsePass "pbr/Default/ShadowCaster" | ||
|
||
Pass "Forward Pass" { | ||
Tags { pipelineStage = "Forward"} | ||
|
||
DepthState { | ||
WriteEnabled = depthWriteEnabled; | ||
} | ||
|
||
BlendState { | ||
Enabled = blendEnabled; | ||
SourceColorBlendFactor = sourceColorBlendFactor; | ||
DestinationColorBlendFactor = destinationColorBlendFactor; | ||
SourceAlphaBlendFactor = sourceAlphaBlendFactor; | ||
DestinationAlphaBlendFactor = destinationAlphaBlendFactor; | ||
} | ||
|
||
RasterState{ | ||
CullMode = rasterStateCullMode; | ||
} | ||
|
||
RenderQueueType = renderQueueType; | ||
|
||
#define IS_METALLIC_WORKFLOW | ||
|
||
VertexShader = PBRVertex; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Property rename breaks shader functionality
The anisotropy property renames in PBR.gs are incomplete and will break the shader system. The old property names
material_AnisotropyInfo
andmaterial_AnisotropyTexture
are still used in:FragmentPBR.glsl
,pbr_frag_define.glsl
, andpbr_helper.glsl
PBRMaterial.ts
Either keep the original property names or update all references consistently across the codebase.
🔗 Analysis chain
Verify impact of anisotropy property renames.
The renaming of anisotropy properties (
material_AnisotropyInfo
→anisotropy
,material_AnisotropyTexture
name change) improves clarity but may affect existing materials.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1632