ソースを参照

Add _dumpPropertiesCode implementation wherever necessary

Popov72 5 年 前
コミット
53ef80c23d

+ 8 - 0
src/Materials/Node/Blocks/PBR/ambientOcclusionBlock.ts

@@ -92,6 +92,14 @@ export class AmbientOcclusionBlock extends NodeMaterialBlock {
         return this;
     }
 
+    protected _dumpPropertiesCode() {
+        let codeString: string;
+
+        codeString = `${this._codeVariableName}.useAmbientInGrayScale = ${this.useAmbientInGrayScale};\r\n`;
+
+        return codeString;
+    }
+
     public serialize(): any {
         let serializationObject = super.serialize();
 

+ 6 - 0
src/Materials/Node/Blocks/PBR/anisotropyBlock.ts

@@ -109,6 +109,12 @@ export class AnisotropyBlock extends NodeMaterialBlock {
         return code;
     }
 
+    /**
+     * Gets the main code of the block (fragment side)
+     * @param state current state of the node material building
+     * @param generateTBNSpace if true, the code needed to create the TBN coordinate space is generated
+     * @returns the shader code
+     */
     public getCode(state: NodeMaterialBuildState, generateTBNSpace = false): string {
         let code = "";
 

+ 22 - 0
src/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.ts

@@ -812,6 +812,28 @@ export class PBRMetallicRoughnessBlock extends NodeMaterialBlock {
         return this;
     }
 
+    protected _dumpPropertiesCode() {
+        let codeString: string = "";
+
+        codeString += `${this._codeVariableName}.useAlphaFromAlbedoTexture = ${this.useAlphaFromAlbedoTexture};\r\n`;
+        codeString += `${this._codeVariableName}.useAlphaTest = ${this.useAlphaTest};\r\n`;
+        codeString += `${this._codeVariableName}.alphaTestCutoff = ${this.alphaTestCutoff};\r\n`;
+        codeString += `${this._codeVariableName}.useAlphaBlending = ${this.useAlphaBlending};\r\n`;
+        codeString += `${this._codeVariableName}.opacityRGB = ${this.opacityRGB};\r\n`;
+        codeString += `${this._codeVariableName}.useRadianceOverAlpha = ${this.useRadianceOverAlpha};\r\n`;
+        codeString += `${this._codeVariableName}.useSpecularOverAlpha = ${this.useSpecularOverAlpha};\r\n`;
+        codeString += `${this._codeVariableName}.enableSpecularAntiAliasing = ${this.enableSpecularAntiAliasing};\r\n`;
+        codeString += `${this._codeVariableName}.useEnergyConservation = ${this.useEnergyConservation};\r\n`;
+        codeString += `${this._codeVariableName}.useRadianceOcclusion = ${this.useRadianceOcclusion};\r\n`;
+        codeString += `${this._codeVariableName}.useHorizonOcclusion = ${this.useHorizonOcclusion};\r\n`;
+        codeString += `${this._codeVariableName}.unlit = ${this.unlit};\r\n`;
+        codeString += `${this._codeVariableName}.debugMode = ${this.debugMode};\r\n`;
+        codeString += `${this._codeVariableName}.debugLimit = ${this.debugLimit};\r\n`;
+        codeString += `${this._codeVariableName}.debugFactor = ${this.debugFactor};\r\n`;
+
+        return codeString;
+    }
+
     public serialize(): any {
         let serializationObject = super.serialize();
 

+ 9 - 0
src/Materials/Node/Blocks/PBR/reflectionBlock.ts

@@ -368,6 +368,15 @@ export class ReflectionBlock extends ReflectionTextureBaseBlock {
         return this;
     }
 
+    protected _dumpPropertiesCode() {
+        let codeString: string = super._dumpPropertiesCode();
+
+        codeString += `${this._codeVariableName}.useSphericalHarmonics = ${this.useSphericalHarmonics};\r\n`;
+        codeString += `${this._codeVariableName}.forceIrradianceInFragment = ${this.forceIrradianceInFragment};\r\n`;
+
+        return codeString;
+    }
+
     public serialize(): any {
         let serializationObject = super.serialize();
 

+ 12 - 0
src/Materials/Node/Blocks/PBR/reflectivityBlock.ts

@@ -136,6 +136,18 @@ export class ReflectivityBlock extends NodeMaterialBlock {
         return this;
     }
 
+    protected _dumpPropertiesCode() {
+        let codeString: string = "";
+
+        codeString += `${this._codeVariableName}.useAmbientOcclusionFromMetallicTextureRed = ${this.useAmbientOcclusionFromMetallicTextureRed};\r\n`;
+        codeString += `${this._codeVariableName}.useMetallnessFromMetallicTextureBlue = ${this.useMetallnessFromMetallicTextureBlue};\r\n`;
+        codeString += `${this._codeVariableName}.useRoughnessFromMetallicTextureAlpha = ${this.useRoughnessFromMetallicTextureAlpha};\r\n`;
+        codeString += `${this._codeVariableName}.useRoughnessFromMetallicTextureGreen = ${this.useRoughnessFromMetallicTextureGreen};\r\n`;
+        codeString += `${this._codeVariableName}.useMetallicF0FactorFromMetallicTexture = ${this.useMetallicF0FactorFromMetallicTexture};\r\n`;
+
+        return codeString;
+    }
+
     public serialize(): any {
         let serializationObject = super.serialize();