Skip to content

Commit

Permalink
Addition of basic shader
Browse files Browse the repository at this point in the history
  • Loading branch information
GBirch33 committed Nov 5, 2024
1 parent 9c39a83 commit 6aaf725
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib/babylon/explorer-alpha-shader/basic_fragment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const customBasicFragmentShader = `#version 300 es
precision highp float;
in vec2 vUV;
uniform sampler2D textureSampler;
out vec4 fragColor;
void main(void) {
fragColor = texture(textureSampler, vUV);
}`
18 changes: 18 additions & 0 deletions src/lib/babylon/explorer-alpha-shader/basic_vertex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const customBasicVertexShader = `#version 300 es
precision highp float;
// Attributes
in vec3 position;
in vec2 uv;
// Uniforms
uniform mat4 worldViewProjection;
// Varying
out vec2 vUV;
void main(void) {
gl_Position = worldViewProjection * vec4(position, 1.0);
vUV = uv;
}`

0 comments on commit 6aaf725

Please sign in to comment.