"Edge Rendering" and SVG

Two separate questions:

  1. We need functionality for rendering a “wire frame box” around object in the scene. Exactly like Unity Tool works when selecting a GameObject in the “Scene” View. We use this to highlight the selected part in runtime.

Better yet, “wireframe” and “edges only” modes, kind of like used with cell shading to achieve comic like feel, would be ideal.

What is the right approach for this in Unity3D? Do we need to write custom shader?

  1. Is possible to draw 2D graphics on the GUI?

We have need to draw simple geometries and lines on the GUI on top of the 3D view. Is this possible in Unity3D? Any tips to get started would be highly appreciated.

Thanks in advance,

-S.T.

Note to self, run a search in wiki before posting… (I thought I did)

  1. SVG
    http://www.unifycommunity.com/wiki/index.php?title=SVG
  1. Edge Rendering…

I tried following approach:

  • I added ToonShading unityPackage to the project.
  • I added Toony-Basic Outline material to a primitive geometry representing the “cursor object” in scene.
  • I added Outline color and Outline width to get the visual effect I am looking for…
  • I created a CubeMap with PNG with full transparency on each side.
    (This does not seem to work because CubeMap expect RPG map… I am guessing).

I want transparency, because I want the selector highlight be hovering around the selected object instead of actually changing the object material…

I have a feeling I am way off right about now, so any feedback would be appreciated.

Thanks in advance!

If I’m understanding what you’re trying to accomplish correctly this thread might get you started in the right direction. It’s an outline toon shader hack I did that “cuts out” the main geometry leaving just the outline.

http://forum.unity3d.com/viewtopic.php?t=11765

HTH,
Ethan

I couldn’t achieve this using nicely using shaders. I ended up stretching a different model (a wireframe box) around the selected objects.

I’ve also used a torus shape to surround a model, and oriented it towards the camera, billboard style.

Thank you for the comments, I will check both options and see which one suits our needs best.

This effect is exactly what we are looking for. I was expecting to use primitive box with wireframe or edges only rendermode, but your solution sounds just as valid.

One question, though as I am not 3D artist myself…

How would you create a scalable wireframe model for Unity that does not get distorted when stretched around different sized objects?

Our 3D guys are using 3D Studio Max.

Good question.

All my objects are the same size, so I’ve not worried about deformed meshes.

I guess there is a way to create a mesh procedurally, but I haven’t investigated that path yet.

Or, if you have lots of weird shapes, you might need to create a selector mesh for each model.