An XR-Focused line renderer that mimics rendering with 3d capsules while only using two quads worth of geometry.
Перейти к файлу
Matt Schoen eac20ca15e Convert CRLF to LF 2022-02-15 17:11:58 -08:00
.github Update metadata files 2021-09-16 15:37:25 -07:00
.yamato Update Yamato config 2021-07-20 17:12:06 -07:00
Documentation~ Bump version number; 2020-01-03 17:59:07 -08:00
Editor Add .api files 2021-07-19 20:31:34 -07:00
Materials Clean up missing references in materials; 2019-11-26 16:42:56 -08:00
Runtime Add .api files 2021-07-19 20:31:34 -07:00
Scenes Remove lighting data from example scene to avoid import warnings 2019-12-03 20:11:14 -08:00
Scratch Clean up missing references in materials; 2019-11-26 16:42:56 -08:00
Shaders Convert CRLF to LF 2022-02-15 17:11:58 -08:00
Tests Convert CRLF to LF 2022-02-15 17:11:58 -08:00
.editorconfig Add .editorconfig for generating API files 2021-08-18 22:39:58 -07:00
.gitattributes Update metadata files 2021-09-16 15:37:25 -07:00
.gitignore Update metadata files 2021-09-16 15:37:25 -07:00
.npmignore Ignore .gitattributes and .github folder in .npmignore 2021-11-16 02:41:15 -08:00
CHANGELOG.md Update changelog for 0.1.3-preview release; 2021-05-27 17:25:48 -07:00
CHANGELOG.md.meta Add documentation folder, update license, add changelog, update package display name with spaces; 2019-11-25 01:00:01 -08:00
CONTRIBUTING.md [Package] Add files missing to pass validation 2019-11-25 09:26:31 -05:00
CONTRIBUTING.md.meta [CI] Add contributing.md.meta file 2019-11-25 10:27:28 -05:00
Editor.meta Move script files into Editor/Runtime folders, with assembly definitions; 2019-11-24 23:43:12 -08:00
LICENSE.md Update year in license file 2020-09-22 11:43:42 -07:00
LICENSE.md.meta Add documentation folder, update license, add changelog, update package display name with spaces; 2019-11-25 01:00:01 -08:00
Materials.meta Initial commit + move of the project from the VR Foundation Toolkit 2017-02-05 15:28:58 -08:00
README.md Bump version number; 2020-01-03 17:59:07 -08:00
README.md.meta Initial commit + move of the project from the VR Foundation Toolkit 2017-02-05 15:28:58 -08:00
Runtime.meta Move script files into Editor/Runtime folders, with assembly definitions; 2019-11-24 23:43:12 -08:00
Scenes.meta Initial commit + move of the project from the VR Foundation Toolkit 2017-02-05 15:28:58 -08:00
Scratch.meta Initial commit + move of the project from the VR Foundation Toolkit 2017-02-05 15:28:58 -08:00
Shaders.meta Initial commit + move of the project from the VR Foundation Toolkit 2017-02-05 15:28:58 -08:00
Tests.meta [CI] Adding Yamato job definitions 2019-11-22 15:15:46 -05:00
package.json Bump version number to 0.1.3-preview for future development 2020-08-27 16:13:40 -07:00
package.json.meta [CI] Adding Yamato job definitions 2019-11-22 15:15:46 -05:00

README.md

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