Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Graphics style like Sketchup

Discussion in 'General Graphics' started by wdwitte, Mar 22, 2016.

  1. wdwitte

    wdwitte

    Joined:
    Jan 28, 2015
    Posts:
    8
    hello,

    kinda new here. been playing around with unity to get familiar with it.
    For my game idea I am searching how to get my game graphics look like Google sketchup.

    Iam using the asset Simple Town from Synty Studios. My Idea is to have all the houses not in their original colors but in simple plain white/light grey color. Just like u it looks like in sketch up when u draw a house. So without a color or textures. See this image as a example which I like to make.


    Can someone point me in the right direction?

    thanks!
    Wouter
     
  2. wdwitte

    wdwitte

    Joined:
    Jan 28, 2015
    Posts:
    8
    Maybe worth mentioning. Target system is iOS / Mobile.
     
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Look into toon shading. That will get you headed down the right path.
     
  4. wdwitte

    wdwitte

    Joined:
    Jan 28, 2015
    Posts:
    8
    thanks ANMATOR2b!
    I am looking into it. It seems hard to get the same results. I suppose I have to experiment a little more.
    Most of the time the buildings lose their lines around the windows.
     
  5. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    If the target system is mobile then it's best just to UV unwrap the meshes in Blender and paint the lines in by hand.
     
  6. wdwitte

    wdwitte

    Joined:
    Jan 28, 2015
    Posts:
    8
    How about Probuilder? Looks like easy UV unwrap and drawing. Its for a bargain now.
     
  7. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    Probuilder is good for buildings, but not for UV/painting.
     
  8. Zicandar

    Zicandar

    Joined:
    Feb 10, 2014
    Posts:
    388
    If you really want to avoid textures here's a "simple" solution:
    For every "object" that has a closed series of lines, you need to make those vertexes vertex color to 1.
    Then to prevent diagonal lines from showing, you need to create an "inner" geometry, where you have vertexes with vertex color 0.
    In the pixel shader you will then be able to figure out how close to a line the pixel is, and shade based on that. ( I suggest coloring more then only what is perfectly 1! Perhaps based on distance to the pixel.)
    A square window that is normally 2 triangles would need to be converted into 4 tris, with 5 vertexes in total. (center one is 0). Then be surrounded by a "frame" of white vertices.
    It's not a perfect solution, and it requires more triangles. But upside is no post processing, (can be expensive on mobiles). No extra draw calls.

    I'm trying to figure out if it could also be done by "identifying" the vertecis that should be connected, the problem is that the rasterizer can/will cause problems.
     
  9. Zicandar

    Zicandar

    Joined:
    Feb 10, 2014
    Posts:
    388
    Ok, a potentially better solution, but one that is limited to objects with an even number of sides. (If not an equal number of sides you could use the previously mentioned solution. Note that you can combine this with the ide in the pervious post if this doesn't handle the case you need it to, such as triangles).
    To simplify the problem break everything down into squares. (This should be doable for almost all objects without much work). Note, do NOT break things into squares that require new vertices if you can avoid it. I have not worked on that case yet.

    It would be fun to hear if this idea actually works or not!

    Now some "rules" that will allow this to work, (these are evaluated in the pixel shader). (I suggest not evaluating exactly but simply if it's close enough.)

    1. If x is equal to 0 or 1 XOR if y is equal to 0 or 1 then it's valid. (XOR means if one is true but not both)
    3. If z is not equal to 0 or 1 it's invalid. (This is required for unconnected objects to be inside that are connected by vertices, such as windows).

    Now you start with one square, and a corner in this square.
    For each corner assign the following:
    1. (0,0,0,0)
    2. (1,0,1,0)
    3. (1,1,0,0)
    4. (0,1,1,0)
    If you share 2 corners with another square then apply the sequence in reverse. ("flipped" you could also call it).
    As mentioned, any object "inside" will need to have a "flipped".
    The "flipping" also applies to unconnected, (visually) objects such as windows, but in that case you mirror the side that connects.
    See attached image for an example. (Colors are the following:
    Black = displayed
    Red (text) = values
    grey = distances added to divide into squares.
    green = example of how the end triangulation could be done.
    Example.png
     
  10. lpn2

    lpn2

    Joined:
    Apr 17, 2016
    Posts:
    1
    try imputing model into sketchup and then edit it