Custom SceneView DrawMode

 

The beautiful scene is from the asset store package:
RPG Medieval Kingdom Kit by BEFFIO

Screen Shot 2018-06-28 at 21.43.05

Download : https://drive.google.com/open?id=1hloorB11hPcIXIIKBIRzqvon9mpmbYPK

How to use :
Just add your shaders and names to the CustomDrawModeAsset

Thanks Vlad Neykov for helping me in making this little tool
( This is one of the tools I made during #UnityHackweek )

One thought on “Custom SceneView DrawMode

  1. This does not work in SRP. But we can implement the same thing in the pipeline code:

    Possible pipeline codes:
    //Variables
    private static ShaderPassName passNameDefault =
    new ShaderPassName(“SRPDefaultUnlit”);
    private static Material mat;
    private static FilterRenderersSettings filterSettings;

    //In Pipeline
    DrawRendererSettings drawSettingsDefault =
    new DrawRendererSettings(cam, passNameDefault);
    drawSettingsDefault.SetShaderPassName(1,passNameDefault);
    if (mat==null) mat = new Material(CustomDrawModeAssetObject.cdma.customDrawModes[i].shader);
    drawSettingsDefault.SetOverrideMaterial( mat, 0 );
    filterSettings = new FilterRenderersSettings(true);

    filterSettings.renderQueueRange = RenderQueueRange.opaque;
    drawSettingsDefault.sorting.flags = SortFlags.CommonOpaque;
    context.DrawRenderers(cull.visibleRenderers, ref drawSettingsDefault, filterSettings);

    filterSettings.renderQueueRange = RenderQueueRange.transparent;
    drawSettingsDefault.sorting.flags = SortFlags.CommonTransparent;
    context.DrawRenderers(cull.visibleRenderers, ref drawSettingsDefault, filterSettings);

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s