2018-04-09 09:35:04 +02:00
|
|
|
/**
|
|
|
|
* R3.D3.Shader.Fragment
|
2019-07-25 22:22:32 +02:00
|
|
|
* @param graphics R3.Runtime.Graphics
|
2018-04-09 09:35:04 +02:00
|
|
|
* @param apiFragmentShader
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
R3.D3.Shader.Fragment = function(
|
|
|
|
graphics,
|
|
|
|
apiFragmentShader
|
|
|
|
) {
|
|
|
|
|
|
|
|
this.graphics = graphics;
|
|
|
|
this.graphics.isNotThreeThrow();
|
|
|
|
|
|
|
|
if (R3.Utils.UndefinedOrNull(apiFragmentShader)) {
|
|
|
|
apiFragmentShader = {
|
|
|
|
shaderType : R3.D3.API.Shader.SHADER_TYPE_FRAGMENT
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
R3.D3.API.Shader.Fragment.call(
|
|
|
|
this,
|
|
|
|
apiFragmentShader
|
|
|
|
);
|
|
|
|
|
|
|
|
R3.D3.Shader.call(
|
|
|
|
this,
|
|
|
|
this.graphics,
|
|
|
|
apiFragmentShader
|
|
|
|
);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
R3.D3.Shader.Fragment.prototype = Object.create(R3.D3.Shader.prototype);
|
|
|
|
R3.D3.Shader.Fragment.prototype.constructor = R3.D3.Shader.Fragment;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a shader instance
|
|
|
|
* @returns {*}
|
|
|
|
*/
|
|
|
|
R3.D3.Shader.Fragment.prototype.createInstance = function() {
|
|
|
|
R3.D3.Shader.prototype.createInstance.call(this);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the instance with the current state
|
|
|
|
*/
|
|
|
|
R3.D3.Shader.Fragment.prototype.updateInstance = function(property) {
|
|
|
|
R3.D3.Shader.prototype.updateInstance.call(this, property);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Converts a R3.D3.Shader to a R3.D3.API.Shader
|
|
|
|
* @returns {R3.D3.API.Shader}
|
|
|
|
*/
|
|
|
|
R3.D3.Shader.Fragment.prototype.toApiObject = function() {
|
|
|
|
var apiShader = R3.D3.Shader.prototype.toApiObject.call(this);
|
|
|
|
return apiShader;
|
|
|
|
};
|