Unity Shader学习:BRDF+IBL
https://www.cnblogs.com/timlly/p/10631718.html?from=timeline&isappinstalled=0#%E8%BE%90%E5%B0%84%E5%BC%BA%E5%BA%A6radiant-intensity
Shader "Zzc/BRDF"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {
}
_NormalTex("NormalTex",2D)="bump"{
}
_AOTex("AOTex",2D)="white"{
}
_MetallicTex("MetallicTex",2D)="white"{
}
_RoughnessTex("RoughnessTex",2D) = "white"{
}
_IBLLUT("IBLLUT",2D)="white"{
}
_Cube("Cube",CUBE)=""{
}
}
SubShader
{
Tags {
"RenderType"="Opaque" "LightMode"="ForwardBase"}
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "Lighting.cginc"
struct appdata
{
float4 vertex : POSITION;
float3 normal:NORMAL;
float4 tangent:TANGENT;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float3 worldPos:TEXCOORD1;
float3 worldToTangent1:TEXCOORD2;
float3 worldToTangent2:TEXCOORD3;
float3 worldToTangent3:TEXCOORD4;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST