using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.ScriptableRenderLoop
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public class HDRenderPipelineMenuItems
using System.Linq;
internal class LayeredLitGUI : LitGUI
#include "Assets/ScriptableRenderLoop/HDRenderPipeline/Material/Lit/LitProperties.hlsl"
// All our shaders use same name for entry point
#pragma vertex Vert
#pragma fragment Frag
ENDHLSL
SubShader
HLSLPROGRAM
#pragma vertex VertDefault
#define SHADERPASS SHADERPASS_GBUFFER
#include "../../Material/Material.hlsl"
Cull[_CullMode]
#define SHADERPASS SHADERPASS_DEBUG_VIEW_MATERIAL
#define SHADERPASS SHADERPASS_FORWARD
// TEMP until pragma work in include
using UnityEngine;
using UnityEngine.Rendering;
public abstract class BaseLitGUI : ShaderGUI
class LitGUI : BaseLitGUI
#include "LitData.hlsl"
//-------------------------------------------------------------------------------------
// TODO: Here we will also have all the vertex deformation (GPU skinning, vertex animation, morph target...) or we will need to generate a compute shaders instead (better! but require work to deal with unpacking like fp16)
PackedVaryings VertDefault(Attributes input)
PackedVaryings Vert(Attributes input)
Varyings output;
public abstract class BaseUnlitGUI : ShaderGUI
class UnlitGUI : BaseUnlitGUI
float _AlphaCutoff;
Cull [_CullMode]
#define SHADERPASS SHADERPASS_FORWARD_UNLIT
// Vertex shader
return viewDirTS.xy * height;
}
// ref https://www.gamedev.net/topic/678043-how-to-blend-world-space-normals/#entry5287707
// assume compositing in world space
// Note: Using vtxNormal = float3(0, 0, 1) give the BlendNormalRNM formulation.
// TODO: Untested
float3 BlendNormalWorldspaceRNM(float3 n1, float3 n2, float3 vtxNormal)
// Build the shortest-arc quaternion
float4 q = float4(cross(vtxNormal, n2), dot(vtxNormal, n2) + 1.0) / sqrt(2.0 * (dot(vtxNormal, n2) + 1));
// Rotate the normal
return n1 * (q.w * q.w - dot(q.xyz, q.xyz)) + 2 * q.xyz * dot(q.xyz, n1) + 2 * q.w * cross(q.xyz, n1);
// assume compositing in tangent space
float3 BlendNormalRNM(float3 n1, float3 n2)
float3 t = n1.xyz + float3(0.0, 0.0, 1.0);
float3 BlendNormal(float3 n1, float3 n2)
return normalize(float3(n1.xy * n2.z + n2.xy * n1.z, n1.z * n2.z));
fileFormatVersion: 2
guid: 9582236b174d65b4391e0f9890fd2194
folderAsset: yes
timeCreated: 1483692743
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
guid: 1ea56bc9911bbad4191075872a46cc89
ShaderImporter:
defaultTextures: []
guid: 373746a83365c134fa16fcc2208ff40b
timeCreated: 1483546471
guid: 70a7ee6a44b86494daad0acd691e1d51