Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ Desktop.ini
# Unity
/Library
/Temp
/Logs
/obj

# VS
/.vs
/.vscode

*.sln
*.csproj
30 changes: 16 additions & 14 deletions Assets/Retro3D/Retro3DPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// A minimal example of a custom render pipeline with the Retro3D shader.
// https://github.com/keijiro/Retro3DPipeline

using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Experimental.Rendering;

namespace Retro3D
{
Expand All @@ -16,9 +16,9 @@ public class Retro3DPipeline : RenderPipeline
// Rule: Clear commands right after calling ExecuteCommandBuffer.
CommandBuffer _cb;

public override void Dispose()
protected override void Dispose(bool disposing)
{
base.Dispose();
base.Dispose(disposing);

if (_cb != null)
{
Expand All @@ -27,9 +27,9 @@ public override void Dispose()
}
}

public override void Render(ScriptableRenderContext context, Camera[] cameras)
protected override void Render(ScriptableRenderContext context, Camera[] cameras)
{
base.Render(context, cameras);
//base.Render(context, cameras);

// Lazy initialization of the temporary command buffer.
if (_cb == null) _cb = new CommandBuffer();
Expand All @@ -52,23 +52,25 @@ public override void Render(ScriptableRenderContext context, Camera[] cameras)
_cb.Clear();

// Do basic culling.
var culled = new CullResults();
CullResults.Cull(camera, context, out culled);

// Render visible objects that has "Base" light mode tag.
var settings = new DrawRendererSettings(camera, new ShaderPassName("Base"));
var filter = new FilterRenderersSettings(true);
filter.renderQueueRange = RenderQueueRange.opaque;
context.DrawRenderers(culled.visibleRenderers, ref settings, filter);
ScriptableCullingParameters scp;
camera.TryGetCullingParameters(out scp);
var culled = context.Cull(ref scp);

//// Render visible objects that has "Base" light mode tag.
var sorting = new SortingSettings(camera);
var settings = new DrawingSettings(new ShaderTagId("Base"), sorting);
var filter = FilteringSettings.defaultValue;
context.DrawRenderers(culled, ref settings, ref filter);

// Blit the render result to the camera destination.
_cb.name = "Blit";
_cb.Blit(rtID, BuiltinRenderTextureType.CameraTarget);
context.ExecuteCommandBuffer(_cb);
_cb.Clear();

context.Submit();
}

}
}
}
3 changes: 2 additions & 1 deletion Assets/Retro3D/Retro3DPipelineAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/keijiro/Retro3DPipeline

using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;

#if UNITY_EDITOR
using UnityEditor;
Expand Down Expand Up @@ -35,7 +36,7 @@ public override void Action(int instanceId, string pathName, string resourceFile
}
#endif

protected override IRenderPipeline InternalCreatePipeline()
protected override UnityEngine.Rendering.RenderPipeline CreatePipeline()
{
return new Retro3DPipeline();
}
Expand Down
21 changes: 19 additions & 2 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
{
"dependencies": {
"com.unity.package-manager-ui": "1.9.11",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ide.rider": "1.1.1",
"com.unity.ide.vscode": "1.1.3",
"com.unity.package-manager-ui": "2.2.0",
"com.unity.render-pipelines.core": "6.9.2",
"com.unity.timeline": "1.1.0",
"com.unity.xr.legacyinputhelpers": "2.0.6",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.director": "1.0.0"
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}
Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.
3 changes: 2 additions & 1 deletion ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
m_EditorVersion: 2018.2.2f1
m_EditorVersion: 2019.2.12f1
m_EditorVersionWithRevision: 2019.2.12f1 (b1a7e1fb4fa5)
Binary file added ProjectSettings/VFXManager.asset
Binary file not shown.
10 changes: 10 additions & 0 deletions ProjectSettings/XRSettings.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"m_SettingKeys": [
"VR Device Disabled",
"VR Device User Alert"
],
"m_SettingValues": [
"False",
"False"
]
}