Skip to content

alphardex/furina

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

furina

A Shader util functions library.

Version License: MIT Twitter: alphardex007

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

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

About

A Shader util functions library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages