Home Unity

Unity - Flat Shade Terrain (Seamless)

node
Offline / Send Message
Voxelope node
I have been working on the game's models, programming, animations, particles, sounds etc, and getting a soundtrack developed, everything is coming together nicely... except the terrain. :(

The intended result:

That I can sculpt, paint, etc. in Unity that looks like this.




What is actually happening:

Unity's terrain is designed/optimized to be smoothly shaded, and from anyone I have spoken with there is no easy way to force the terrain to function correctly and provide the aesthetic desired. I have tried the asset store, nearly all of the terrain shader assets are a hot mess, and support is horrific from the asset creators. I have waited nearly a month now, at first it was I will look into this ASAP, two weeks later, I am on vacation and will get back to you probably in 2049.

Trying to hire a programmer for HLSL/CG language that uses Unity often is also a struggle, most of the people I have tried say there is no solid documentation, I had a guy say he wanted $800 dollars for the terrain shader, another guy wanted $50 and copy-pasted 1700 lines of code from some Github, another struggled for three days just trying to be helpful, but as soon as he said I have to install Unity I knew fate was sealed. I even received a discord message about receiving a nomination to some award that has no website, by people who have no social media profile, and never heard of this award in any of the industry in the past 15 years. All I have to do is pay $100 or something ( totally legit right? *sarcasm* especially since my game has no terrain atm. )

It isn't looking good.

So then I started looking at something outside of Unity to create my terrain so I could import the model with flat shading. Honestly, I have never professionally done terrains, unlike other assets.

In case the above is TLDR;

I am hoping someone can suggest a nice terrain editor with some solid tutorials that can achieve the above-pictured results. I have looked into World Creator, but another $250 a year doesn't look like a great option along with my other half dozen programs I pay annual subs on. 

Here is my website with my project: http://wildorigin.online/

Respectfully,

Voxelope




Replies

  • RyanB
    A guy on another forum wrote this, maybe it will work for you.  http://makegamessa.com/discussion/3788/unity-flat-shader

    Shader "Unlit/Faceted"
    {
    	Properties
    	{
    		_BaseCol("Base colour", Color) = (1,1,1,1)
    		_TopCol("Top colour", Color) = (1,1,1,1)
    	}
    	SubShader
    	{
    		Tags { "RenderType"="Opaque" }
    		LOD 100
    
    		Pass
    		{
    			CGPROGRAM
    			#pragma vertex vert
    			#pragma fragment frag
    			// make fog work
    			#pragma multi_compile_fog
    			
    			#include "UnityCG.cginc"
    
    			struct appdata
    			{
    				float4 vertex : POSITION;
    				float2 uv : TEXCOORD0;
    			};
    
    			struct v2f
    			{
    				float2 uv : TEXCOORD0;
    				UNITY_FOG_COORDS(1)
    				float4 vertex : SV_POSITION;
    				float3 worldPos: TEXCOORD2;
    			};
    
    			sampler2D _MainTex;
    			float4 _MainTex_ST;
    			fixed4 _TopCol, _BaseCol;
    			
    			v2f vert (appdata v)
    			{
    				v2f o;
    				o.vertex = UnityObjectToClipPos(v.vertex);
    				o.uv = TRANSFORM_TEX(v.uv, _MainTex);
    				o.worldPos = mul(unity_ObjectToWorld, v.vertex);
    				UNITY_TRANSFER_FOG(o,o.vertex);
    				return o;
    			}
    			
    			fixed4 frag (v2f i) : SV_Target
    			{
    				float3 x = ddx(i.worldPos);
    				float3 y = ddy(i.worldPos);
    
    				float3 norm = -normalize(cross(x,y));
    
    				// Assume basic light shining from above
    				float l = saturate(dot(norm, float3(0,1,0)));
    				fixed4 col = lerp(_BaseCol, _TopCol, l);
    
    				// apply fog
    				UNITY_APPLY_FOG(i.fogCoord, col);
    				return col;
    			}
    			ENDCG
    		}
    	}
    }

  • .Wiki
    Offline / Send Message
    .Wiki polycounter lvl 8
    Maybe this can help. I tried to replicate the transport tycoon terrain in unity a while ago. It has NO terrain editor, everything is based on procedural noises.

    But it should be possible to feed it with a heightmap. For this you would need to transform the heightmap values into a one-dimensional float-array.

    Edit: i´ve uploaded this under mit-license. So your programmer can modify it to give you the desired look.
Sign In or Register to comment.