phaser
Version:
A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers from the team at Phaser Studio Inc.
31 lines (27 loc) • 961 B
JavaScript
/**
* @author Benjamin D. Richards <benjamindrichards@gmail.com>
* @copyright 2013-2026 Phaser Studio Inc.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var BoundedSampler = require('../BoundedSampler-glsl');
/**
* Return a ShaderAdditionConfig for bounded texture sampling.
* A bounded sampler will return a transparent pixel
* if the texture coordinates are outside the texture bounds.
*
* @function Phaser.Renderer.WebGL.ShaderAdditionMakers.MakeBoundedSampler
* @since 4.0.0
* @param {boolean} [disable=false] - Whether to disable the shader addition on creation.
* @return {Phaser.Types.Renderer.WebGL.ShaderAdditionConfig} The shader addition configuration.
*/
var MakeBoundedSampler = function (disable)
{
return {
name: 'BoundedSampler',
additions: {
fragmentHeader: BoundedSampler
},
disable: !!disable
};
};
module.exports = MakeBoundedSampler;