|
@@ -397,13 +397,13 @@ fun envmap_sample(lod: float, coord: float2): float3 { \
|
|
|
";
|
|
|
|
|
|
let str_get_pos_nor_from_depth: string = "\
|
|
|
-fun get_pos_from_depth(uv: float2, invVP: flaot4x4): float3 { \
|
|
|
+fun get_pos_from_depth(uv: float2, invVP: float4x4): float3 { \
|
|
|
var depth: float = sample_lod(gbufferD, sampler_linear, float2(uv.x, 1.0 - uv.y), 0.0).r; \
|
|
|
var wpos: float4 = float4(uv * 2.0 - 1.0, depth * 2.0 - 1.0, 1.0); \
|
|
|
wpos = invVP * wpos; \
|
|
|
return wpos.xyz / wpos.w; \
|
|
|
} \
|
|
|
-fun get_nor_from_depth(p0: float3, uv: float2, invVP: flaot4x4, tex_step: float2): float3 { \
|
|
|
+fun get_nor_from_depth(p0: float3, uv: float2, invVP: float4x4, tex_step: float2): float3 { \
|
|
|
var p1: float3 = get_pos_from_depth(uv + float2(tex_step.x * 4.0, 0.0), invVP); \
|
|
|
var p2: float3 = get_pos_from_depth(uv + float2(0.0, tex_step.y * 4.0), invVP); \
|
|
|
return normalize(cross(p2 - p0, p1 - p0)); \
|