Lines rendered at absurd size with example Immediate-Mode Drawing script
My code currently looks like:
using System.Collections;using System.Collections.Generic;using UnityEngine;using Shapes;
[ExecuteAlways] public class MissileShapes : ImmediateModeShapeDrawer {
public override void DrawShapes( Camera cam ){
using( Draw.Command( cam ) ){
// set up static parameters. these are used for all following Draw.Line calls Draw.LineGeometry = LineGeometry.Volumetric3D; Draw.ThicknessSpace = ThicknessSpace.Pixels; Draw.Thickness = 1; // 4px wide
// set static parameter to draw in the local space of this object Draw.Matrix = transform.localToWorldMatrix;
// draw lines Draw.Line( Vector3.zero, Vector3.right, Color.red ); Draw.Line( Vector3.zero, Vector3.up, Color.green ); Draw.Line( Vector3.zero, Vector3.forward, Color.blue ); }
}
}
and for some reason the lines rendered are strangly large and scale depending on camera distance to the lines.
Project files:
https://storage.buymymojo.net/s/cRsGCnLCbxRfTac
Reporting a bug? please specify Unity version:
2023.1.11f1
Reporting a bug? please specify Shapes version:
4.3.1
Reporting a bug? please specify Render Pipeline:
URP
that works too!