|
@@ -16,10 +16,10 @@ export class RGBAMergerBlock extends NodeMaterialBlock {
|
|
public constructor(name: string) {
|
|
public constructor(name: string) {
|
|
super(name, NodeMaterialBlockTargets.Fragment);
|
|
super(name, NodeMaterialBlockTargets.Fragment);
|
|
|
|
|
|
|
|
+ this.registerInput("rgb", NodeMaterialBlockConnectionPointTypes.Vector3OrColor3OrVector4OrColor4, true);
|
|
this.registerInput("r", NodeMaterialBlockConnectionPointTypes.Float, true);
|
|
this.registerInput("r", NodeMaterialBlockConnectionPointTypes.Float, true);
|
|
this.registerInput("g", NodeMaterialBlockConnectionPointTypes.Float, true);
|
|
this.registerInput("g", NodeMaterialBlockConnectionPointTypes.Float, true);
|
|
this.registerInput("b", NodeMaterialBlockConnectionPointTypes.Float, true);
|
|
this.registerInput("b", NodeMaterialBlockConnectionPointTypes.Float, true);
|
|
- this.registerInput("rgb", NodeMaterialBlockConnectionPointTypes.Vector3OrColor3OrVector4OrColor4, true);
|
|
|
|
this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float, true);
|
|
this.registerInput("a", NodeMaterialBlockConnectionPointTypes.Float, true);
|
|
|
|
|
|
this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color4);
|
|
this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Color4);
|
|
@@ -37,28 +37,28 @@ export class RGBAMergerBlock extends NodeMaterialBlock {
|
|
* Gets the R input component
|
|
* Gets the R input component
|
|
*/
|
|
*/
|
|
public get r(): NodeMaterialConnectionPoint {
|
|
public get r(): NodeMaterialConnectionPoint {
|
|
- return this._inputs[0];
|
|
|
|
|
|
+ return this._inputs[1];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* Gets the G input component
|
|
* Gets the G input component
|
|
*/
|
|
*/
|
|
public get g(): NodeMaterialConnectionPoint {
|
|
public get g(): NodeMaterialConnectionPoint {
|
|
- return this._inputs[1];
|
|
|
|
|
|
+ return this._inputs[2];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* Gets the B input component
|
|
* Gets the B input component
|
|
*/
|
|
*/
|
|
public get b(): NodeMaterialConnectionPoint {
|
|
public get b(): NodeMaterialConnectionPoint {
|
|
- return this._inputs[2];
|
|
|
|
|
|
+ return this._inputs[3];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* Gets the RGB input component
|
|
* Gets the RGB input component
|
|
*/
|
|
*/
|
|
public get rgb(): NodeMaterialConnectionPoint {
|
|
public get rgb(): NodeMaterialConnectionPoint {
|
|
- return this._inputs[3];
|
|
|
|
|
|
+ return this._inputs[0];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -88,6 +88,7 @@ export class RGBAMergerBlock extends NodeMaterialBlock {
|
|
let rInput = this._inputs[0];
|
|
let rInput = this._inputs[0];
|
|
let gInput = this._inputs[1];
|
|
let gInput = this._inputs[1];
|
|
let bInput = this._inputs[2];
|
|
let bInput = this._inputs[2];
|
|
|
|
+
|
|
state.compilationString += this._declareOutput(output, state) + ` = vec4(${this._writeVariable(rInput)}, ${this._writeVariable(gInput)}, ${this._writeVariable(bInput)}, ${this._writeVariable(aInput)});\r\n`;
|
|
state.compilationString += this._declareOutput(output, state) + ` = vec4(${this._writeVariable(rInput)}, ${this._writeVariable(gInput)}, ${this._writeVariable(bInput)}, ${this._writeVariable(aInput)});\r\n`;
|
|
}
|
|
}
|
|
|
|
|