|
@@ -45,6 +45,7 @@ export class LightBlock extends NodeMaterialBlock {
|
|
this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("worldNormal", NodeMaterialBlockConnectionPointTypes.Vector4, false, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3, false, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("cameraPosition", NodeMaterialBlockConnectionPointTypes.Vector3, false, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("glossiness", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("glossiness", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
|
|
|
|
+ this.registerInput("glossPower", NodeMaterialBlockConnectionPointTypes.Float, true, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("diffuseColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("diffuseColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("specularColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
|
|
this.registerInput("specularColor", NodeMaterialBlockConnectionPointTypes.Color3, true, NodeMaterialBlockTargets.Fragment);
|
|
|
|
|
|
@@ -89,17 +90,24 @@ export class LightBlock extends NodeMaterialBlock {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * Gets the glossinness power component
|
|
|
|
+ */
|
|
|
|
+ public get glossPower(): NodeMaterialConnectionPoint {
|
|
|
|
+ return this._inputs[4];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* Gets the diffuse color component
|
|
* Gets the diffuse color component
|
|
*/
|
|
*/
|
|
public get diffuseColor(): NodeMaterialConnectionPoint {
|
|
public get diffuseColor(): NodeMaterialConnectionPoint {
|
|
- return this._inputs[4];
|
|
|
|
|
|
+ return this._inputs[5];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* Gets the specular color component
|
|
* Gets the specular color component
|
|
*/
|
|
*/
|
|
public get specularColor(): NodeMaterialConnectionPoint {
|
|
public get specularColor(): NodeMaterialConnectionPoint {
|
|
- return this._inputs[5];
|
|
|
|
|
|
+ return this._inputs[6];
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -271,7 +279,7 @@ export class LightBlock extends NodeMaterialBlock {
|
|
}
|
|
}
|
|
state.compilationString += `lightingInfo info;\r\n`;
|
|
state.compilationString += `lightingInfo info;\r\n`;
|
|
state.compilationString += `float shadow = 1.;\r\n`;
|
|
state.compilationString += `float shadow = 1.;\r\n`;
|
|
- state.compilationString += `float glossiness = pow(${this.glossiness.isConnected ? this.glossiness.associatedVariableName : "1.0"}, 4.0) * 1024.0;\r\n`;
|
|
|
|
|
|
+ state.compilationString += `float glossiness = ${this.glossiness.isConnected ? this.glossiness.associatedVariableName : "1.0"} * ${this.glossPower.isConnected ? this.glossPower.associatedVariableName : "1024.0"};\r\n`;
|
|
state.compilationString += `vec3 diffuseBase = vec3(0., 0., 0.);\r\n`;
|
|
state.compilationString += `vec3 diffuseBase = vec3(0., 0., 0.);\r\n`;
|
|
state.compilationString += `vec3 specularBase = vec3(0., 0., 0.);\r\n`;
|
|
state.compilationString += `vec3 specularBase = vec3(0., 0., 0.);\r\n`;
|
|
state.compilationString += `vec3 normalW = ${this.worldNormal.associatedVariableName}.xyz;\r\n`;
|
|
state.compilationString += `vec3 normalW = ${this.worldNormal.associatedVariableName}.xyz;\r\n`;
|