You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for Unity 2020.3.21f1 + HDRP 10.6.0 and V3 tiles viewer:
project window right click, Create/Rendering/C# Custom pass
main camera: Add Component, Custom Pass Volume
Select some injection point (try which one works the best)
Add your Custom pass with + button (its listed on that drop down menu)
Modify PointCloudViewerTilesDX11.cs, add these changes:
// BEFORE
PointCloudTile[] tiles;
// AFTER
internal PointCloudTile[] tiles;
// BEFORE
int tilesCount = 0;
// AFTER
internal int tilesCount = 0;
// BEFORE
void Awake()
{
applicationStreamingAssetsPath = Application.streamingAssetsPath;
FixMainThreadHelper();
}
// AFTER
public static PointCloudViewerTilesDX11 instance;
void Awake()
{
instance = this;
applicationStreamingAssetsPath = Application.streamingAssetsPath;
FixMainThreadHelper();
}
// BEFORE
public void OnRenderObject()
// AFTER
public void DisabledOnRenderObject()
New Custom PassV3.cs: (or which ever you named it)
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;
using unitycodercom_PointCloudBinaryViewer;
class NewCustomPassV3 : CustomPass
{
// It can be used to configure render targets and their clear state. Also to create temporary render target textures.
// When empty this render pass will render to the active camera render target.
// You should never call CommandBuffer.SetRenderTarget. Instead call <c>ConfigureTarget</c> and <c>ConfigureClear</c>.
// The render pipeline will ensure target setup and clearing happens in an performance manner.
protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd)
{
// Setup code here
}
protected override void Execute(CustomPassContext ctx)
{
// Executed every frame for all the camera inside the pass volume.
// The context contains the command buffer to use to enqueue graphics commands.
if (PointCloudViewerTilesDX11.instance == null) return;
for (int i = 0, len = PointCloudViewerTilesDX11.instance.tilesCount; i < len; i++)
{
if (PointCloudViewerTilesDX11.instance.tiles[i].isReady == false || PointCloudViewerTilesDX11.instance.tiles[i].isLoading == true || PointCloudViewerTilesDX11.instance.tiles[i].visiblePoints == 0) continue;
ctx.cmd.DrawProcedural(Matrix4x4.identity, PointCloudViewerTilesDX11.instance.tiles[i].material, 0, MeshTopology.Points, PointCloudViewerTilesDX11.instance.tiles[i].visiblePoints);
}
}
protected override void Cleanup()
{
// Cleanup code
}
}
Will there be a version of the shader that works with instanced singlepass rendering for VR?
Or does it already exist and I missed it somehow?
Thanks in advance!
Ok that doesnt seem to be working.
just tested in V3 viewer in hdrp+single pass instanced+oculus : no points rendered (multipass works).
I'll look into it.
converted PointCloudColorDX11.shader to vr+singlepass : Seems to work (tested on quest+link, hdrp 12.x)
if you can test it, pm me in forums or send email, i'll send the shader.
The main v2 billboard shader almost works,
right eye has some distortion (probably related to using direct camera xyz values in shader..), still looking into that.
*ok v2 billboard shader works also, i'll include these in the next asset store update too, hopefully later this month.
Activity
unitycoder commentedon Feb 7, 2021
for 2020.2.2f1 + HDRP 10.2.2
same process as above, custom pass script is bit different:
New Custom Pass.cs
unitycoder commentedon Oct 21, 2021
Just tested this with Unity XR + Oculus, works with HDRP+VR also.
unitycoder commentedon Mar 10, 2022
for Unity 2020.3.21f1 + HDRP 10.6.0 and V3 tiles viewer:
New Custom PassV3.cs: (or which ever you named it)
PascalRunde commentedon Oct 31, 2022
Will there be a version of the shader that works with instanced singlepass rendering for VR?
Or does it already exist and I missed it somehow?
Thanks in advance!
unitycoder commentedon Nov 1, 2022
Ok that doesnt seem to be working.
just tested in V3 viewer in hdrp+single pass instanced+oculus : no points rendered (multipass works).
I'll look into it.
unitycoder commentedon Nov 2, 2022
Ok, some progress:
if you can test it, pm me in forums or send email, i'll send the shader.
The main v2 billboard shader almost works,
right eye has some distortion (probably related to using direct camera xyz values in shader..), still looking into that.
*ok v2 billboard shader works also, i'll include these in the next asset store update too, hopefully later this month.