文章目录
- vertex shader - raw
- fragment shader - raw
- 调试RDC的shader准备选项 - remote - 不要选local
- 先查看 texture, sampler, ubo 数据
- 调试:输出原始的法线数据
- 调试:输出原始法线0\~1=>-1\~1,并应用法线强度的法线
- 调试:输出世界坐标下的法线
- 调试:输出view
- 调试:未知数值1
- 调试: UNITY_ADRENO_ES3 宏分支
- 调试:metallic, glossiness, ao
- 调试:unity_SpecCube0
- 调试:又回到 ao
- 调试:又回到 glossiness
- 调试:又回到 metallic + glossiness
- 调试: albedo
- 最终确定问题
2023.05.01 写的记录
先拿到 有问题的 vertex shader, fragment shader 分析
vertex shader - raw
#version 320 es#define HLSLCC_ENABLE_UNIFORM_BUFFERS 1
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
#define UNITY_UNIFORM
#else
#define UNITY_UNIFORM uniform
#endif
#define UNITY_SUPPORTS_UNIFORM_LOCATION 1
#if UNITY_SUPPORTS_UNIFORM_LOCATION
#define UNITY_LOCATION(x) layout(location = x)
#define UNITY_BINDING(x) layout(binding = x, std140)
#else
#define UNITY_LOCATION(x)
#define UNITY_BINDING(x) layout(std140)
#endif
uniform vec3 _WorldSpaceCameraPos;
uniform vec4 hlslcc_mtx4x4unity_ObjectToWorld[4];
uniform vec4 hlslcc_mtx4x4unity_WorldToObject[4];
uniform vec4 unity_WorldTransformParams;
uniform vec4 hlslcc_mtx4x4unity_MatrixVP[4];
uniform vec4 unity_FogParams;
uniform vec4 _MainTex_ST;
uniform vec4 _DetailAlbedoMap_ST;
uniform mediump float _UVSec;
uniform float _Curve_Depth;
uniform float _Depth_Divider;
uniform vec4 _Cam_Forward;
uniform float _Z_Dist_Offset;
in highp vec4 in_POSITION0;
in mediump vec3 in_NORMAL0;
in highp vec2 in_TEXCOORD0;
in highp vec2 in_TEXCOORD1;
in mediump vec4 in_TANGENT0;
out highp vec4 vs_TEXCOORD0;
out highp vec4 vs_TEXCOORD1;
out highp vec4 vs_TEXCOORD2;
out highp vec4 vs_TEXCOORD3;
out highp vec4 vs_TEXCOORD4;
out mediump vec4 vs_TEXCOORD5;
out highp vec4 vs_TEXCOORD7;
out highp vec3 vs_TEXCOORD8;
vec3 u_xlat0;
vec4 u_xlat1;
vec4 u_xlat2;
mediump vec3 u_xlat16_3;
float u_xlat12;
bool u_xlatb12;
void main()
{u_xlat0.xyz = in_POSITION0.yyy * hlslcc_mtx4x4unity_ObjectToWorld[1].xyz;u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[0].xyz * in_POSITION0.xxx + u_xlat0.xyz;u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[2].xyz * in_POSITION0.zzz + u_xlat0.xyz;u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[3].xyz * in_POSITION0.www + u_xlat0.xyz;u_xlat1.xyz = (-u_xlat0.xyz) + _WorldSpaceCameraPos.xyz;u_xlat12 = dot(u_xlat1.xyz, _Cam_Forward.xyz);u_xlat12 = u_xlat12 + (-_Z_Dist_Offset);u_xlat12 = max(u_xlat12, 0.0);u_xlat12 = u_xlat12 * u_xlat12;u_xlat1.x = _Depth_Divider * (-_Curve_Depth);u_xlat1.y = u_xlat12 * u_xlat1.x;u_xlat1.x = float(0.0);u_xlat1.z = float(0.0);u_xlat0.xyz = u_xlat0.xyz + u_xlat1.xyz;u_xlat1.xyz = u_xlat0.yyy * hlslcc_mtx4x4unity_WorldToObject[1].xyz;u_xlat1.xyz = hlslcc_mtx4x4unity_WorldToObject[0].xyz * u_xlat0.xxx + u_xlat1.xyz;u_xlat1.xyz = hlslcc_mtx4x4unity_WorldToObject[2].xyz * u_xlat0.zzz + u_xlat1.xyz;u_xlat1.xyz = u_xlat1.xyz + hlslcc_mtx4x4unity_WorldToObject[3].xyz;u_xlat2 = u_xlat1.yyyy * hlslcc_mtx4x4unity_ObjectToWorld[1];u_xlat2 = hlslcc_mtx4x4unity_ObjectToWorld[0] * u_xlat1.xxxx + u_xlat2;u_xlat1 = hlslcc_mtx4x4unity_ObjectToWorld[2] * u_xlat1.zzzz + u_xlat2;u_xlat1 = u_xlat1 + hlslcc_mtx4x4unity_ObjectToWorld[3];u_xlat2 = u_xlat1.yyyy * hlslcc_mtx4x4unity_MatrixVP[1];u_xlat2 = hlslcc_mtx4x4unity_MatrixVP[0] * u_xlat1.xxxx + u_xlat2;u_xlat2 = hlslcc_mtx4x4unity_MatrixVP[2] * u_xlat1.zzzz + u_xlat2;u_xlat1 = hlslcc_mtx4x4unity_MatrixVP[3] * u_xlat1.wwww + u_xlat2;gl_Position = u_xlat1;vs_TEXCOORD1.w = u_xlat1.z * unity_FogParams.z + unity_FogParams.w;
#ifdef UNITY_ADRENO_ES3u_xlatb12 = !!(_UVSec==0.0);
#elseu_xlatb12 = _UVSec==0.0;
#endifu_xlat1.xy = (bool(u_xlatb12)) ? in_TEXCOORD0.xy : in_TEXCOORD1.xy;vs_TEXCOORD0.zw = u_xlat1.xy * _DetailAlbedoMap_ST.xy + _DetailAlbedoMap_ST.zw;vs_TEXCOORD0.xy = in_TEXCOORD0.xy * _MainTex_ST.xy + _MainTex_ST.zw;vs_TEXCOORD1.xyz = u_xlat0.xyz + (-_WorldSpaceCameraPos.xyz);vs_TEXCOORD8.xyz = u_xlat0.xyz;u_xlat0.xyz = in_TANGENT0.yyy * hlslcc_mtx4x4unity_ObjectToWorld[1].xyz;u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[0].xyz * in_TANGENT0.xxx + u_xlat0.xyz;u_xlat0.xyz = hlslcc_mtx4x4unity_ObjectToWorld[2].xyz * in_TANGENT0.zzz + u_xlat0.xyz;u_xlat12 = dot(u_xlat0.xyz, u_xlat0.xyz);u_xlat12 = inversesqrt(u_xlat12);u_xlat0.xyz = vec3(u_xlat12) * u_xlat0.xyz;vs_TEXCOORD2.xyz = u_xlat0.xyz;vs_TEXCOORD2.w = 0.0;u_xlat1.x = dot(in_NORMAL0.xyz, hlslcc_mtx4x4unity_WorldToObject[0].xyz);u_xlat1.y = dot(in_NORMAL0.xyz, hlslcc_mtx4x4unity_WorldToObject[1].xyz);u_xlat1.z = dot(in_NORMAL0.xyz, hlslcc_mtx4x4unity_WorldToObject[2].xyz);u_xlat12 = dot(u_xlat1.xyz, u_xlat1.xyz);u_xlat12 = inversesqrt(u_xlat12);u_xlat1.xyz = vec3(u_xlat12) * u_xlat1.xyz;u_xlat16_3.xyz = u_xlat0.yzx * u_xlat1.zxy;u_xlat16_3.xyz = u_xlat1.yzx * u_xlat0.zxy + (-u_xlat16_3.xyz);vs_TEXCOORD4.xyz = u_xlat1.xyz;u_xlat0.x = in_TANGENT0.w * unity_WorldTransformParams.w;u_xlat16_3.xyz = u_xlat0.xxx * u_xlat16_3.xyz;vs_TEXCOORD3.xyz = u_xlat16_3.xyz;vs_TEXCOORD3.w = 0.0;vs_TEXCOORD4.w = 0.0;vs_TEXCOORD5 = vec4(0.0, 0.0, 0.0, 0.0);vs_TEXCOORD7 = vec4(0.0, 0.0, 0.0, 0.0);return;
}
fragment shader - raw
#version 320 es
#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#endifprecision highp float;
precision highp int;
#define HLSLCC_ENABLE_UNIFORM_BUFFERS 1
#if HLSLCC_ENABLE_UNIFORM_BUFFERS
#define UNITY_UNIFORM
#else
#define UNITY_UNIFORM uniform
#endif
#define UNITY_SUPPORTS_UNIFORM_LOCATION 1
#if UNITY_SUPPORTS_UNIFORM_LOCATION
#define UNITY_LOCATION(x) layout(location = x)
#define UNITY_BINDING(x) layout(binding = x, std140)
#else
#define UNITY_LOCATION(x)
#define UNITY_BINDING(x) layout(std140)
#endif
uniform vec3 _WorldSpaceCameraPos;
uniform vec4 _WorldSpaceLightPos0;
uniform vec4 hlslcc_mtx4x4unity_WorldToShadow[16];
uniform mediump vec4 _LightShadowData;
uniform vec4 unity_ShadowFadeCenterAndType;
uniform vec4 hlslcc_mtx4x4unity_MatrixV[4];
uniform mediump vec4 unity_FogColor;
uniform mediump vec4 unity_SpecCube0_HDR;
uniform mediump vec4 _LightColor0;
uniform mediump vec4 _Color;
uniform mediump float _BumpScale;
uniform mediump float _Metallic;
uniform float _Glossiness;
uniform mediump float _OcclusionStrength;
uniform float _MainTex_mipmapBias;
uniform float _BumpMap_mipmapBias;
UNITY_LOCATION(0) uniform mediump sampler2D _MRATTex;
UNITY_LOCATION(1) uniform mediump sampler2D _MainTex;
UNITY_LOCATION(2) uniform mediump sampler2D _BumpMap;
UNITY_LOCATION(3) uniform mediump samplerCube unity_SpecCube0;
UNITY_LOCATION(4) uniform highp sampler2D _ShadowMapTexture;
UNITY_LOCATION(5) uniform highp sampler2DShadow hlslcc_zcmp_ShadowMapTexture;
in highp vec4 vs_TEXCOORD0;
in highp vec4 vs_TEXCOORD1;
in highp vec4 vs_TEXCOORD2;
in highp vec4 vs_TEXCOORD3;
in highp vec4 vs_TEXCOORD4;
in highp vec3 vs_TEXCOORD8;
layout(location = 0) out mediump vec4 SV_Target0;
vec3 u_xlat0;
mediump vec3 u_xlat16_0;
mediump vec4 u_xlat16_1;
mediump vec4 u_xlat16_2;
vec4 u_xlat3;
mediump vec4 u_xlat16_3;
vec4 u_xlat4;
mediump vec4 u_xlat16_5;
mediump vec3 u_xlat16_6;
vec3 u_xlat7;
mediump float u_xlat16_9;
vec3 u_xlat10;
float u_xlat14;
mediump float u_xlat16_16;
float u_xlat17;
float u_xlat21;
mediump float u_xlat16_22;
float u_xlat25;
void main()
{u_xlat16_0.xyz = texture(_BumpMap, vs_TEXCOORD0.xy, _BumpMap_mipmapBias).xyz;u_xlat16_1.xyz = u_xlat16_0.xyz * vec3(2.0, 2.0, 2.0) + vec3(-1.0, -1.0, -1.0);u_xlat16_1.xy = u_xlat16_1.xy * vec2(_BumpScale);u_xlat16_2.xyz = u_xlat16_1.yyy * vs_TEXCOORD3.xyz;u_xlat16_1.xyw = vs_TEXCOORD2.xyz * u_xlat16_1.xxx + u_xlat16_2.xyz;u_xlat16_1.xyz = vs_TEXCOORD4.xyz * u_xlat16_1.zzz + u_xlat16_1.xyw;u_xlat0.x = dot(u_xlat16_1.xyz, u_xlat16_1.xyz);u_xlat0.x = inversesqrt(u_xlat0.x);u_xlat0.xyz = u_xlat0.xxx * u_xlat16_1.xyz;u_xlat21 = dot(vs_TEXCOORD1.xyz, vs_TEXCOORD1.xyz);u_xlat21 = inversesqrt(u_xlat21);u_xlat3.xyz = vec3(u_xlat21) * vs_TEXCOORD1.xyz;u_xlat4.xyz = (-vs_TEXCOORD1.xyz) * vec3(u_xlat21) + _WorldSpaceLightPos0.xyz;u_xlat16_1.x = dot(u_xlat3.xyz, u_xlat0.xyz);u_xlat16_1.x = u_xlat16_1.x + u_xlat16_1.x;u_xlat16_1.xyz = u_xlat0.xyz * (-u_xlat16_1.xxx) + u_xlat3.xyz;u_xlat21 = dot(u_xlat0.xyz, (-u_xlat3.xyz));
#ifdef UNITY_ADRENO_ES3u_xlat21 = min(max(u_xlat21, 0.0), 1.0);
#elseu_xlat21 = clamp(u_xlat21, 0.0, 1.0);
#endifu_xlat16_22 = (-u_xlat21) + 1.0;u_xlat16_22 = u_xlat16_22 * u_xlat16_22;u_xlat16_22 = u_xlat16_22 * u_xlat16_22;u_xlat16_3.xyz = texture(_MRATTex, vs_TEXCOORD0.xy).xyz;u_xlat21 = (-_Glossiness) * u_xlat16_3.y + 1.0;u_xlat16_2.xy = (-vec2(u_xlat21)) * vec2(0.699999988, 0.0799999982) + vec2(1.70000005, 0.600000024);u_xlat16_2.x = u_xlat21 * u_xlat16_2.x;u_xlat16_2.x = u_xlat16_2.x * 6.0;u_xlat16_5 = textureLod(unity_SpecCube0, u_xlat16_1.xyz, u_xlat16_2.x);u_xlat16_1.x = u_xlat16_5.w + -1.0;u_xlat16_1.x = unity_SpecCube0_HDR.w * u_xlat16_1.x + 1.0;u_xlat16_1.x = log2(u_xlat16_1.x);u_xlat16_1.x = u_xlat16_1.x * unity_SpecCube0_HDR.y;u_xlat16_1.x = exp2(u_xlat16_1.x);u_xlat16_1.x = u_xlat16_1.x * unity_SpecCube0_HDR.x;u_xlat16_1.xyz = u_xlat16_5.xyz * u_xlat16_1.xxx;u_xlat16_2.x = u_xlat16_3.z + -1.0;u_xlat16_2.x = _OcclusionStrength * u_xlat16_2.x + 1.0;u_xlat16_1.xyz = u_xlat16_1.xyz * u_xlat16_2.xxx;u_xlat17 = u_xlat21 * u_xlat21;u_xlat16_2.x = u_xlat21 * u_xlat17;u_xlat21 = u_xlat21 * u_xlat21 + 0.5;u_xlat16_2.x = (-u_xlat16_2.x) * u_xlat16_2.y + 1.0;u_xlat16_1.xyz = u_xlat16_1.xyz * u_xlat16_2.xxx;u_xlat16_2.x = u_xlat16_3.x * _Metallic;u_xlat16_9 = (-u_xlat16_2.x) * 0.959999979 + 0.959999979;u_xlat16_16 = (-u_xlat16_9) + 1.0;u_xlat16_16 = _Glossiness * u_xlat16_3.y + u_xlat16_16;
#ifdef UNITY_ADRENO_ES3u_xlat16_16 = min(max(u_xlat16_16, 0.0), 1.0);
#elseu_xlat16_16 = clamp(u_xlat16_16, 0.0, 1.0);
#endifu_xlat16_3.xyw = texture(_MainTex, vs_TEXCOORD0.xy, _MainTex_mipmapBias).xyz;u_xlat16_6.xyz = _Color.xyz * u_xlat16_3.xyw + vec3(-0.0399999991, -0.0399999991, -0.0399999991);u_xlat3.xyw = u_xlat16_3.xyw * _Color.xyz;u_xlat16_6.xyz = u_xlat16_2.xxx * u_xlat16_6.xyz + vec3(0.0399999991, 0.0399999991, 0.0399999991);u_xlat16_2.xzw = vec3(u_xlat16_16) + (-u_xlat16_6.xyz);u_xlat16_2.xzw = vec3(u_xlat16_22) * u_xlat16_2.xzw + u_xlat16_6.xyz;u_xlat16_1.xyz = u_xlat16_1.xyz * u_xlat16_2.xzw;u_xlat25 = dot(u_xlat4.xyz, u_xlat4.xyz);u_xlat25 = max(u_xlat25, 0.00100000005);u_xlat25 = inversesqrt(u_xlat25);u_xlat4.xyz = vec3(u_xlat25) * u_xlat4.xyz;u_xlat4.w = dot(_WorldSpaceLightPos0.xyz, u_xlat4.xyz);
#ifdef UNITY_ADRENO_ES3u_xlat4.w = min(max(u_xlat4.w, 0.0), 1.0);
#elseu_xlat4.w = clamp(u_xlat4.w, 0.0, 1.0);
#endifu_xlat4.x = dot(u_xlat0.xyz, u_xlat4.xyz);
#ifdef UNITY_ADRENO_ES3u_xlat4.x = min(max(u_xlat4.x, 0.0), 1.0);
#elseu_xlat4.x = clamp(u_xlat4.x, 0.0, 1.0);
#endifu_xlat0.x = dot(u_xlat0.xyz, _WorldSpaceLightPos0.xyz);
#ifdef UNITY_ADRENO_ES3u_xlat0.x = min(max(u_xlat0.x, 0.0), 1.0);
#elseu_xlat0.x = clamp(u_xlat0.x, 0.0, 1.0);
#endifu_xlat7.xy = u_xlat4.xw * u_xlat4.xw;u_xlat14 = max(u_xlat7.y, 0.100000001);u_xlat14 = u_xlat21 * u_xlat14;u_xlat21 = u_xlat17 * u_xlat17 + -1.0;u_xlat17 = u_xlat17 * u_xlat17;u_xlat7.x = u_xlat7.x * u_xlat21 + 1.00001001;u_xlat7.x = u_xlat7.x * u_xlat7.x;u_xlat7.x = u_xlat7.x * u_xlat14;u_xlat7.x = u_xlat7.x * 4.0;u_xlat7.x = u_xlat17 / u_xlat7.x;u_xlat7.x = u_xlat7.x + -9.99999975e-05;u_xlat7.x = max(u_xlat7.x, 0.0);u_xlat7.x = min(u_xlat7.x, 100.0);u_xlat7.xyz = u_xlat16_6.xyz * u_xlat7.xxx;u_xlat7.xyz = u_xlat3.xyw * vec3(u_xlat16_9) + u_xlat7.xyz;u_xlat3.xyz = vs_TEXCOORD8.xyz + (-unity_ShadowFadeCenterAndType.xyz);u_xlat3.x = dot(u_xlat3.xyz, u_xlat3.xyz);u_xlat3.x = sqrt(u_xlat3.x);u_xlat10.xyz = (-vs_TEXCOORD8.xyz) + _WorldSpaceCameraPos.xyz;u_xlat4.x = hlslcc_mtx4x4unity_MatrixV[0].z;u_xlat4.y = hlslcc_mtx4x4unity_MatrixV[1].z;u_xlat4.z = hlslcc_mtx4x4unity_MatrixV[2].z;u_xlat10.x = dot(u_xlat10.xyz, u_xlat4.xyz);u_xlat3.x = (-u_xlat10.x) + u_xlat3.x;u_xlat3.x = unity_ShadowFadeCenterAndType.w * u_xlat3.x + u_xlat10.x;u_xlat3.x = u_xlat3.x * _LightShadowData.z + _LightShadowData.w;
#ifdef UNITY_ADRENO_ES3u_xlat3.x = min(max(u_xlat3.x, 0.0), 1.0);
#elseu_xlat3.x = clamp(u_xlat3.x, 0.0, 1.0);
#endifu_xlat10.xyz = vs_TEXCOORD8.yyy * hlslcc_mtx4x4unity_WorldToShadow[1].xyz;u_xlat10.xyz = hlslcc_mtx4x4unity_WorldToShadow[0].xyz * vs_TEXCOORD8.xxx + u_xlat10.xyz;u_xlat10.xyz = hlslcc_mtx4x4unity_WorldToShadow[2].xyz * vs_TEXCOORD8.zzz + u_xlat10.xyz;u_xlat10.xyz = u_xlat10.xyz + hlslcc_mtx4x4unity_WorldToShadow[3].xyz;vec3 txVec0 = vec3(u_xlat10.xy,u_xlat10.z);u_xlat10.x = textureLod(hlslcc_zcmp_ShadowMapTexture, txVec0, 0.0);u_xlat16_22 = (-_LightShadowData.x) + 1.0;u_xlat16_22 = u_xlat10.x * u_xlat16_22 + _LightShadowData.x;u_xlat16_2.x = (-u_xlat16_22) + 1.0;u_xlat16_22 = u_xlat3.x * u_xlat16_2.x + u_xlat16_22;u_xlat16_2.xyz = vec3(u_xlat16_22) * _LightColor0.xyz;u_xlat7.xyz = u_xlat7.xyz * u_xlat16_2.xyz;u_xlat0.xyz = u_xlat7.xyz * u_xlat0.xxx + u_xlat16_1.xyz;u_xlat0.xyz = u_xlat0.xyz + (-unity_FogColor.xyz);u_xlat21 = vs_TEXCOORD1.w;
#ifdef UNITY_ADRENO_ES3u_xlat21 = min(max(u_xlat21, 0.0), 1.0);
#elseu_xlat21 = clamp(u_xlat21, 0.0, 1.0);
#endifu_xlat0.xyz = vec3(u_xlat21) * u_xlat0.xyz + unity_FogColor.xyz;SV_Target0.xyz = u_xlat0.xyz;SV_Target0.w = 1.0;return;
}
调试RDC的shader准备选项 - remote - 不要选local
选择:remote 还是 local是关键,因为 会影响 shader 指令的结果
当你打开 rdc 文件的时候, render doc 会提示使用
- remote 当前连接的目标设备作为解释执行的主体
- local 本地电脑来做为执行主体
如果你的抓帧数据是 移动真机设备,那么你保存下来的 rdc 再后续重新加载到 render doc 时,可以真机联调
你要确保:rdc 和 当时抓帧时的 真机上是同一个: 数据 和 设备
如果你的抓帧数据就是这台电脑 的 PC game,直接 local 就好
先查看 texture, sampler, ubo 数据
调试:输出原始的法线数据
调试:输出原始法线0~1=>-1~1,并应用法线强度的法线
调试:输出世界坐标下的法线
调试:输出view
首先在 vs 中 vs_TEXCOORD1 值的代码可以看得出来,xyz = view dir, w = fogFactor
调试:未知数值1
调试: UNITY_ADRENO_ES3 宏分支
调试:metallic, glossiness, ao
调试:unity_SpecCube0
本身是黑色的
采样出来结果必定 黑色的
从之前的 UBO 数据可以查看到:unity_SpecCube0_HDR : float4(1.0, 1.0, 0.0, 0.0)
正常来说,如果有正常的 cube 这个 hdr 解码数值不会是这个值
unity_SpecCube0 解码部分的代码,如果不了解算法原理,则可读性不高
我们可以从 unity builtin shader 中着手查看
-
先搜索:
unity_SpecCube0_HDR
,貌似只有传入到probeHDR[0]
中,待后续使用
-
那么再搜索
probeHDR
,可以得知,只有Unity_GlossyEnviroment
引用了
-
那么再搜索
Unity_GlossyEnviroment
后续还有DecodeHDR
的第二个参数
-
那么再搜索
DecodeHDR
-
最终确定了 HDR 解码部分的内容
输出一下
调试:又回到 ao
ao 应用在 spec cube 0 的采样后的遮蔽强度,ao 值越小,遮蔽越强
调试:又回到 glossiness
调试:又回到 metallic + glossiness
调试: albedo
这代码编译优化之后,可读性会看得让人头皮发麻
dot(L, H)
dot(N, H)
dot(N, L)
dot(N, H) 和 glossiness 的拟合应用
输出发现可能是有问题的
最终确定问题
hlslcc_zcmp_ShadowMapTexture
shadow texture 怎么采样出来都是 全黑色
opengl textureLod 对应 API :textureLod
shadow texture, vec3 重载的那个
结果全是黑色,明显是有问题的,但是 textureLod 采样出来为何会有这样的结果,明明 render doc 可以看到就是纯白色的,暂时没看懂
所以很有可能是因为做 shader 变体优化导致,那么我们可以另起一个 shader 变体文件,然后不需要: #define SHADOWS_SCREEN
本文链接:https://my.lmcjl.com/post/9454.html
4 评论