Skip to content

Instantly share code, notes, and snippets.

@Glynn-Taylor
Glynn-Taylor / ToonTerrain.cginc
Last active April 2, 2024 02:00
Toon Terrain Tutorial
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Edits by Glynn Taylor. MIT license
// Includes code for splitmap by https://twitter.com/adamgryu and triplanar mapping by https://github.com/keijiro. MIT License
#ifndef TERRAIN_SPLATMAP_COMMON_CGINC_INCLUDED
#define TERRAIN_SPLATMAP_COMMON_CGINC_INCLUDED
struct Input
{
float3 localNormal : TEXCOORD0;
using System;
using UnityEditor;
//NOTE: Must be placed under a folder named "Editor" as it is a Unity editor script
public class ModelPostProcessor : AssetPostprocessor
{
static readonly string[] supportedFileExtensions = new string[] { ".fbx", ".blend" };
Shader "Toon/Lit" {
Properties {
_Color ("Main Color", Color) = (0.5,0.5,0.5,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Ramp ("Toon Ramp (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
public class ModelPostProcessor : AssetPostprocessor
{
public void OnPreprocessModel()
{
// Apple settings to all atlases