furina
v1.0.3
Published
A Shader util functions library.
Downloads
22
Readme
Furina, the God of Justice "Focalors" in Fontaine.
Install
npm i furina
How to use it?
If you're using vite, you may need to install a plugin——vite-plugin-glsl:
npm i -D vite-plugin-glsl
Config the plugin in vite.config.js
:
import { defineConfig } from "vite";
import glsl from "vite-plugin-glsl";
export default defineConfig({
plugins: [glsl()],
});
In your Shader, just #include
the functions you need:
#include "/node_modules/furina/image/cover.glsl"
uniform float iTime;
uniform vec3 iResolution;
uniform vec4 iMouse;
uniform sampler2D uTexture;
varying vec2 vUv;
uniform vec2 uMediaSize;
uniform float uOpacity;
void main(){
vec2 uv=vUv;
uv=cover(iResolution.xy,uMediaSize.xy,uv);
vec4 tex=texture(uTexture,uv);
vec3 color=tex.rgb;
gl_FragColor=vec4(color,uOpacity);
}
Author
👤 alphardex
- Twitter: @alphardex007
- Github: @alphardex
Show your support
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator