GithubHelp home page GithubHelp logo

xavion-lux / hrdisplay Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 171 KB

A shader to display the heart rate, built for Unity’s Built-in Render Pipeline

License: GNU Lesser General Public License v3.0

ShaderLab 100.00%
shader unity-shader vrchat vrchat-osc vrchat-sdk3 hlsl hlsl-shader

hrdisplay's Introduction

HRDisplay

GitHub release (latest by date) License GitHub all releases

HRDisplay is a custom shader written in HLSL for Unity's built-in render pipeline, designed to display the user's heart rate along with an animated heart beating at the same pace. The shader is primarily created for use in VRChat but can be adapted for other Unity projects as well.

Table of Contents

Preview

Unity_RKsFVk2wbK

Getting Started

Usage

This shader is primarily designed to be used with other projects like VRCOSC or Pulsoid-to-VRChat-OSC to control avatar parameters with OSC.
For installation on VRChat avatars, skip to Installation for VRChat.

Two variants of the shader exist. One controlled with a single property, HRDisplaySingle, and HRDisplayTriple with 3 properties, one for each decimal place. Choose the easiest version to set up with your environment.

The display can be controlled using the Hundreds, Tens and Units material properties or the BPM property depending on which variant of the shader you use.

Customization

You can customize the shader by providing your own textures for the heart as well as the numbers.
A template for the number texture is provided for you to create your own number textures.
If you experience issues with your textures from a long distances double check the mipmap settings for your texture in Unity.

Installation for VRChat

hrdisplay_tutorial.mp4
  1. Import Modular Avatar in your already existing project with the VRChat Creator Companion or by downloading the latest release from here.
  2. Download and import the latest release of HRDisplay from here.
  3. Go to the VRChat folder in HRDisplay and drag and drop the one of the prefab (using one or three parameters to control the display) to the desired location in your armature.
  4. Move and resize the display to your liking.
  5. Select the prefab, and remap the parameter(s) listed in the MA Parameter component to the path(s) of the parameter(s) sent by your OSC provider. (ex.: VRCOSC/Heartrate/Normalised)
  6. You're avatar is now ready for upload! Modular Avatar will take care of merging the FX layers and parameters when uploading automatically, without permanently modifying your avatar.

Note: If you use the Single variant, the animation provided is made for values normalised from 0 to 240 (defaults for VRCOSC). Set your lower and upper normalisation bounds to 0 and 240 respectively in your OSC software or edit the animations provided in the package to match your normalisation range.

Contributions

This is my first shader, made as a small side-project. It is hand-written from scratch in HLSL so there is probably room for various improvements.
Contributions to the project are therefore welcome.

License

HRDisplay is licensed under the AGPLv3 License. You are free to use, modify, and distribute the shader as per the terms and conditions of the license.

"heart.png" from "small-n-flat" by Paomedia is licensed under CC0 1.0.

hrdisplay's People

Contributors

xavion-lux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.