Skip to content

Commit

Permalink
chore: sync editor props
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxudong committed Jan 14, 2025
1 parent 701f50f commit a9aae8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
13 changes: 2 additions & 11 deletions packages/shader-shaderlab/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Shader, ShaderFactory } from "@galacean/engine";
import { PBRSource, fragmentList } from "./shaders";
import { ShaderFactory } from "@galacean/engine";
import { fragmentList } from "./shaders";

let includeRegistered = false;
let shaderRegistered = false;

export function registerIncludes() {
if (includeRegistered) return;
Expand All @@ -14,14 +13,6 @@ export function registerIncludes() {
includeRegistered = true;
}

export function registerShader() {
if (shaderRegistered) return;

Shader.create(PBRSource);

shaderRegistered = true;
}

/**
* @internal
*/
Expand Down
21 changes: 20 additions & 1 deletion packages/shader-shaderlab/src/shaders/PBR.gs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Shader "PBR.gs" {
material_TransmissionTexture("TransmissionTexture", Texture2D);
material_Thickness("Thickness", Range(0, 5, 0.01)) = 0;
material_ThicknessTexture("ThicknessTexture", Texture2D);
refractionMode("refractionMode", Enum(Sphere:0, Planar:1)) = 1;
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;
}
Expand All @@ -78,6 +78,7 @@ Shader "PBR.gs" {
}
}

UIScript "uiScriptPath";
}

SubShader "Default" {
Expand All @@ -86,6 +87,24 @@ Shader "PBR.gs" {
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;
Expand Down

0 comments on commit a9aae8b

Please sign in to comment.