import type { WebGlShaderType } from '../../renderers/webgl/WebGlShaderNode.js'; export const Default: WebGlShaderType = { vertex: ` # ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; # else precision mediump float; # endif attribute vec2 a_position; attribute vec2 a_textureCoords; attribute vec4 a_color; attribute vec2 a_nodeCoords; uniform vec2 u_resolution; uniform float u_pixelRatio; varying vec4 v_color; varying vec2 v_textureCoords; varying vec2 v_nodeCoords; void main() { vec2 normalized = a_position * u_pixelRatio / u_resolution; vec2 zero_two = normalized * 2.0; vec2 clip_space = zero_two - 1.0; v_color = a_color; v_textureCoords = a_textureCoords; v_nodeCoords = a_nodeCoords; gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1); } `, fragment: ` # ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; # else precision mediump float; # endif uniform vec2 u_resolution; uniform sampler2D u_texture; varying vec4 v_color; varying vec2 v_textureCoords; void main() { gl_FragColor = v_color * texture2D(u_texture, v_textureCoords); } `, };