fantus/pages/_document.tsx

30 lines
976 B
TypeScript
Raw Normal View History

2020-01-12 18:34:27 +01:00
import Document, { Html, Head, Main, NextScript } from 'next/document'
export default class extends Document {
2021-01-02 00:21:29 +01:00
render() {
return (
<Html lang="en">
<Head />
<body>
<script
type="x-shader/x-vertex"
id="vertexshader"
dangerouslySetInnerHTML={{
__html: `attribute float scale;void main() {vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );gl_PointSize = scale * ( 300.0 / - mvPosition.z );gl_Position = projectionMatrix * mvPosition;}`,
}}
></script>
<script
type="x-shader/x-fragment"
id="fragmentshader"
dangerouslySetInnerHTML={{
__html: `uniform vec3 color;void main() {if ( length( gl_PointCoord - vec2( 0.5, 0.5 ) ) > 0.475 ) discard;gl_FragColor = vec4( color, 1.0 );}`,
}}
></script>
<Main />
<NextScript />
</body>
</Html>
)
}
}