Sfoglia il codice sorgente

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David `Deltakosh` Catuhe 5 anni fa
parent
commit
7ba62fffe9

+ 1 - 0
dist/preview release/what's new.md

@@ -54,6 +54,7 @@
 - Add isExposedOnFrame property to connection points ([belfortk](https://github.com/belfortk))
 - Add support for exporting frames ([belfortk](https://github.com/belfortk))
 - Add support for importing frames and their nodes (unconnected) and exposed frame ports ([belfortk](https://github.com/belfortk))
+- Add the `rgba` and `a` outputs to the `ReflectionTexture` block ([Popov72](https://github.com/Popov72))
 
 ### Inspector
 

+ 20 - 4
src/Materials/Node/Blocks/Dual/reflectionTextureBlock.ts

@@ -28,9 +28,11 @@ export class ReflectionTextureBlock extends ReflectionTextureBaseBlock {
         this.registerInput("view", NodeMaterialBlockConnectionPointTypes.Matrix, false, NodeMaterialBlockTargets.Fragment);
 
         this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockTargets.Fragment);
+        this.registerOutput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);
         this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
         this.registerOutput("g", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
         this.registerOutput("b", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
+        this.registerOutput("a", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);
 
         this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector4);
     }
@@ -93,24 +95,38 @@ export class ReflectionTextureBlock extends ReflectionTextureBaseBlock {
     }
 
     /**
+     * Gets the rgba output component
+     */
+    public get rgba(): NodeMaterialConnectionPoint {
+        return this._outputs[1];
+    }
+
+    /**
      * Gets the r output component
      */
     public get r(): NodeMaterialConnectionPoint {
-        return this._outputs[1];
+        return this._outputs[2];
     }
 
     /**
      * Gets the g output component
      */
     public get g(): NodeMaterialConnectionPoint {
-        return this._outputs[2];
+        return this._outputs[3];
     }
 
     /**
      * Gets the b output component
      */
     public get b(): NodeMaterialConnectionPoint {
-        return this._outputs[3];
+        return this._outputs[4];
+    }
+
+    /**
+     * Gets the a output component
+     */
+    public get a(): NodeMaterialConnectionPoint {
+        return this._outputs[5];
     }
 
     public autoConfigure(material: NodeMaterial) {
@@ -148,7 +164,7 @@ export class ReflectionTextureBlock extends ReflectionTextureBaseBlock {
 
         state.compilationString += this.handleFragmentSideCodeReflectionCoords(normalWUnit);
 
-        state.compilationString += this.handleFragmentSideCodeReflectionColor();
+        state.compilationString += this.handleFragmentSideCodeReflectionColor(undefined, "");
 
         state.compilationString += this.writeOutputs(state, this._reflectionColorName);