ShaderBuilder / refactoring to use an actual builder pattern
There is now a ShaderBuilder class with chainable methods to specify more easily the contents of the final shaders. This is to avoid passing around large objects to different functions, and allow for a richer API. The documentation has also been corrected and clarified.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
import {assign} from '../obj.js';
|
||||
import WebGLPointsLayerRenderer from '../renderer/webgl/PointsLayer.js';
|
||||
import {getSymbolFragmentShader, getSymbolVertexShader, parseSymbolStyle} from '../webgl/ShaderBuilder.js';
|
||||
import {parseSymbolStyle} from '../webgl/ShaderBuilder.js';
|
||||
import Layer from './Layer.js';
|
||||
|
||||
|
||||
@@ -82,8 +82,8 @@ class WebGLPointsLayer extends Layer {
|
||||
*/
|
||||
createRenderer() {
|
||||
return new WebGLPointsLayerRenderer(this, {
|
||||
vertexShader: getSymbolVertexShader(this.parseResult_.params),
|
||||
fragmentShader: getSymbolFragmentShader(this.parseResult_.params),
|
||||
vertexShader: this.parseResult_.builder.getSymbolVertexShader(),
|
||||
fragmentShader: this.parseResult_.builder.getSymbolFragmentShader(),
|
||||
uniforms: this.parseResult_.uniforms,
|
||||
attributes: this.parseResult_.attributes
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user