|
@@ -39,6 +39,9 @@ export class ShaderAlebdoParts {
|
|
|
// normalUpdated
|
|
|
public Vertex_Before_NormalUpdated: string;
|
|
|
|
|
|
+ // worldPosComputed
|
|
|
+ public Vertex_After_WorldPosComputed: string;
|
|
|
+
|
|
|
// mainEnd
|
|
|
public Vertex_MainEnd: string;
|
|
|
}
|
|
@@ -135,6 +138,7 @@ export class PBRCustomMaterial extends PBRMaterial {
|
|
|
.replace('#define CUSTOM_VERTEX_MAIN_BEGIN', (this.CustomParts.Vertex_MainBegin ? this.CustomParts.Vertex_MainBegin : ""))
|
|
|
.replace('#define CUSTOM_VERTEX_UPDATE_POSITION', (this.CustomParts.Vertex_Before_PositionUpdated ? this.CustomParts.Vertex_Before_PositionUpdated : ""))
|
|
|
.replace('#define CUSTOM_VERTEX_UPDATE_NORMAL', (this.CustomParts.Vertex_Before_NormalUpdated ? this.CustomParts.Vertex_Before_NormalUpdated : ""))
|
|
|
+ .replace('#define CUSTOM_VERTEX_UPDATE_WORLDPOS', (this.CustomParts.Vertex_After_WorldPosComputed ? this.CustomParts.Vertex_After_WorldPosComputed : ""))
|
|
|
.replace('#define CUSTOM_VERTEX_MAIN_END', (this.CustomParts.Vertex_MainEnd ? this.CustomParts.Vertex_MainEnd : ""));
|
|
|
|
|
|
Effect.ShadersStore[name + "PixelShader"] = this.FragmentShader
|
|
@@ -270,6 +274,11 @@ export class PBRCustomMaterial extends PBRMaterial {
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
+ public Vertex_After_WorldPosComputed(shaderPart: string): PBRCustomMaterial {
|
|
|
+ this.CustomParts.Vertex_After_WorldPosComputed = shaderPart;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
public Vertex_MainEnd(shaderPart: string): PBRCustomMaterial {
|
|
|
this.CustomParts.Vertex_MainEnd = shaderPart;
|
|
|
return this;
|