GithubHelp home page GithubHelp logo

satoshirobatofujimoto / xrlinerenderer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unity-technologies/xrlinerenderer

0.0 0.0 0.0 1.43 MB

An XR-Focused line renderer that mimics rendering with 3d capsules while only using two quads worth of geometry.

License: Other

C# 79.26% HLSL 7.44% ShaderLab 13.29%

xrlinerenderer's Introduction

XR Line Renderer

An XR-Optimized line renderer that is also capable of producing very inexpensive glow effects. The XRLineRenderer mimics rendering with 3d capsules while only using two quads worth of geometry.

Setup and usage

  1. Import the XRLineRenderer package in your project.

  2. Add a XRLineRenderer or XRTrailRenderer component to your gameobject. The interface is nearly identical to the built in Unity Line and Trail Renderers.

  3. Create a new material using the XRLineRenderer shaders. You can find some examples in XRLineRenderer\Materials

  4. Apply this material to the mesh renderer of your XRLineRenderer or XRTrailRenderer.

VRLineRenderer Shader

You will find five shader variants under the XRLineRenderer category. Each of these corresponds to a shader blend mode. Max Color and Min Color are the cheapest variants - if you are using the line renderer to mimic glow effects these variants also are stable in that color will not blow out.

Explanation of interesting shader parameters: Line Rendering Levels - This allows control over the blend between the inner(most opaque/intense) part of the line and outer(transparent) area. Adjust the level curve to 0 will give a very glow-like effect while setting the cruve to 1 will make the line completely solid.

Line Scaled by Depth - Turning this option off means the line will stay the same thickness regardless of your distance from it. This is excellent for drafting lines and also for simulating glow. Radius minimum and maximum allow you to clamp this size adjustment.

Custom VR Line Rendering

The Scripts\Meshchain class provides everything you need to make your own custom line rendering constructs. XRLineRenderer and XRTrailRenderer emulate what the classic Unity components provide, but there are many more use cases out there.

Project Settings

If you plan on making changes to The XR Line Renderer and/or contributing back, then you'll need to set the Asset Serialization property under Edit->Project Settings->Editor to Force Text

xrlinerenderer's People

Contributors

andrewthemaneri avatar mtschoen-unity avatar jasons-unity avatar andrewmaneri avatar dunity avatar mtschoen avatar amirebrahimi avatar amydigiov avatar bradweiers avatar florence-rolland avatar setchi 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.